功能:重建指尖管理师规划系统

This commit is contained in:
xiaowang
2026-06-04 16:39:06 +08:00
parent 73483e7b0c
commit 677890f518
413 changed files with 9602 additions and 795 deletions
+58
View File
@@ -0,0 +1,58 @@
const CUSTOMER_HOME_PATH = '/pages/home/index'
const ADMIN_LOGIN_PATH = '/admin/pages/login/index'
function getCurrentApp() {
return typeof getApp === 'function' ? getApp() : null
}
function clearCustomerSession() {
const app = getCurrentApp()
if (app && typeof app.clearUserSession === 'function') {
app.clearUserSession()
return
}
try {
wx.removeStorageSync('accessToken')
wx.removeStorageSync('refreshToken')
wx.removeStorageSync('userInfo')
wx.removeStorageSync('needSetPassword')
} catch (error) {}
}
function clearAdminSession() {
const app = getCurrentApp()
if (app && typeof app.clearAdminSession === 'function') {
app.clearAdminSession()
return
}
try {
wx.removeStorageSync('adminAccessToken')
wx.removeStorageSync('adminRefreshToken')
wx.removeStorageSync('adminUserInfo')
wx.removeStorageSync('adminPermissions')
wx.removeStorageSync('adminCurrentShop')
} catch (error) {}
}
function relaunch(url) {
wx.reLaunch({ url })
}
function openAdminLogin() {
clearCustomerSession()
relaunch(ADMIN_LOGIN_PATH)
}
function openCustomerHome() {
clearAdminSession()
relaunch(CUSTOMER_HOME_PATH)
}
module.exports = {
ADMIN_LOGIN_PATH,
CUSTOMER_HOME_PATH,
clearCustomerSession,
clearAdminSession,
openAdminLogin,
openCustomerHome
}