-
Notifications
You must be signed in to change notification settings - Fork 697
Expand file tree
/
Copy pathsystem.ts
More file actions
32 lines (31 loc) · 1.2 KB
/
system.ts
File metadata and controls
32 lines (31 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { request } from '@/utils/request'
export const modelApi = {
queryAll: (keyword?: string) =>
request.get('/system/aimodel', { params: keyword ? { keyword } : {} }),
add: (data: any) => {
const param = data
if (param.api_key) {
param.api_key = LicenseGenerator.sqlbotEncrypt(data.api_key)
}
if (param.api_domain) {
param.api_domain = LicenseGenerator.sqlbotEncrypt(data.api_domain)
}
return request.post('/system/aimodel', param)
},
edit: (data: any) => {
const param = data
if (param.api_key) {
param.api_key = LicenseGenerator.sqlbotEncrypt(data.api_key)
}
if (param.api_domain) {
param.api_domain = LicenseGenerator.sqlbotEncrypt(data.api_domain)
}
return request.put('/system/aimodel', param)
},
delete: (id: number) => request.delete(`/system/aimodel/${id}`),
query: (id: number) => request.get(`/system/aimodel/${id}`),
setDefault: (id: number) => request.put(`/system/aimodel/default/${id}`),
check: (data: any) => request.fetchStream('/system/aimodel/status', data),
platform: (id: number) => request.get(`/system/platform/org/${id}`),
userSync: (data: any) => request.post(`/system/platform/user/sync`, data),
}