Browse Source

云盘:sm4 encrypted for api

han_s1
han2015 3 days ago
parent
commit
895502cbf5
  1. 1
      .env.development
  2. 1
      .env.production
  3. 30
      src/api/date/chatbi.ts
  4. 44
      src/api/doc/index.ts
  5. 64
      src/api/doc/space.ts
  6. 10
      src/api/doc/type.ts
  7. 18
      src/api/hr/people/share_ctrol.ts
  8. 3
      src/store/modules/orgMember.ts
  9. 36
      src/utils/request.ts
  10. 2
      src/views/date/device_panel.vue
  11. 5
      src/views/doc/spacePermission.vue

1
.env.development

@ -15,3 +15,4 @@ VITE_DEFAULT_AI_AGENT = '5bd9b0e9-d3f4-4089-670a-880009e925a8'
#流程制度 #流程制度
VITE_REGUL_AI_AGENT = 'e3be1378-3915-4e5c-b526-9f5447df39ea' VITE_REGUL_AI_AGENT = 'e3be1378-3915-4e5c-b526-9f5447df39ea'
VITE_APP_SM4_APP_KEY = '04TzMuvkHm_EZnHm' VITE_APP_SM4_APP_KEY = '04TzMuvkHm_EZnHm'
VITE_AI_API_TOKEN = '7551e976-d154-44a2-7569-204277f5123a'

1
.env.production

@ -11,3 +11,4 @@ VITE_DEFAULT_AI_AGENT = '74938263-ffe5-43c5-90af-25e62d34a51f'
#流程制度 #流程制度
VITE_REGUL_AI_AGENT = 'e3be1378-3915-4e5c-b526-9f5447df39ea' VITE_REGUL_AI_AGENT = 'e3be1378-3915-4e5c-b526-9f5447df39ea'
VITE_APP_SM4_APP_KEY = '04TzMuvkHm_EZnHm' VITE_APP_SM4_APP_KEY = '04TzMuvkHm_EZnHm'
VITE_AI_API_TOKEN = '7551e976-d154-44a2-7569-204277f5123a'

30
src/api/date/chatbi.ts

@ -1,5 +1,5 @@
import request from '@/utils/request'; import request from '@/utils/request';
import axios from 'axios'; export const apptoken: string = import.meta.env.VITE_AI_API_TOKEN;
/** /**
* *
*/ */
@ -7,12 +7,23 @@ export function getDevicesTree() {
return request({ return request({
url: "/aibot/devices/tree", url: "/aibot/devices/tree",
method: "get", method: "get",
headers: {
'App-Api-Token': apptoken
}
}); });
} }
export function getDevicesMonitors(data:{deviceCode:string,rows:number,page:number}) { export function getDevicesMonitors(data:{deviceCode:string,rows:number,page:number}) {
return axios.post( import.meta.env.VITE_APP_BASE_API+"/aibot/devices/ep_monitors",data); return request({
url: "/aibot/devices/ep_monitors",
method: 'post',
headers: {
'App-Api-Token': apptoken
},
data: data
});
//return axios.post( import.meta.env.VITE_APP_BASE_API+"/aibot/devices/ep_monitors",data);
} }
// 获取ChatBI列表 // 获取ChatBI列表
@ -20,6 +31,9 @@ export function getChatBIList() {
return request({ return request({
url: '/aibot/chatbi/list', url: '/aibot/chatbi/list',
method: 'get', method: 'get',
headers: {
'App-Api-Token': apptoken
},
}); });
} }
@ -28,6 +42,9 @@ export function newChatBI(data: any) {
return request({ return request({
url: '/aibot/chatbi/new', url: '/aibot/chatbi/new',
method: 'post', method: 'post',
headers: {
'App-Api-Token': apptoken
},
data: data data: data
}); });
} }
@ -37,6 +54,9 @@ export function editChatBI(data: any) {
return request({ return request({
url: '/aibot/chatbi/edit', url: '/aibot/chatbi/edit',
method: 'post', method: 'post',
headers: {
'App-Api-Token': apptoken
},
data: data data: data
}); });
} }
@ -46,6 +66,9 @@ export function delChatBI(data: any) {
return request({ return request({
url: '/aibot/chatbi/del', url: '/aibot/chatbi/del',
method: 'post', method: 'post',
headers: {
'App-Api-Token': apptoken
},
data: data data: data
}); });
} }
@ -60,6 +83,9 @@ export function askChatBI(data: askChatBIRequest, mode:string) {
return request({ return request({
url: '/aibot/chatbi/api?mode='+mode, url: '/aibot/chatbi/api?mode='+mode,
method: 'post', method: 'post',
headers: {
'App-Api-Token': apptoken
},
data: data data: data
}); });
} }

