Commit 9694100b authored by dragondean@qq.com's avatar dragondean@qq.com

修复打开首页未登录不跳转到登录页面

parent 96cb56c3
......@@ -69,18 +69,10 @@ function callback(resolve, reject, response) {
})
}
if (data.code == 401) {
let pages = getCurrentPages() // 获取栈实例
if(pages.length>1){
let prevPage = pages[pages.length - 2]
if(!prevPage||prevPage.route!='pages/login/login'){
store.commit('logout')
uni.reLaunch({
url: '/pages/login/login'
})
}
}
store.commit('logout')
uni.reLaunch({
url: '/pages/login/login'
})
}
resolve(data)
} else {
......@@ -157,7 +149,7 @@ const deleted = (url, param) => {
})
}
const goPage = (url, type = 1) => {
const goPage = (url, type = 1) => {
if(type == 1){
uni.navigateTo({
url: url,
......@@ -179,7 +171,7 @@ const backGo = () => {
uni.navigateBack()
}
const getLocalTime = (nS) => {
const getLocalTime = (nS) => {
if(!nS){
return ''
}
......@@ -195,18 +187,18 @@ const getLocalTime = (nS) => {
day = day > 9 ? day : '0' + day;
min = min > 9 ? min : '0' + min;
sec = sec > 9 ? sec : '0' + sec;
return `${year}-${month}-${day} ${hour}:${min}:${sec}`;
}
const getDate = (nS) => {
}
const getDate = (nS) => {
const date = new Date(nS);
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
month = month > 9 ? month : '0' + month;
return `${year}-${month}-${day}`;
}
}
const checkFormData = (params, rules) => {
for(let i in params){
if(params[i] == '' || params[i] == 0){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment