46 lines
1.4 KiB
JavaScript
46 lines
1.4 KiB
JavaScript
|
|
import request from '@/utils/request.js'
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
export const updateConfigShellService = (data) => {
|
||
|
|
const params = new URLSearchParams();
|
||
|
|
const jsonString = encodeURIComponent(JSON.stringify(data));
|
||
|
|
params.append('data', jsonString);
|
||
|
|
return request.post('/shell/update', params, { "headers": { 'token': data.token } });
|
||
|
|
}
|
||
|
|
|
||
|
|
export const deleteConfigShellService = (data) => {
|
||
|
|
const params = new URLSearchParams();
|
||
|
|
for (let key in data) {
|
||
|
|
params.append(key, data[key])
|
||
|
|
}
|
||
|
|
return request.post('/shell/delete', params, { "headers": { 'token': data.token } });
|
||
|
|
}
|
||
|
|
|
||
|
|
export const addConfigShellService = (data) => {
|
||
|
|
const params = new URLSearchParams();
|
||
|
|
for (let key in data) {
|
||
|
|
if(key === 'token'){
|
||
|
|
continue;
|
||
|
|
}
|
||
|
|
params.append(key, data[key])
|
||
|
|
}
|
||
|
|
return request.post('/shell/create', params, { "headers": { 'token': data.token },'Content-Type': 'application/json' });
|
||
|
|
}
|
||
|
|
|
||
|
|
export const getConfigShellListService = (data) => {
|
||
|
|
const params = new URLSearchParams();
|
||
|
|
for (let d in data) {
|
||
|
|
params.append(d, data[d]);
|
||
|
|
}
|
||
|
|
// request.headers["Content-Type"] = "application/json
|
||
|
|
let request1 = request;
|
||
|
|
request1.defaults.headers["token"] = data.token.value;
|
||
|
|
return request1.post('/shell/list', params, {
|
||
|
|
headers: {
|
||
|
|
'token': data.token, // 将 token 替换为您的令牌值
|
||
|
|
}
|
||
|
|
}
|
||
|
|
);
|
||
|
|
}
|