flat: 国庆节暂存
This commit is contained in:
@@ -17,8 +17,10 @@ import {
|
||||
import {
|
||||
replaceStr
|
||||
} from "../config";
|
||||
import overAllConfig from "../config";
|
||||
|
||||
let showModal = true
|
||||
const tabbarPageName = ['/pages/project/project', '/pages/my/my', '/pages/news/news']
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
@@ -109,9 +111,9 @@ async function DoAjax(options, config = {}) {
|
||||
if (statusWhiteList.includes(status)) throw res;
|
||||
//如果是401则跳转到登录页面
|
||||
if (status === 401) {
|
||||
store.dispatch('FedLogOut').then(() => {
|
||||
GoLogin()
|
||||
});
|
||||
// store.dispatch('FedLogOut').then(() => {
|
||||
// GoLogin()
|
||||
// });
|
||||
throw new Error(message);
|
||||
}
|
||||
// 如果请求为非200否者默认统一处理
|
||||
@@ -189,25 +191,33 @@ export function Promisify(func) {
|
||||
|
||||
export function GoLogin() {
|
||||
if (showModal) {
|
||||
showModal = false
|
||||
location.href = "https://dy12333.org.cn/h5/"
|
||||
// uni.showModal({
|
||||
// title: "提示",
|
||||
// content: "您还未登录,点击确认去登录",
|
||||
// success({
|
||||
// confirm
|
||||
// }) {
|
||||
// if (confirm) {
|
||||
// uni.redirectTo({
|
||||
// url: "/pages/login/login"
|
||||
// });
|
||||
// }
|
||||
// showModal = true
|
||||
// },
|
||||
// fail() {
|
||||
// showModal = true
|
||||
// }
|
||||
// })
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "您还未登录,点击确认去登录",
|
||||
success({
|
||||
confirm,
|
||||
cancel
|
||||
}) {
|
||||
if (confirm) {
|
||||
const returnPage = `${overAllConfig.loginURl}?returnPage=${location.href}`
|
||||
location.href = returnPage
|
||||
}
|
||||
if (cancel) {
|
||||
let pages = getCurrentPages();
|
||||
let prePage = pages[pages.length - 1];
|
||||
const resetPage = tabbarPageName.find((item) => item === prePage.$route.fullPath)
|
||||
if (resetPage) {
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
complete() {
|
||||
showModal = true
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user