From 4f69317eb864b24ddb36c8e517344ddf11d22a3e Mon Sep 17 00:00:00 2001
From: 克 刘 <4345453@qq.com>
Date: Thu, 18 Jun 2020 16:28:22 +0800
Subject: [PATCH] 加强table.render中验证token,用于控制单个设备登录后跳转login

---
 kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/system/user.html |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/system/user.html b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/system/user.html
index 14f3f96..3662c61 100644
--- a/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/system/user.html
+++ b/kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/system/user.html
@@ -72,15 +72,23 @@
                         return d.sex == 0 ? "男" : "女"
                     }, width: 100
                 },
-                {
-                    sort: true, width: 200, templet: function (d) {
-                        return util.toDateString(d.createTime);
-                    }, title: '创建时间'
-                },
+                // {
+                //     sort: true, width: 200, templet: function (d) {
+                //         return util.toDateString(d.createTime);
+                //     }, title: '创建时间'
+                // },
+                { field: 'createTime', width: 250, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" },
                 { field: 'enabled', width: 100, sort: true, templet: '#user-tpl-state', title: '状态' },
                 { fixed: 'right', align: 'center', toolbar: '#user-table-bar', title: '操作', width: 300 }
             ]],
-            done:function(){
+            done:function(res){
+                if(res.code==401){
+                    config.removeToken();
+                    layer.msg('登录过期', {icon: 2, time: 1500}, function () {
+                        location.replace('/login.html');
+                    }, 1000);
+                    return;
+                }
                 permissionsInput();
             }
         });

--
Gitblit v1.8.0