Browse Source

校验账号登录状态

gzb
guozhongbo 7 months ago
parent
commit
363f47c94c

+ 3
- 3
src/api/school.js View File

@@ -51,12 +51,12 @@ export const ulogin_login_code = (data) =>
51 51
 /**
52 52
  * 3.2.0.2用户--校验登录状态
53 53
  */
54
-export const ulogin_check_login = (data) =>
55
-  setRequest("ulogin/check_login", data);
54
+export const login_check_login = (data) =>
55
+  setRequest("login/check_login", data);
56 56
 /**
57 57
  * 3.2.0.3用户--退出登录
58 58
  */
59
-export const ulogin_login_out = (data) => setRequest("ulogin/login_out", data);
59
+export const login_login_out = (data) => setRequest("login/login_out", data);
60 60
 /**
61 61
  * 3.2.1用户--管理列表
62 62
  */

+ 33
- 2
src/views/layout.vue View File

@@ -160,6 +160,7 @@
160 160
 <script>
161 161
 import { admin_detail, admin_edit_phone, admin_edit_pwd } from "@/api/admin";
162 162
 import { login_msg_code } from "@/api/login";
163
+import { login_check_login, login_login_out } from "@/api/school";
163 164
 import { logdoperatemsg_get_nrn } from "@/api/log";
164 165
 import { pwdCheck, reg } from "@/utils";
165 166
 export default {
@@ -218,6 +219,7 @@ export default {
218 219
           }
219 220
         ]
220 221
       },
222
+      time1: null,
221 223
       userInfo: {}
222 224
     };
223 225
   },
@@ -236,6 +238,7 @@ export default {
236 238
     this.userInfo = JSON.parse(
237 239
       localStorage.getItem("xh_control_userInfo")
238 240
     ).content;
241
+    this.get_check_user();
239 242
   },
240 243
   computed: {
241 244
     // 所属名称
@@ -251,8 +254,33 @@ export default {
251 254
     this.$EventBus.$on("nreadChange", () => {
252 255
       this.nreadNum = this.nreadNum > 0 ? this.nreadNum - 1 : 0;
253 256
     });
257
+    this.time1 = setInterval(() => {
258
+      this.get_check_user();
259
+    }, 1000 * 60);
260
+  },
261
+  beforeDestroy() {
262
+    if (this.time1) {
263
+      clearInterval(this.time1);
264
+    }
254 265
   },
255 266
   methods: {
267
+    //判断用户是否需要重新登录
268
+    get_check_user() {
269
+      let adminid = this.userInfo.adminid;
270
+      let loginpwd = this.userInfo.loginpwd;
271
+      login_check_login({ adminid, loginpwd }).then((res) => {
272
+        if (res.code === 0) {
273
+          if (res.obj) {
274
+            let needLogin = res.obj.needLogin;
275
+            if (needLogin) {
276
+              this.toLoginOut();
277
+            }
278
+          }
279
+        } else {
280
+          this.toLoginOut();
281
+        }
282
+      });
283
+    },
256 284
     init() {
257 285
       logdoperatemsg_get_nrn({
258 286
         rtype: this.powerParams.rtype,
@@ -382,7 +410,6 @@ export default {
382 410
                 phone: "",
383 411
                 msgcode: ""
384 412
               };
385
-
386 413
             }
387 414
           } else {
388 415
             this.$Message.error(res.msg);
@@ -402,7 +429,11 @@ export default {
402 429
     },
403 430
     // 退出
404 431
     toLoginOut() {
405
-      this.$router.push("/login");
432
+      login_login_out({ adminid: this.userInfo.adminid }).then((res) => {
433
+        this.$router.replace({
434
+          path: "/login"
435
+        });
436
+      });
406 437
     }
407 438
   }
408 439
 };

+ 1
- 1
src/views/regionSection/applicationManage/applicationManage.vue View File

@@ -471,7 +471,7 @@
471 471
               placeholder="请输入更新内容"
472 472
             ></Input>
473 473
             <div class="appcomm">
474
-              更新描述不能超过1000个字符<span class="red">{{
474
+              更新内容不能超过1000个字符<span class="red">{{
475 475
                 wallpaperInfo.appRenew.length
476 476
               }}</span
477 477
               >/1000

+ 1
- 1
src/views/schoolSection/applicationManage/applicationList.vue View File

@@ -450,7 +450,7 @@
450 450
               placeholder="请输入更新内容"
451 451
             ></Input>
452 452
             <div class="appcomm">
453
-              更新描述不能超过1000个字符<span class="red">{{
453
+              更新内容不能超过1000个字符<span class="red">{{
454 454
                 wallpaperInfo.appRenew.length
455 455
               }}</span
456 456
               >/1000

+ 11
- 1
src/views/schoolSection/deviceManage/deviceManage.vue View File

@@ -249,9 +249,10 @@
249 249
                 class="app_list"
250 250
                 v-for="item in strategyInfo.padApps"
251 251
                 :key="item.appid"
252
+                :title="item.appName"
252 253
               >
253 254
                 <img :src="$api.baseImageUrl + item.appIcon" />
254
-                <div>{{ item.appName }}</div>
255
+                <div class="appName">{{ item.appName }}</div>
255 256
               </div>
256 257
             </div>
257 258
           </div>
@@ -1822,6 +1823,15 @@ export default {
1822 1823
             height: 40px;
1823 1824
             object-fit: cover;
1824 1825
           }
1826
+          .appName {
1827
+            width: 100px;
1828
+            padding: 0 8px;
1829
+            cursor: pointer;
1830
+            overflow: hidden;
1831
+            text-overflow: ellipsis;
1832
+            white-space: nowrap;
1833
+            line-height: 14px;
1834
+          }
1825 1835
           .checked {
1826 1836
             position: absolute;
1827 1837
             right: 2px;

Loading…
Cancel
Save