This commit is contained in:
lnn19986213 2024-05-21 14:57:12 +08:00
parent 2c4f135bbf
commit c8c1fea7c4
2 changed files with 10 additions and 6 deletions

View File

@ -29,7 +29,10 @@ axios.interceptors.response.use(
if (error.response) {
if (error.response.status == 401) {
ElMessage.error("请重新登录!");
window.location.href = '/#/login?return_url=' + window.location.href
// window.location.href = '/#/login?returnURL=' + window.location.href
window.location.href =
'http://220.191.238.50:996/api/login?returnURL=' +
window.location.href
} else if (error.response.status == 404) {
ElMessage.error("Status:404正在请求不存在的服务器记录");
} else if (error.response.status == 500) {

View File

@ -15,7 +15,8 @@ export default defineConfig({
// 第一个代理
"/api": {
// 匹配到啥来进行方向代理
target: "http://192.168.2.42:8095/", //周源
// target: "http://192.168.2.42:8095/", //周源
target: "http://220.191.238.50:996/", //周源
changeOrigin: true, //是否支持跨域
//rewrite: (path) => path.replace(/^\/api/, '') // 如果不需要api 直接把路径上的api 替换成空,这个
},