瓶中沙 2024-06-26 15:51:37 +08:00
commit e2100394db
4 changed files with 7 additions and 9 deletions

View File

@ -119,7 +119,6 @@ const infoApi = {
return postPBRequest('/driver', null, 54001) return postPBRequest('/driver', null, 54001)
}, },
// //
//
getTxTemplate(params) { getTxTemplate(params) {
return postPBRequest("/driver", params, 54011, params.driver_name); return postPBRequest("/driver", params, 54011, params.driver_name);
}, },

View File

@ -70,7 +70,6 @@ export default {
driver_name: props.formData.name driver_name: props.formData.name
} }
const res = await infoApi.getTxTemplate(param); const res = await infoApi.getTxTemplate(param);
if (res.code == 0) { if (res.code == 0) {
// //
state.modelArr = []; state.modelArr = [];
@ -84,7 +83,7 @@ export default {
} }
state.addForm.template_name = state.modelArr[0].name; state.addForm.template_name = state.modelArr[0].name;
} else { } else {
ElMessage.error(res.data || res.messgae); ElMessage.error(res.data || res.message);
} }
}; };
const closeDialog = () => { const closeDialog = () => {

View File

@ -79,6 +79,7 @@ export default {
if (res.code == 0) { if (res.code == 0) {
state.propertiesData = res.data || []; state.propertiesData = res.data || [];
} else { } else {
ElMessage.error(res.data || res.message);
} }
}; };
const closeDialog = () => { const closeDialog = () => {

View File

@ -35,21 +35,20 @@ axios.interceptors.response.use(
} }
} }
} }
if(res.config.headers['action'] == 53211) { // if(!res.request || res.request.responseType === 'blob') { //
return res; return res;
} }
const ret = res.data;
// token // token
if (ret.code === 3004) { if (res.data.code === 3004) {
localRemove("token"); localRemove("token");
ElMessage.closeAll(); ElMessage.closeAll();
ElMessage.error(ret.message || "Token异常,请重新登录"); ElMessage.error(res.data.message || "Token异常,请重新登录");
router.push({ router.push({
path: "/login" path: "/login"
}); });
return Promise.reject(ret); return Promise.reject(res.data);
} }
return ret; return Promise.resolve(res.data);
}, },
(error) => { (error) => {
ElMessage.closeAll(); ElMessage.closeAll();