2 Commits ae5c87215a ... 759423c22a

Tác giả SHA1 Thông báo Ngày
  luzhenxing 759423c22a commit 2 ngày trước cách đây
  luzhenxing 53bbb023e4 edit .env 2 ngày trước cách đây

+ 2 - 2
.env.development

@@ -12,9 +12,9 @@ VITE_DROP_CONSOLE = false
 # vite 本地跨域代理
 # VITE_PROXY=[["/fms-api","https://wxadminapi.gkscrm.com"]]
 # Basic interface address SPA
-VITE_GLOB_API_URL=
+VITE_GLOB_API_URL=https://wxadminapi-debug.gkscrm.com
 # File upload address, optional
-VITE_GLOB_UPLOAD_URL=
+VITE_GLOB_UPLOAD_URL=https://wxadminapi-debug.gkscrm.com
 # VITE_GLOB_API_URL=
 # VITE_GLOB_API_URL=/sys-api
 

+ 1 - 0
src/api/model/baseModel.ts

@@ -54,6 +54,7 @@ export interface BaseNodeReq{
 
 export interface BaseIDsReq {
   ids?: any[];
+  id?: number;
   departmentName?: string;
   avatar?: string;
   departmentRemark?: string;

+ 14 - 0
src/api/wechat/token.ts

@@ -17,6 +17,7 @@ enum Api {
   GetTokenList = '/wechat-api/token/third/list',
   DeleteToken = '/wechat-api/token/third/delete',
   GetTokenById = '/wechat-api/token/third/detail',
+  ClearToken = '/wechat-api/token/third/clear',
 }
 
 /**
@@ -80,3 +81,16 @@ export const getTokenById = (params: BaseIDReq, mode: ErrorMessageMode = 'notice
     },
   );
 };
+
+/**
+ *  @description: Clear token
+ */
+export const clearToken = (params: BaseIDsReq, mode: ErrorMessageMode = 'notice') => {
+  return defHttp.post<BaseResp>(
+    { url: Api.ClearToken, params: params },
+    {
+      errorMessageMode: mode,
+      successMessageMode: mode,
+    },
+  );
+};

+ 1 - 1
src/locales/lang/zh-CN/wechat.ts

@@ -133,7 +133,7 @@ export default {
     expireAt: 'ExpireAt',
     expireAtStr: '过期时间',
     token: 'Token',
-    mac: 'Mac',
+    mac: 'Mac地址',
     addToken: '添加 Token',
     editToken: '编辑 Token',
     tokenList: 'Token 列表',

+ 15 - 1
src/views/wechat/token/index.vue

@@ -22,6 +22,15 @@
           <TableAction
             :actions="[
               {
+                label: '设备绑定解除',
+                ifShow: permCode === '001',
+                popConfirm: {
+                  title: '确定解除设备绑定吗?',
+                  placement: 'left',
+                  confirm: handleUnbind.bind(null, record),
+                },
+              },
+              {
                 label: '编辑',
                 onClick: handleEdit.bind(null, record),
                 ifShow: permCode === '001',
@@ -57,7 +66,7 @@ import TokenDrawer from './TokenDrawer.vue';
 import { useI18n } from 'vue-i18n';
 
 import { columns, searchFormSchema } from './token.data';
-import { getTokenList, deleteToken, updateToken } from '@/api/wechat/token';
+import { getTokenList, deleteToken, updateToken, clearToken } from '@/api/wechat/token';
 import { getPermCode } from '@/api/sys/user';
 import SelectAIAgentModal from '@/views/components/SelectAIAgentModal.vue';
 import { useModal } from '/@/components/Modal';
@@ -157,4 +166,9 @@ async function handleUpdateAgent({id, agentId: agent_id }) {
   closeAIAgentModal();
   reload()
 }
+
+async function handleUnbind(record: Recordable) {
+  await clearToken({ id: record.id });
+  await reload();
+}
 </script>

+ 5 - 5
src/views/wechat/token/token.data.ts

@@ -35,11 +35,11 @@ export const columns: BasicColumn[] = [
     dataIndex: 'organizationName',
     width: 50,
   },
-  // {
-  //   title: t('wechat.token.mac'),
-  //   dataIndex: 'mac',
-  //   width: 100,
-  // },
+  {
+    title: t('wechat.token.mac'),
+    dataIndex: 'mac',
+    width: 50,
+  },
   {
     title: t('common.createTime'),
     dataIndex: 'createdAt',