TODO部署线上的提示

This commit is contained in:
qq787203167
2022-06-18 17:20:11 +08:00
parent 25049a7df1
commit b40b28addd
2 changed files with 16 additions and 2 deletions
+4 -1
View File
@@ -222,12 +222,15 @@
onOk() {
return that.Logout({}).then(() => {
// update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面
// TODO 在部署线上时注掉以下代码
that.$router.push({ path: '/user/login' })
// window.location.href = 'https://signin-test.nio.com/logout?client_id=100679&redirect_uri=' +
// encodeURIComponent('http://localhost:3000/dashboard/analysis') + '&response_type=code' //本地
// TODO 在部署线上时解开以下代码
// window.location.href = 'https://signin.nio.com/logout?client_id=100679&redirect_uri=' +
// encodeURIComponent('http://grp.nioint.com/dashboard/analysis') + '&response_type=code' //线上
localStorage.removeItem('language')
// update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面
//window.location.reload()
+12 -1
View File
@@ -11,9 +11,15 @@ import { getAction } from '@/api/manage'
import { welcome } from '@/utils/util'
NProgress.configure({ showSpinner: false }) // NProgress Configuration
// TODO 线上部署在conmponetns/tools/UserMenu.vue的退出登录时需解开代码以及注释代码
// TODO 在部署线上时注掉以下代码
const whiteList = ['/user/login', '/user/register', '/user/register-result', '/user/alteration']
// TODO 在部署线上时解开一下代码
// const whiteList = []
// no redirect whitelist
router.beforeEach((to, from, next) => {
@@ -89,7 +95,9 @@ router.beforeEach((to, from, next) => {
})*/
// query: { redirect: to.fullPath }
store.dispatch('Logout').then(() => {
// TODO 在部署线上时注掉此代码
next({ path: '/user/login', query: { redirect: to.fullPath } })
let fullPath = ''
if (to.fullPath == '/') {
fullPath = INDEX_MAIN_PAGE_PATH
@@ -100,6 +108,7 @@ router.beforeEach((to, from, next) => {
// window.location.href = 'https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri='
// + encodeURIComponent('http://localhost:3000' + fullPath) + '&response_type=code&state=' + JSON.stringify(to.query) //本地
// TODO 在部署线上时解开此代码
// window.location.href = 'https://signin.nio.com/oauth2/authorize?client_id=100679&redirect_uri='
// + encodeURIComponent('http://grp.nioint.com' + fullPath) + '&response_type=code&state=' + JSON.stringify(to.query) //线上
})
@@ -113,6 +122,7 @@ router.beforeEach((to, from, next) => {
// 在免登录白名单,直接进入
next()
} else {
// TODO 在部署线上时注掉此代码
next({ path: '/user/login', query: { redirect: to.fullPath } })
let fullPath = ''
@@ -124,9 +134,10 @@ router.beforeEach((to, from, next) => {
// http://grp.nioint.com
// window.location.href = 'https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri='
// + encodeURIComponent('http://localhost:3000' + fullPath) + '&response_type=code&state=' + JSON.stringify(to.query) //本地
// TODO 在部署线上时解开此代码
// window.location.href = 'https://signin.nio.com/oauth2/authorize?client_id=100679&redirect_uri='
// + encodeURIComponent('http://grp.nioint.com' + fullPath) + '&response_type=code&state=' + JSON.stringify(to.query) //线上
NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
}
}