agent allow store + update + delete

This commit is contained in:
xiaomlove
2021-04-16 19:04:01 +08:00
parent dc7aa33036
commit d734788363
10 changed files with 240 additions and 150 deletions
+14 -1
View File
@@ -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
+4 -1
View File
@@ -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
})