cl
2024-05-23 ba1a7a9ef126296e2798e313dc5b43f775a1123c
提交 | 用户 | 时间
71e81e 1 <!DOCTYPE html>
2 <html>
3
4 <head>
5     <meta charset="utf-8"/>
6     <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
7     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
8     <link href="${ctxPath}/assets/expand/images/favicon.ico" rel="icon">
9     <title>${constants.getSystemName()}</title>
10     <link rel="stylesheet" href="${ctxPath}/assets/common/libs/layui/css/layui.css?v=${constants.getReleaseVersion()}"/>
11     <link rel="stylesheet" href="${ctxPath}/assets/common/module/admin.css?v=${constants.getReleaseVersion()}"/>
12 </head>
13
14 <body class="layui-layout-body">
15
16 <div class="layui-layout layui-layout-admin">
17
18     <!-- 头部 -->
19     @include("/common/_header.html"){}
20
21     <!-- 侧边栏 -->
22     @include("/common/_sidebar.html"){}
23
24     <!-- 主体部分 -->
25     @include("/common/_body.html"){}
26
27     <!-- 底部 -->
28     @include("/common/_footer.html"){}
29
30 </div>
31
32 <!-- 加载动画,移除位置在common.js中 -->
33 @include("/common/loading.html"){}
34
35 @/* 加入contextPath属性和session超时的配置 */
36 <script type="text/javascript">
37     var Feng = {
38         ctxPath: "${ctxPath}",
39         version: '${constants.getReleaseVersion()}'
40     };
41 </script>
42 <script type="text/javascript" src="${ctxPath}/assets/common/libs/layui/layui.js?v=${constants.getReleaseVersion()}"></script>
43 <script type="text/javascript" src="${ctxPath}/assets/common/js/common.js?v=${constants.getReleaseVersion()}"></script>
44
45 <script>
46     layui.use(['layer', 'element', 'admin', 'index', 'ax'], function () {
47         var $ = layui.jquery;
48         var layer = layui.layer;
49         var admin = layui.admin;
50         var index = layui.index;
51         var $ax = layui.ax;
52
53         //获取支持的语言列表
54         var ajax = new $ax(Feng.ctxPath + "/translation/languages", function (data) {
55             for (var i = 0; i < data.data.length; i++) {
56                 var code = data.data[i].code;
57                 var description = data.data[i].description;
58                 $("#languageDiv").append('<dd lay-unselect><a id="tran-' + code + '" href="javascript:;">' + description + '</a></dd>');
59
60                 //设置监听事件,设置点击按钮切换当前系统语言
61                 (function (code) {
62                     $('#tran-' + code).click(function () {
63                         var ajax = new $ax(Feng.ctxPath + "/translation/changeUserTranslation", function (data) {
64                             window.location.href = Feng.ctxPath + "/";
65                         }, function (data) {
66                             layer.msg("切换多语言失败!" + data.responseJSON.message, {icon: 5, anim: 6});
67                         });
68                         ajax.set("code", code);
69                         ajax.start();
70                     });
71                 })(code);
72             }
73         }, function (data) {
74             layer.msg("获取语言列表失败!" + data.responseJSON.message, {icon: 5, anim: 6});
75         });
76         ajax.start();
77
78         // 加载当前语言字典并缓存
79         var getUserTranslationAjax = new $ax(Feng.ctxPath + "/translation/getUserTranslation", function (data) {
80             layui.data('system', {
81                 key: "lang",
82                 value: data.data
83             });
84         }, function (data) {
85             layer.msg("加载语言字典失败!" + data.responseJSON.message, {icon: 5, anim: 6});
86         });
87         getUserTranslationAjax.start();
88
89         // 默认加载主页
90         index.loadHome({
91             menuPath: $("#firstPageAction").attr('lay-href'),
92             menuName: '<i class="layui-icon layui-icon-home"></i>'
93         });
94
95         // 修改密码点击事件
96         $('#setPsw').click(function () {
97
98             //获取多语言
99             var langs = layui.data('system').lang;
100
101             admin.open({
102                 id: 'pswForm',
103                 type: 2,
104                 title: langs.MENU_CHANGE_PASSWORD,
105                 shade: 0,
106                 content: '${ctxPath}/system/user_chpwd'
107             });
108         });
109
110         // 退出登录点击事件
111         $('#btnLogout').click(function () {
112             var ajax = new $ax(Feng.ctxPath + "/logout", function (data) {
113                 Feng.success("退出成功!");
114                 window.location.href = Feng.ctxPath + "/";
115             }, function (data) {
116                 layer.msg("退出失败!" + data.responseJSON.message, {icon: 5, anim: 6});
117             });
118             ajax.start();
119         });
120     });
121 </script>
122 </body>
123
124 </html>