mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-22 10:57:27 +08:00
agent allow store + update + delete
This commit is contained in:
Vendored
+14
-1
@@ -2,10 +2,23 @@ import axios from "./axios";
|
||||
|
||||
const baseUrl = 'http://nexus-php8.tinyhd.net/api/';
|
||||
|
||||
|
||||
const api = {
|
||||
listAllowAgent: (params = {}) => {
|
||||
return axios.get(baseUrl + 'agent-allow', {params: params});
|
||||
}
|
||||
},
|
||||
storeAllowAgent: (params = {}) => {
|
||||
return axios.post(baseUrl + 'agent-allow', params);
|
||||
},
|
||||
updateAllowAgent: (id, params = {}) => {
|
||||
return axios.put(baseUrl + 'agent-allow/' + id, params);
|
||||
},
|
||||
getAllowAgent: (id) => {
|
||||
return axios.get(baseUrl + 'agent-allow/' + id);
|
||||
},
|
||||
deleteAllowAgent: (id) => {
|
||||
return axios.delete(baseUrl + 'agent-allow/' + id);
|
||||
},
|
||||
}
|
||||
|
||||
export default api
|
||||
|
||||
Vendored
+4
-1
@@ -22,6 +22,10 @@ axios.interceptors.response.use(res => {
|
||||
ElMessage.error('服务端异常!')
|
||||
return Promise.reject(res)
|
||||
}
|
||||
if (res.data.data.ret && res.data.data.ret != 0) {
|
||||
ElMessage.error(res.data.data.msg)
|
||||
return Promise.reject(res)
|
||||
}
|
||||
if (res.data.resultCode && res.data.resultCode != 200) {
|
||||
if (res.data.message) ElMessage.error(res.data.message)
|
||||
if (res.data.resultCode == 419) {
|
||||
@@ -29,7 +33,6 @@ axios.interceptors.response.use(res => {
|
||||
}
|
||||
return Promise.reject(res.data)
|
||||
}
|
||||
|
||||
return res.data.data
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user