Pārlūkot izejas kodu

sas 登录并发控制

aeizzz 1 gadu atpakaļ
vecāks
revīzija
efb003a192

+ 2 - 2
src/api/admin/token.js

@@ -20,8 +20,8 @@ import request from '@/router/axios'
 export function fetchList(query) {
   return request({
     url: '/admin/token/page',
-    method: 'get',
-    params: query
+    method: 'post',
+    data: query
   })
 }
 

+ 5 - 4
src/const/crud/admin/client.js

@@ -167,14 +167,15 @@ export const tableOption = {
           dicUrl: '/admin/dict/type/enc_flag_types',
         },
         {
-          label: '同时在线数量',
+          label: '允许同时在线',
           labelWidth: 100,
           border: true,
           prop: 'onlineQuantity',
           align: 'center',
-          type: 'number',
-          minRows: 0,
-          maxRows: 100,
+          type: 'radio',
+          value: '1',
+          dataType: 'string',
+          dicUrl: '/admin/dict/type/enc_flag_types'
         }]
     }
   ]

+ 4 - 9
src/const/crud/admin/token.js

@@ -29,7 +29,7 @@ export const tableOption = {
   column: [
     {
       label: "用户ID",
-      prop: "user_id",
+      prop: "userId",
       align: "center",
     },
     {
@@ -40,23 +40,18 @@ export const tableOption = {
     },
     {
       label: "客户端",
-      prop: "client_id",
+      prop: "clientId",
       align: "center",
     },
     {
       label: "令牌",
-      prop: "access_token",
+      prop: "accessToken",
       align: "center",
       overHidden: true
     },
     {
-      label: "类型",
-      prop: "token_type",
-      align: "center"
-    },
-    {
       label: "过期时间",
-      prop: "expires_in",
+      prop: "expiresAt",
       align: "center"
     }
   ]

+ 2 - 2
src/views/admin/token/index.vue

@@ -85,13 +85,13 @@ export default {
     },
     handleDel: function (row, index) {
       var _this = this;
-      this.$confirm("是否强制" + row.access_token + "下线?", "提示", {
+      this.$confirm("是否强制" + row.accessToken + "下线?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
         type: "warning",
       })
         .then(function () {
-          return delObj(row.access_token);
+          return delObj(row.accessToken);
         })
         .then(() => {
           _this.$message.success("强制下线成功");