修改第一次进入页面自动重定向到第一个页面,更改刷新后自动跳转到第一个页面bug
This commit is contained in:
parent
5ef363d757
commit
3457bbde5d
|
|
@ -54,7 +54,8 @@ onMounted(() => {
|
||||||
.app-container {
|
.app-container {
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
padding-bottom: 20px;
|
padding-bottom: 20px;
|
||||||
background-image: url("@/assets/images/bci.png");
|
background: url("@/assets/images/bci.png");
|
||||||
|
background-size: cover;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
background-color: #02131f;
|
background-color: #02131f;
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,10 @@ const jumpPage = (routePath) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
jumpPage("/key-node-1")
|
//判读是否是第一次重定向的页面
|
||||||
|
if (route.path == "/home") {
|
||||||
|
jumpPage("/key-node-1")
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -116,7 +119,6 @@ onMounted(() => {
|
||||||
.aside-component {
|
.aside-component {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.menu {
|
.menu {
|
||||||
width: 320px;
|
width: 320px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ const handleOpenDialog = (isOpen) => {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less">
|
<style scoped lang="less">
|
||||||
.el-header {
|
.el-header {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 115px;
|
height: 115px;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ const routes = [
|
||||||
path: "/home",
|
path: "/home",
|
||||||
component: () => import("@/layout/index.vue"),
|
component: () => import("@/layout/index.vue"),
|
||||||
children: [
|
children: [
|
||||||
{ path: "/", redirect: "/key-node-1" },
|
|
||||||
{
|
{
|
||||||
path: "/key-node-1",
|
path: "/key-node-1",
|
||||||
component: () => import("@/views/KeyNodeDiscern/anchorRecommendation/index.vue")
|
component: () => import("@/views/KeyNodeDiscern/anchorRecommendation/index.vue")
|
||||||
|
|
|
||||||
|
|
@ -1,29 +1,28 @@
|
||||||
import axios from "axios";
|
import axios from "axios"
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus"
|
||||||
|
|
||||||
// 创建axios实例
|
// 创建axios实例
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: import.meta.env.VITE_APP_BASE_API, // 从环境变量获取基础URL
|
baseURL: import.meta.env.VITE_APP_BASE_API, // 从环境变量获取基础URL
|
||||||
timeout: 10000 // 请求超时时间
|
timeout: 10000 // 请求超时时间
|
||||||
});
|
})
|
||||||
|
|
||||||
// 请求拦截器
|
// 请求拦截器
|
||||||
service.interceptors.request.use(
|
service.interceptors.request.use(
|
||||||
(config) => {
|
(config) => {
|
||||||
// 在发送请求之前做些什么
|
// 在发送请求之前做些什么
|
||||||
return config;
|
return config
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
// 对请求错误做些什么
|
// 对请求错误做些什么
|
||||||
console.log(error); // for debug
|
return Promise.reject(error)
|
||||||
return Promise.reject(error);
|
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
|
|
||||||
// 响应拦截器
|
// 响应拦截器
|
||||||
service.interceptors.response.use(
|
service.interceptors.response.use(
|
||||||
(response) => {
|
(response) => {
|
||||||
const res = response.data;
|
const res = response.data
|
||||||
|
|
||||||
// 根据业务状态码处理
|
// 根据业务状态码处理
|
||||||
if (res.code !== 200) {
|
if (res.code !== 200) {
|
||||||
|
|
@ -31,26 +30,25 @@ service.interceptors.response.use(
|
||||||
message: res.message || "Error",
|
message: res.message || "Error",
|
||||||
type: "error",
|
type: "error",
|
||||||
duration: 5 * 1000
|
duration: 5 * 1000
|
||||||
});
|
})
|
||||||
|
|
||||||
// 特殊状态码处理
|
// 特殊状态码处理
|
||||||
if (res.code === 401 || res.code === 403) {
|
if (res.code === 401 || res.code === 403) {
|
||||||
// 跳转登录页或其他处理
|
// 跳转登录页或其他处理
|
||||||
}
|
}
|
||||||
return Promise.reject(new Error(res.message || "Error"));
|
return Promise.reject(new Error(res.message || "Error"))
|
||||||
} else {
|
} else {
|
||||||
return res;
|
return res
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
(error) => {
|
(error) => {
|
||||||
console.log("err" + error); // for debug
|
|
||||||
ElMessage({
|
ElMessage({
|
||||||
message: error.message,
|
message: error.message,
|
||||||
type: "error",
|
type: "error",
|
||||||
duration: 5 * 1000
|
duration: 5 * 1000
|
||||||
});
|
})
|
||||||
return Promise.reject(error);
|
return Promise.reject(error)
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
|
|
||||||
export default service;
|
export default service
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user