修改手机端拦截
This commit is contained in:
@@ -9,9 +9,13 @@ import { generateIndexRouter } from '@/utils/util'
|
|||||||
import { JSEncrypt } from 'jsencrypt'
|
import { JSEncrypt } from 'jsencrypt'
|
||||||
import { getAction } from '@/api/manage'
|
import { getAction } from '@/api/manage'
|
||||||
import { welcome } from '@/utils/util'
|
import { welcome } from '@/utils/util'
|
||||||
|
import { Dialog } from 'vant'
|
||||||
|
|
||||||
let isPhone = localStorage.getItem('isPhone')
|
let isPhone = localStorage.getItem('isPhone')
|
||||||
|
function isBrowser() {
|
||||||
|
const userAgent = window.navigator.userAgent.toLowerCase()
|
||||||
|
return userAgent.includes('lark') || userAgent.includes('feishu')
|
||||||
|
}
|
||||||
NProgress.configure({ showSpinner: false }) // NProgress Configuration
|
NProgress.configure({ showSpinner: false }) // NProgress Configuration
|
||||||
// TODO 线上部署在conmponetns/tools/UserMenu.vue的退出登录时需解开代码以及注释代码
|
// TODO 线上部署在conmponetns/tools/UserMenu.vue的退出登录时需解开代码以及注释代码
|
||||||
|
|
||||||
@@ -25,6 +29,17 @@ const whiteList = ['/user/login', '/user/register', '/user/register-result', '/u
|
|||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
NProgress.start() // start progress bar
|
NProgress.start() // start progress bar
|
||||||
|
if (isPhone == 'yes'){
|
||||||
|
if (!isBrowser()){
|
||||||
|
Dialog.alert({
|
||||||
|
message: '未授权用户 <br> Unauthorized User',
|
||||||
|
theme: 'round-button',
|
||||||
|
}).then(() => {
|
||||||
|
// on close
|
||||||
|
});
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
if (to.query.code) {
|
if (to.query.code) {
|
||||||
getAction(`opensso/callback`, { code: to.query.code }).then(res => {
|
getAction(`opensso/callback`, { code: to.query.code }).then(res => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|||||||
Reference in New Issue
Block a user