上饶市警务平台后台管理前端
zhongrj
2023-03-13 08650b4950d3b08aa4284e46159734135f0c8ac9
权限设置修改
1 files modified
71 ■■■■■ changed files
src/permission.js 71 ●●●●● patch | view | raw | blame | history
src/permission.js
@@ -18,14 +18,12 @@
    let hrefIdx = window.location.href.indexOf('token=') // url中是否携带token
    var tag = false
    if (to.fullPath.indexOf("token") > 0) {
        tag = true
    }
    const meta = to.meta || {}
    const isMenu = meta.menu === undefined ? to.query.menu : meta.menu
    store.commit('SET_IS_MENU', isMenu === undefined)
    if (hrefIdx > -1) {
        tag = true
        let token = window.location.href.slice(hrefIdx + 6)
        store.commit('SET_TOKEN', token)
    }
@@ -75,73 +73,6 @@
        if (meta.isAuth === false) {
            next()
        } else {
            // console.log(to.path, 66666)
            // if (to.path == '/security/security') {
            //     // console.log('进入首页-----')
            //     var a = to.query.securitySupervisionSystem
            //     if (a == undefined || typeof a != "string") {
            //         // console.log("无securitySupervisionSystem参数  跳回登入");
            //         next('/login')
            //         next('/login')
            //         return
            //     }
            //     // console.log("有securitySupervisionSystem参数");
            //     try {
            //         // console.log("判断securitySupervisionSystem是否能被JSOn解码");
            //         var obj = JSON.parse(a)
            //         if (typeof obj == "object" && obj && obj.tokenMY == '987654321S') {
            //             debugger
            //             var data = {
            //                 tenantId: obj.data.dip,
            //                 username: obj.data.rese,
            //                 password: md5(obj.data.sap),
            //                 grant_type: 'password',
            //                 scope: 'all',
            //                 type: 'account'
            //             }
            //             request({
            //                 url: '/api/blade-auth/oauth/token',
            //                 method: 'post',
            //                 headers: {
            //                     'Authorization': 'Basic c2FiZXI6c2FiZXJfc2VjcmV0',
            //                     "Tenant-Id": "000000"
            //                 },
            //                 params: data
            //             }).then(res => {
            //                 const data = res.data
            //                 if (data.error_description) {
            //                     // console.log("登入失败");
            //                     Message({
            //                         message: data.error_description,
            //                         type: 'error'
            //                     })
            //                     next('/login')
            //                     next('/login')
            //                     return
            //                 } else {
            //                     // console.log("登入成功");
            //                     store.commit('SET_TOKEN', data.access_token)
            //                     store.commit('SET_REFRESH_TOKEN', data.refresh_token)
            //                     store.commit('SET_TENANT_ID', data.tenant_id)
            //                     store.commit('SET_USER_INFO', data)
            //                     store.commit('DEL_ALL_TAG')
            //                     store.commit('CLEAR_LOCK')
            //                     next(to.path)
            //                     return
            //                 }
            //             })
            //             return
            //         } else {
            //             // console.log("成功解码 不是对象");
            //             next('/login')
            //             return
            //         }
            //     } catch {
            //         // console.log('不是Json对象 跳回登入');
            //         next('/login')
            //         return
            //     }
            // }
            next('/login')
        }
    }