Browse Source

Merge branch 'yunpan_sm4'

lwx_v12
han2015 6 days ago
parent
commit
e7f5eb3b18
  1. 4
      .env.development
  2. 4
      .env.production
  3. 38
      src/api/doc/index.ts
  4. 56
      src/api/doc/space.ts
  5. 5
      src/api/doc/type.ts
  6. 5
      src/utils/axios/index.ts

4
.env.development

@ -13,4 +13,6 @@ VITE_APP_SYSTEM_APP = 'stzl'
VITE_APP_AGAIN = 1 VITE_APP_AGAIN = 1
VITE_OFFICE_HOST='http://myvuetest.net/kkapi' VITE_OFFICE_HOST='http://myvuetest.net/kkapi'
VITE_ONLYOFFICE_HOST = 'http://myvuetest.net/onlyoffice' VITE_ONLYOFFICE_HOST = 'http://myvuetest.net/onlyoffice'
VITE_DEFAULT_AI_AGENT = '5bd9b0e9-d3f4-4089-670a-880009e925a8' VITE_DEFAULT_AI_AGENT = '5bd9b0e9-d3f4-4089-670a-880009e925a8'
VITE_AI_API_TOKEN = '7551e976-d154-44a2-7569-204277f5123a'

4
.env.production

@ -8,4 +8,6 @@ VITE_APP_SJZT_URL = 'http://120.224.6.6:29911/prod-api'
VITE_APP_SYSTEM_APP = 'stzl' VITE_APP_SYSTEM_APP = 'stzl'
VITE_APP_AGAIN = 1 VITE_APP_AGAIN = 1
VITE_ONLYOFFICE_HOST = 'https://gyhlw.hxgk.group/onlyoffice' VITE_ONLYOFFICE_HOST = 'https://gyhlw.hxgk.group/onlyoffice'
VITE_DEFAULT_AI_AGENT = '74938263-ffe5-43c5-90af-25e62d34a51f' VITE_DEFAULT_AI_AGENT = '74938263-ffe5-43c5-90af-25e62d34a51f'
VITE_AI_API_TOKEN = '7551e976-d154-44a2-7569-204277f5123a'

38
src/api/doc/index.ts

@ -6,7 +6,7 @@
import request from '@/utils/axios/index'; import request from '@/utils/axios/index';
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
}); });
@ -154,7 +163,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
}); });
@ -169,7 +179,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
}); });
@ -184,7 +195,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
}); });

56
src/api/doc/space.ts

@ -1,6 +1,6 @@
import request from '@/utils/axios/index'; import request from '@/utils/axios/index';
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
}); });
@ -138,7 +146,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)
@ -154,7 +163,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)
} }
@ -168,6 +178,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
}); });
} }
@ -181,6 +195,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
}); });
} }
@ -194,6 +212,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
}); });
} }
@ -207,6 +229,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
}); });
} }
@ -232,6 +258,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
}); });
} }
@ -243,6 +273,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
}); });
} }

5
src/api/doc/type.ts

@ -5,6 +5,8 @@
*/ */
import request from '@/utils/axios/index'; import request from '@/utils/axios/index';
import { AxiosPromise } from 'axios'; import { AxiosPromise } from 'axios';
export const apptoken: string = import.meta.env.VITE_AI_API_TOKEN;
/** /**
* *
*/ */
@ -103,7 +105,8 @@ export function doFileUpload(params:FormData,_url:string): AxiosPromise<matterIn
method: 'post', method: 'post',
data: params, data: params,
headers: { headers: {
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data',
'App-Api-Token': apptoken
} }
}); });
} }

5
src/utils/axios/index.ts

@ -27,6 +27,11 @@ service.interceptors.request.use((config: InternalAxiosRequestConfig) => {
config.headers["user-token"] = userPinia.userToken; config.headers["user-token"] = userPinia.userToken;
} }
//form 云盘请求不加密, 但是Auth-key还是要传输,接口返回的数据可能需要加密 :by han2015
if (config.headers['Content-Type'] == 'application/x-www-form-urlencoded'||config.headers['Content-Type'] == 'multipart/form-data' ){
return config
}
// console.error('<---------------请求拦截---------->') // console.error('<---------------请求拦截---------->')
// console.error('请求拦截----config------>', config.url) // console.error('请求拦截----config------>', config.url)
// console.error('请求拦截----data------>', config) // console.error('请求拦截----data------>', config)

Loading…
Cancel
Save