fix: 修复: 🧩 校验测试
This commit is contained in:
parent
7ffe0c9a00
commit
9a65f5e903
|
@ -14,6 +14,11 @@ server {
|
||||||
proxy_pass http://192.168.3.98:1001;
|
proxy_pass http://192.168.3.98:1001;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# mock 跨域
|
||||||
|
location ~/api/ {
|
||||||
|
proxy_pass http://192.168.3.98:1001;
|
||||||
|
}
|
||||||
|
|
||||||
error_page 404 404.html;
|
error_page 404 404.html;
|
||||||
|
|
||||||
location = /50x.html {
|
location = /50x.html {
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
import Request from '@/utils/request';
|
||||||
|
|
||||||
|
export const reqGetLoadBoard = () => {
|
||||||
|
return Request({
|
||||||
|
url: '/board/loadBoard',
|
||||||
|
method: 'GET',
|
||||||
|
});
|
||||||
|
};
|
|
@ -0,0 +1,23 @@
|
||||||
|
import axios from 'axios';
|
||||||
|
|
||||||
|
const request = axios.create({
|
||||||
|
baseURL: '/mock',
|
||||||
|
timeout: 10000,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 请求拦截器
|
||||||
|
request.interceptors.request.use(config => {
|
||||||
|
return config;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 响应拦截器
|
||||||
|
request.interceptors.response.use(
|
||||||
|
response => {
|
||||||
|
return response.data;
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
return Promise.reject(new Error('网络错误'));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
export default request;
|
|
@ -28,6 +28,10 @@ module.exports = defineConfig({
|
||||||
target: process.env.VUE_APP_URL,
|
target: process.env.VUE_APP_URL,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
|
'/mock': {
|
||||||
|
target: process.env.VUE_APP_URL,
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
configureWebpack: {
|
configureWebpack: {
|
||||||
|
|
Loading…
Reference in New Issue