合并分支 'fix_uat_20230719' 到 'master'
修改手机端拦截 查看合并请求 laws-nio/laws-weilai!354
This commit is contained in:
@@ -9,9 +9,13 @@ import { generateIndexRouter } from '@/utils/util'
|
||||
import { JSEncrypt } from 'jsencrypt'
|
||||
import { getAction } from '@/api/manage'
|
||||
import { welcome } from '@/utils/util'
|
||||
import { Dialog } from 'vant'
|
||||
|
||||
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
|
||||
// TODO 线上部署在conmponetns/tools/UserMenu.vue的退出登录时需解开代码以及注释代码
|
||||
|
||||
@@ -25,6 +29,17 @@ const whiteList = ['/user/login', '/user/register', '/user/register-result', '/u
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
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) {
|
||||
getAction(`opensso/callback`, { code: to.query.code }).then(res => {
|
||||
if (res.success) {
|
||||
|
||||
Reference in New Issue
Block a user