44
src/api/doc/index.ts

@ -6,7 +6,7 @@
import request from '@/utils/request'; import request from '@/utils/request';
import { AxiosPromise } from 'axios'; import { AxiosPromise } from 'axios';
import { matterPage,matterResutList,createDir,createShare,respCreateShare,matterTreeList} from './type'; import { matterPage,matterResutList,createDir,createShare,respCreateShare,matterTreeList,apptoken} from './type';
/** /**
@ -18,7 +18,8 @@ export function getShareList( uid:string,data?: matterPage): AxiosPromise<matter
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -33,7 +34,8 @@ export function doCreateSpace( uid:string,_name:string) {
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: {name:_name} data: {name:_name}
}); });
@ -48,7 +50,8 @@ export function getMySpaces(uid:string,data?: any){
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -63,7 +66,8 @@ export function getShareBrowse( uid:string,data?: matterPage): AxiosPromise<resp
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -78,7 +82,8 @@ export function postShareDelete( uid:string,data?: matterPage): AxiosPromise<res
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -94,7 +99,8 @@ export function getMatterList( uid:string,data?: matterPage): AxiosPromise<matte
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -110,7 +116,8 @@ export function getRecyclingList( uid:string,data?: matterPage): AxiosPromise<ma
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -125,7 +132,8 @@ export function postCreateDir(uid:string,data?: createDir){
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -140,7 +148,8 @@ export function postDelMatter(uid:string,data?: any){
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -157,7 +166,8 @@ export function postDelMatBatch(uid:string,data?: any){
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -172,7 +182,8 @@ export function postClearDelsBatch(uid:string,data?: any){
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -187,7 +198,8 @@ export function postCreateShare(uid:string,data?: createShare): AxiosPromise<res
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -202,7 +214,8 @@ export function postMatterRename(uid:string,data?: {uuid:string;name:string}){
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -217,7 +230,8 @@ export function postMatterMove(uid:string,data?: {srcUuids:string;destUuid:strin
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });

64
src/api/doc/space.ts

@ -1,6 +1,6 @@
import request from '@/utils/request'; import request from '@/utils/request';
import { AxiosPromise } from 'axios'; import { AxiosPromise } from 'axios';
import { matterPage,createDir,matterTreeList,matterInfo} from './type'; import { matterPage,createDir,matterTreeList,apptoken} from './type';
/** /**
* *
@ -11,7 +11,8 @@ export function getSpaceMatterList( uid:string,data?: matterPage): AxiosPromise<
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -26,7 +27,8 @@ export function doCreateSpaceDir(uid:string,data?: createDir){
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -38,7 +40,8 @@ export function doCreateAiagent(uid:string,data?: {space:string,matter:string}){
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -53,7 +56,8 @@ export function doAccessManage(uid:string,data?: any){
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -68,7 +72,8 @@ export function doDelSpace(uid:string,data?: any){
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -83,7 +88,8 @@ export function spaceMatterRename(uid:string,data?: any){
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -99,7 +105,8 @@ export function doDelSpaceMatter(uid:string,data?: any){
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -114,7 +121,8 @@ export function doAiTraining(_url:string,data?: any){
url: '/aibot'+_url, url: '/aibot'+_url,
method: 'post', method: 'post',
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -125,7 +133,8 @@ export function doAiDocDels(_url:string,data?: any){
url: '/aibot'+_url, url: '/aibot'+_url,
method: 'post', method: 'post',
headers: { headers: {
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -149,7 +158,8 @@ export function doAiChat(_url:string,data: aiChatData,sig?:AbortSignal){
_url,{ _url,{
method: 'post', method: 'post',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json',
'App-Api-Token': apptoken
}, },
signal:sig, signal:sig,
body: JSON.stringify(data) body: JSON.stringify(data)
@ -165,7 +175,8 @@ export function doAiWorkflow(_url:string,data: aiChatData){
_url,{ _url,{
method: 'post', method: 'post',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json',
'App-Api-Token': apptoken
}, },
body: JSON.stringify(data) body: JSON.stringify(data)
} }
@ -180,9 +191,10 @@ export function setAgentQueryURL(uuid:string,data: {urls:string}){
url: `/aibot/agents/${uuid}/query/url`, url: `/aibot/agents/${uuid}/query/url`,
method: 'post', method: 'post',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json',
'App-Api-Token': apptoken
}, },
data: JSON.stringify(data) data: data
} }
) )
} }
@ -207,6 +219,10 @@ export function getAiChatList(data:any){
return request({ return request({
url: '/aibot/chat/list', url: '/aibot/chat/list',
method: 'post', method: 'post',
headers: {
'Content-Type': 'application/json',
'App-Api-Token': apptoken
},
data: data data: data
}); });
} }
@ -220,6 +236,10 @@ export function getAiChat(data: any){
return request({ return request({
url: '/aibot/chat', url: '/aibot/chat',
method: 'post', method: 'post',
headers: {
'Content-Type': 'application/json',
'App-Api-Token': apptoken
},
data: data data: data
}); });
} }
@ -233,6 +253,10 @@ export function delAiChat(data: any){
return request({ return request({
url: '/aibot/chat/del', url: '/aibot/chat/del',
method: 'post', method: 'post',
headers: {
'Content-Type': 'application/json',
'App-Api-Token': apptoken
},
data: data data: data
}); });
} }
@ -246,6 +270,10 @@ export function setAiChat(data: any){
return request({ return request({
url: '/aibot/chat/update', url: '/aibot/chat/update',
method: 'post', method: 'post',
headers: {
'Content-Type': 'application/json',
'App-Api-Token': apptoken
},
data: data data: data
}); });
} }
@ -258,6 +286,10 @@ export function getAiagentList(data?: any){
return request({ return request({
url: '/aibot/agent/list', url: '/aibot/agent/list',
method: 'post', method: 'post',
headers: {
'Content-Type': 'application/json',
'App-Api-Token': apptoken
},
data: data data: data
}); });
} }
@ -283,6 +315,10 @@ export function newShareChat(data: any){
return request({ return request({
url: '/aibot/chat/share', url: '/aibot/chat/share',
method: 'post', method: 'post',
headers: {
'Content-Type': 'application/json',
'App-Api-Token': apptoken
},
data: data data: data
}); });
} }

10
src/api/doc/type.ts

@ -8,6 +8,7 @@ import { AxiosPromise } from 'axios';
/** /**
* *
*/ */
export const apptoken: string = import.meta.env.VITE_AI_API_TOKEN;
export interface matterPage{ export interface matterPage{
page?:number; page?:number;
pageSize?:number; pageSize?:number;
@ -97,7 +98,8 @@ export function doFileUpload(uid:string,params:FormData,_url:string): AxiosPromi
data: params, data: params,
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data',
'App-Api-Token': apptoken
} }
}); });
} }
@ -111,7 +113,8 @@ export function logUploadError(params:{content:string}): AxiosPromise<matterInfo
method: 'post', method: 'post',
data: params, data: params,
headers: { headers: {
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data',
'App-Api-Token': apptoken
} }
}); });
} }
@ -131,7 +134,8 @@ export function getUploadErrList( uid:string): AxiosPromise<ErrUploadLog[]> {
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data',
'App-Api-Token': apptoken
}, },
}); });
} }

