diff --git a/src/assets/image/uploadimg.png b/src/assets/image/uploadimg.png new file mode 100644 index 0000000..0ebe268 Binary files /dev/null and b/src/assets/image/uploadimg.png differ diff --git a/src/router/index.js b/src/router/index.js index 2728bca..2a17990 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,8 +1,7 @@ -import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router'; +import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'; import routesConfig from './config'; -import {getCookie} from "@/api/utils"; +import { getCookie } from "@/api/utils"; // console.log('routesConfig', routesConfig) - const routes = [ { path: '/', @@ -11,7 +10,6 @@ const routes = [ }, ...routesConfig ] - const router = createRouter({ history: createWebHistory(import.meta.env.VITE_BASE), routes @@ -19,12 +17,11 @@ const router = createRouter({ router.beforeEach((to, from, next) => { if (!getCookie('token')) { if (import.meta.env.MODE === "development" || import.meta.env.MODE === "test") { - to.path.includes('/login') ? next() : next({path: '/login', query: {returnUrl: to.fullPath}}) - }else { - window.location.href = import.meta.env.VITE_BASE_LOGIN_URL + import.meta.env.VITE_BASE+to.fullPath + to.path.includes('/login') ? next() : next({ path: '/login', query: { returnUrl: to.fullPath } }) + } else { + window.location.href = import.meta.env.VITE_BASE_LOGIN_URL + import.meta.env.VITE_BASE + to.fullPath } } next() }) - export default router \ No newline at end of file