diff --git a/jero-web/src/components/tools/UserMenu.vue b/jero-web/src/components/tools/UserMenu.vue index 817d6a825..35c59e6c4 100644 --- a/jero-web/src/components/tools/UserMenu.vue +++ b/jero-web/src/components/tools/UserMenu.vue @@ -114,7 +114,7 @@ import { mixinDevice } from '@/utils/mixin.js' import { getFileAccessHttpUrl, getAction } from '@/api/manage' import Vue from 'vue' - import { UI_CACHE_DB_DICT_DATA ,ACCESS_TOKEN} from '@/store/mutation-types' + import { UI_CACHE_DB_DICT_DATA, ACCESS_TOKEN } from '@/store/mutation-types' import moment from 'moment' import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN' import enUS from 'ant-design-vue/es/locale/en_US' @@ -223,7 +223,7 @@ return that.Logout({}).then(() => { // update-begin author:wangshuai date:20200601 for: 退出登录跳转登录页面 that.$router.push({ path: '/user/login' }) - // window.location.href = 'https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=' + encodeURIComponent('http://grp.nioint.com/dashboard/analysis') + '&response_type=code' + // window.location.href = 'https://signin-test.nio.com/logout?client_id=100679&redirect_uri=' + encodeURIComponent('http://localhost:3000/dashboard/analysis') + '&response_type=code' localStorage.removeItem('language') // update-end author:wangshuai date:20200601 for: 退出登录跳转登录页面 //window.location.reload() diff --git a/jero-web/src/permission.js b/jero-web/src/permission.js index a639857b7..32a256491 100644 --- a/jero-web/src/permission.js +++ b/jero-web/src/permission.js @@ -42,8 +42,12 @@ router.beforeEach((to, from, next) => { fullPath = to.path } let query = to.query + let status = {} + if (query.state) { + status = JSON.parse(query.state) + } delete query.code - next({ path: fullPath, query: query }) + next({ path: fullPath, query: status }) } }) return @@ -90,9 +94,10 @@ router.beforeEach((to, from, next) => { if (to.fullPath == '/') { fullPath = INDEX_MAIN_PAGE_PATH } else { - fullPath = to.fullPath + fullPath = to.path } - // window.location.href = 'https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=' + encodeURIComponent('http://grp.nioint.com' + fullPath) + '&response_type=code' + // 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) }) }) } else { @@ -107,11 +112,13 @@ router.beforeEach((to, from, next) => { next({ path: '/user/login', query: { redirect: to.fullPath } }) let fullPath = '' if (to.fullPath == '/') { - fullPath = INDEX_MAIN_PAGE_PATH + '?id=123' + fullPath = INDEX_MAIN_PAGE_PATH } else { - fullPath = to.fullPath + fullPath = to.path } - // window.location.href = 'https://signin-test.nio.com/oauth2/authorize?client_id=100679&redirect_uri=' + encodeURIComponent('http://grp.nioint.com' + fullPath) + '&response_type=code' + // 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) NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it } }