去除按token验证

main
26947 2024-05-08 10:28:48 +08:00
parent 44026b81c5
commit 7fce32b33e
4 changed files with 31 additions and 26 deletions

View File

@ -1,6 +1,7 @@
// 应用全局配置
export default {
// baseUrl: 'https://vue.ruoyi.vip/prod-api',
// baseUrl: 'http://47.93.242.168:8080',
baseUrl: 'http://localhost:8080',
// 应用信息
appInfo: {

View File

@ -51,7 +51,7 @@
},
"quickapp" : {},
"mp-weixin" : {
"appid" : "wx63c280fe3248a3e7",
"appid" : "wx892c075ce610e20f",
"setting" : {
"urlCheck" : false,
"es6" : false,

View File

@ -160,6 +160,11 @@ const { proxy } = getCurrentInstance();
const version = ref(getApp().globalData.config.appInfo.version)
const avatar = ref(proxy.$store.state.user.avatar)
const info = ()=> {
console.log(avatar);
}
info();
const handleToUserInfo = ()=> {
proxy.$tab.navigateTo('/pages/mine/info/userInfo')
}

View File

@ -15,27 +15,26 @@ function checkWhite(url) {
}
// 页面跳转验证拦截器
let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"]
list.forEach(item => {
uni.addInterceptor(item, {
invoke(to) {
if (getToken()) {
if (to.url === loginPage) {
console.log("to:",to);
uni.reLaunch({ url: "/" })
}
return true
} else {
if (checkWhite(to.url)) {
return true
}
uni.reLaunch({ url: loginPage })
return false
}
},
fail(err) {
console.log("错误信息:",err)
}
})
})
// let list = ["navigateTo", "redirectTo", "reLaunch", "switchTab"]
// list.forEach(item => {
// uni.addInterceptor(item, {
// invoke(to) {
// if (getToken()) {
// if (to.url === loginPage) {
// console.log("to:",to);
// uni.reLaunch({ url: "/" })
// }
// return true
// } else {
// if (checkWhite(to.url)) {
// return true
// }
// uni.reLaunch({ url: loginPage })
// return false
// }
// },
// fail(err) {
// console.log("错误信息:",err)
// }
// })
// })