大平台跳转

master
lion 1 year ago
parent bd3e13f67c
commit 95f919d1af

@ -2,7 +2,8 @@ import router from './router'
import store from './store'
import {
Message
} from 'element-ui'
} from 'element-ui'
import { deepCopy } from '@/utils'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
import {
@ -39,7 +40,7 @@ router.beforeEach(async (to, from, next) => {
// determine whether the user has obtained his permission roles through getInfo
const hasRoles = store.getters.roles && store.getters.roles.length > 0
if (hasRoles) {
next()
to.query.tourl ? next(to.query.tourl) : next()
} else {
try {
// get user info
@ -56,10 +57,11 @@ router.beforeEach(async (to, from, next) => {
// hack method to ensure that addRoutes is complete
// set the replace: true, so the navigation will not leave a history record
next({
...to,
replace: true
})
let resetTo = deepCopy(to)
resetTo.path = to.query.tourl || to.path
resetTo.replace = true
console.log(resetTo)
next(resetTo)
} catch (error) {
console.log(error)
// remove token and go to login page to re-login
@ -83,10 +85,15 @@ router.beforeEach(async (to, from, next) => {
try {
await store.dispatch('user/loginskip', {
token: to.query.token,
tp: to.query.tp
tp: to.query.tp,
loginId: to.query.loginId
})
console.log("to.path",to.path)
next(to.path || '/')
console.log("to.path",to.path)
if(to.query.tourl){
next(to.query.tourl || '/')
}else{
next(to.path || '/')
}
} catch (e) {
console.log("/login",e)
next('/login')

@ -311,7 +311,7 @@
//
let that = this
if (this.$route.query.token && this.$route.query.tp){
if (this.$route.query.token && this.$route.query.tp && this.$route.query.notice_id){
if(this.$route.query.notice_id){
this.sendIsRead(this.$route.query.notice_id)

@ -25,7 +25,7 @@ module.exports = {
* Detail: https://cli.vuejs.org/config/#publicpath
*/
publicPath: process.env.ENV === 'staging' ? '/admin_test' : '/admin',
outputDir: '/Users/mac/Documents/朗业/2024/h-河道处项目/a-安全生产/safety-manage-service/public/admin',
outputDir: '/Users/mac/Documents/朗业/2024/h-河道处项目/a-安全生产/safety-manage-service/public/admin_test',
assetsDir: 'static',
lintOnSave: process.env.NODE_ENV === 'development',
productionSourceMap: false,

Loading…
Cancel
Save