修正打包部署配置
This commit is contained in:
@ -30,14 +30,14 @@ const processResponse = async (res: any) => {
|
||||
}
|
||||
ElMessage.success(res.msg);
|
||||
setTimeout(() => {
|
||||
location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
|
||||
location.href = (import.meta.env.VITE_APP_CONTEXT_PATH || '/') + 'index';
|
||||
}, 2000);
|
||||
};
|
||||
|
||||
const handleError = (error: any) => {
|
||||
ElMessage.error(error.message);
|
||||
setTimeout(() => {
|
||||
location.href = import.meta.env.VITE_APP_CONTEXT_PATH + 'index';
|
||||
location.href = (import.meta.env.VITE_APP_CONTEXT_PATH || '/') + 'index';
|
||||
}, 2000);
|
||||
};
|
||||
|
||||
|
@ -100,7 +100,7 @@ export const dynamicRoutes: RouteRecordRaw[] = [
|
||||
* 创建路由
|
||||
*/
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.VITE_APP_CONTEXT_PATH),
|
||||
history: createWebHistory(import.meta.env.VITE_APP_CONTEXT_PATH || '/'),
|
||||
routes: constantRoutes,
|
||||
// 刷新时,滚动条位置还原
|
||||
scrollBehavior(to, from, savedPosition) {
|
||||
|
Reference in New Issue
Block a user