去除按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 { export default {
// baseUrl: 'https://vue.ruoyi.vip/prod-api', // baseUrl: 'https://vue.ruoyi.vip/prod-api',
// baseUrl: 'http://47.93.242.168:8080',
baseUrl: 'http://localhost:8080', baseUrl: 'http://localhost:8080',
// 应用信息 // 应用信息
appInfo: { appInfo: {

View File

@ -1,4 +1,4 @@
{ {
"name" : "若依移动端", "name" : "若依移动端",
"appid" : "__UNI__25A9D80", "appid" : "__UNI__25A9D80",
"description" : "", "description" : "",
@ -51,7 +51,7 @@
}, },
"quickapp" : {}, "quickapp" : {},
"mp-weixin" : { "mp-weixin" : {
"appid" : "wx63c280fe3248a3e7", "appid" : "wx892c075ce610e20f",
"setting" : { "setting" : {
"urlCheck" : false, "urlCheck" : false,
"es6" : false, "es6" : false,

View File

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

View File

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