refactor: frontend 重命名为 backend-adminend,新增 shccd159/shjjy153 配置
- frontend 目录迁移至 backend-adminend(管理后台前端) - 新增 application-shccd159.yml、application-shjjy153.yml - 更新 deploy.conf、DEPLOY.md、application.yml Made-with: Cursor
This commit is contained in:
32
backend-adminend/src/api/req.js
Normal file
32
backend-adminend/src/api/req.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import axios from 'axios';
|
||||
|
||||
const service = axios.create({
|
||||
timeout: 40000,
|
||||
});
|
||||
service.interceptors.request.use(
|
||||
(config) => {
|
||||
return config;
|
||||
},
|
||||
(error) => {
|
||||
Promise.reject(error);
|
||||
},
|
||||
);
|
||||
|
||||
// response interceptor
|
||||
service.interceptors.response.use(
|
||||
(response) => {
|
||||
const res = response;
|
||||
if (res.status !== 200 && res.status !== 401) {
|
||||
Message({
|
||||
message: res.data.msg || 'Error',
|
||||
type: 'error',
|
||||
duration: 5 * 1000,
|
||||
});
|
||||
return Promise.reject();
|
||||
} else {
|
||||
return res.data;
|
||||
}
|
||||
},
|
||||
(error) => {},
|
||||
);
|
||||
export default service;
|
||||
Reference in New Issue
Block a user