18
src/api/hr/people/share_ctrol.ts

@ -9,7 +9,7 @@ export interface shareOrgInfo{
status:boolean status:boolean
child :shareOrgInfo[] child :shareOrgInfo[]
} }
const apptoken: string = import.meta.env.VITE_AI_API_TOKEN;
/** /**
* *
*/ */
@ -67,7 +67,8 @@ export function getPermitedList(uid:string,data:{uuid:string}): AxiosPromise<{pe
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -86,7 +87,8 @@ export function getSpaceMemberList(uid:string,data:{space?:string,matter:string}
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -101,7 +103,8 @@ export function addSpaceManager(uid:string,data:{space:string,mangers:string}):
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -116,6 +119,7 @@ export function updateSpaceMetterPermit(uid:string,data:{space:string,matter:str
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -130,7 +134,8 @@ export function resetSpaceMatterPermit(uid:string,data:{space:string,matter:stri
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });
@ -145,7 +150,8 @@ export function postPermitedList(uid:string,data?:{permitList:string,permitInfos
method: 'post', method: 'post',
headers: { headers: {
'Identifier':uid, 'Identifier':uid,
'Content-Type': 'application/x-www-form-urlencoded' 'Content-Type': 'application/x-www-form-urlencoded',
'App-Api-Token': apptoken
}, },
data: data data: data
}); });

3
src/store/modules/orgMember.ts

@ -1,7 +1,6 @@
import { defineStore } from 'pinia' import { defineStore } from 'pinia'
import { ref} from 'vue'; import { ref} from 'vue';
import request from "@/utils/request"; import request from "@/utils/request";
import { id } from 'element-plus/es/locale';
export const useOrgMemberStore = defineStore('orgMember', () => { export const useOrgMemberStore = defineStore('orgMember', () => {
interface OrgMemberItem { interface OrgMemberItem {
@ -14,6 +13,7 @@ export const useOrgMemberStore = defineStore('orgMember', () => {
const dataTree = ref<OrgMemberItem>({ id: '', name: '', child: [] }) const dataTree = ref<OrgMemberItem>({ id: '', name: '', child: [] })
async function havueOrgTree() { async function havueOrgTree() {
if(dataTree.value.child?.length>0) return;
await request({ await request({
url: "/systemapi/app/get_org_everyone_people",//"172.20 .2.87:39168", url: "/systemapi/app/get_org_everyone_people",//"172.20 .2.87:39168",
@ -24,6 +24,7 @@ export const useOrgMemberStore = defineStore('orgMember', () => {
dataTree.value={id:"313",name:"集团公司",child:response.data} dataTree.value={id:"313",name:"集团公司",child:response.data}
handleChildren(response.data) handleChildren(response.data)
}); });
} }
function handleChildren(childs:any[]){ function handleChildren(childs:any[]){

36
src/utils/request.ts

@ -40,24 +40,28 @@ service.interceptors.request.use(
if (userStore.userToken) { if (userStore.userToken) {
config.headers["user-token"] = userStore.userToken; config.headers["user-token"] = userStore.userToken;
} }
// if (config.headers['content-type'] === 'application/json') { //form 云盘请求不加密, 但是Auth-key还是要传输,接口返回的数据可能需要加密 :by han2015
let { data, headers } = config if (config.headers['Content-Type'] == 'application/x-www-form-urlencoded'||config.headers['Content-Type'] == 'multipart/form-data' ){
//获取16位随机数 return config
let randomString = generateRandomString(16)
config.headers['Auth-key'] = randomString
if (data) {
// 加密请求数据
config.data = {
data: sm4EncryptMethod(JSON.stringify(data), randomString)
}
} }
console.log('请求拦截---------->', randomString)
console.log('请求拦截----headers------>', headers)
console.log('请求拦截----data------>', config.data)
console.log('请求拦截----config------>', config)
// }
let { data, headers } = config
let randomString = generateRandomString(16)
config.headers['Auth-key'] = randomString
//获取16位随机数
if (data) {
// 加密请求数据
config.data = {
data: sm4EncryptMethod(JSON.stringify(data), randomString)
}
}
console.log('请求拦截---------->', randomString)
console.log('请求拦截----headers------>', headers)
console.log('请求拦截----data------>', config.data)
console.log('请求拦截----config------>', config)
// console.log('请求拦截----content-type------>', config.headers['Content-Type']) // console.log('请求拦截----content-type------>', config.headers['Content-Type'])
// console.log('请求拦截----config------>', config.headers) // console.log('请求拦截----config------>', config.headers)
return config return config
@ -82,7 +86,7 @@ service.interceptors.response.use(
let jsonData = sm4DecryptMethod(data.data, authKey) let jsonData = sm4DecryptMethod(data.data, authKey)
response.data.data = JSON.parse(jsonData) response.data.data = JSON.parse(jsonData)
} }
console.log('行营结果----解密结构------>', headers['auth-key'], response) console.log('行营结果----解密结构------>', response.data)
const { code, msg } = response.data; const { code, msg } = response.data;
if (code === 0 || code === 200 || code === 10001) { if (code === 0 || code === 200 || code === 10001) {
return response.data; return response.data;

2
src/views/date/device_panel.vue

@ -44,7 +44,7 @@ const freshPage=(page:number)=>{
}).then(res=>{ }).then(res=>{
checkoptions.value=[] checkoptions.value=[]
opTotal.value=0 opTotal.value=0
if(res.status==200){ if(res.code==200){
opTotal.value=res.data.total opTotal.value=res.data.total
res.data.rows?.forEach(row => { res.data.rows?.forEach(row => {
checkoptions.value.push({id:row.id,name:row.name,code:row.code}) checkoptions.value.push({id:row.id,name:row.name,code:row.code})

5
src/views/doc/spacePermission.vue

@ -194,9 +194,9 @@ function refreshSpaceData(){
getSpaceMemberList( getSpaceMemberList(
btoa(props.uid), btoa(props.uid),
{space:props.spaceid,matter:props.uuid} {space:props.spaceid,matter:props.uuid}
).then(resp=>{ ).then(async (resp)=>{
await orgMembers.havueOrgTree()
resp.data?.dprts?.forEach(item=>{ resp.data?.dprts?.forEach(item=>{
orgMembers.havueOrgTree()
for(let data of dataSource.value){ for(let data of dataSource.value){
if (data.id==item) return; if (data.id==item) return;
if (checkNode(item,data)) return; if (checkNode(item,data)) return;
@ -273,7 +273,6 @@ function checkNode(key:string,node:Tree):boolean{
onMounted(()=>{ onMounted(()=>{
refreshSpaceData() refreshSpaceData()
orgMembers.havueOrgTree()
}) })
</script> </script>

Loading…
Cancel
Save