mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/student-h5.git
synced 2025-12-06 17:36:45 +08:00
feat:合并
This commit is contained in:
BIN
src/assets/image/uploadimg.png
Normal file
BIN
src/assets/image/uploadimg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 722 B |
@@ -1,20 +1,15 @@
|
||||
<<<<<<< HEAD
|
||||
/*
|
||||
* @Author: 李晓鸽 lixg@dongwu-inc.com
|
||||
* @Date: 2022-11-21 18:45:34
|
||||
* @LastEditors: 李晓鸽 lixg@dongwu-inc.com
|
||||
* @LastEditTime: 2022-11-21 18:47:43
|
||||
* @FilePath: \stu_h5\src\router\index.js
|
||||
* @Author: lixg lixg@dongwu-inc.com
|
||||
* @Date: 2023-01-18 09:59:12
|
||||
* @LastEditors: lixg lixg@dongwu-inc.com
|
||||
* @LastEditTime: 2023-01-18 10:00:36
|
||||
* @FilePath: /stu_h5/src/router/index.js
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
import { createRouter, createWebHashHistory } from 'vue-router';
|
||||
=======
|
||||
import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router';
|
||||
>>>>>>> origin/develop
|
||||
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: '/',
|
||||
@@ -23,25 +18,18 @@ const routes = [
|
||||
},
|
||||
...routesConfig
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
<<<<<<< HEAD
|
||||
history: createWebHashHistory("/student-h5/"),
|
||||
routes
|
||||
=======
|
||||
history: createWebHistory(import.meta.env.VITE_BASE),
|
||||
routes
|
||||
})
|
||||
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()
|
||||
>>>>>>> origin/develop
|
||||
})
|
||||
|
||||
export default router
|
||||
Reference in New Issue
Block a user