Compare commits

..

4 Commits

Author SHA1 Message Date
fa2a0818da Merge branch 'main' of http://114.215.207.150:3000/qiushanhe/ss-manage-web into dev-cl 2025-06-10 20:10:36 +08:00
qsh
6db7edfc2f sc 2025-05-27 11:38:18 +08:00
1039122a2b Merge remote-tracking branch 'origin/main' into dev-cl
# Conflicts:
#	.env.base
2025-05-26 23:25:26 +08:00
1a1fc0fbf9 1 2025-05-26 23:25:07 +08:00
6 changed files with 1590 additions and 1579 deletions

View File

@@ -4,11 +4,11 @@ VITE_NODE_ENV=development
VITE_DEV=true
# 请求路径
# VITE_BASE_URL='http://localhost:48080'
VITE_BASE_URL='http://localhost:48080'
#VITE_BASE_URL='http://47.98.161.246:48080'
# VITE_BASE_URL='http://114.55.169.15:48080'
VITE_BASE_URL='http://114.215.207.150:48080'
# VITE_BASE_URL='http://114.215.207.150:48080'
# 上传路径
VITE_UPLOAD_URL='http://47.98.161.246:48080/admin-api/system/file/upload'

View File

@@ -218,7 +218,7 @@ service.interceptors.response.use(
resetRouter() // 重置静态路由表
cache.local.clear()
removeToken()
window.location.href = `/login`
window.location.href = `/ss/login`
})
}
}
@@ -266,7 +266,7 @@ const handleAuthorized = () => {
isRelogin.show = false
// 干掉token后再走一次路由让它过router.beforeEach的校验
// window.location.href = window.location.href
window.location.href = `/login`
window.location.href = `/ss/login`
})
}
return Promise.reject(t('sys.api.timeoutMessage'))

View File

@@ -18,13 +18,17 @@ const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/regis
router.beforeEach(async (to, from, next) => {
start()
loadStart()
const userStore = useUserStoreWithOut()
if (to.path == '/login') {
userStore.resetState() // 重置用户信息状态
}
if (getAccessToken()) {
if (to.path === '/login') {
next({ path: '/' })
} else {
// 获取所有字典
const dictStore = useDictStoreWithOut()
const userStore = useUserStoreWithOut()
const permissionStore = usePermissionStoreWithOut()
if (!dictStore.getIsSetDict) {
await dictStore.setDictMap()

View File

@@ -3,7 +3,7 @@ import { defineStore } from 'pinia'
import { getAccessToken, removeToken } from '@/utils/auth'
import { CACHE_KEY } from '@/hooks/web/useCache'
import { loginOut } from '@/api/login'
import { getUser as getUserInfo } from '@/api/system/user'
import { getUserProfile as getUserInfo } from '@/api/system/user/profile'
import cache from '@/plugins/cache'
@@ -55,9 +55,8 @@ export const useUserStore = defineStore('admin-user', {
// userInfo = await getInfo({})
// }
if (!userInfo?.user) {
const userId = localStorage.getItem('userId')
userInfo = {
user: await getUserInfo(Number(userId))
user: await getUserInfo()
}
}
// this.permissions = userInfo.permissions
@@ -82,6 +81,7 @@ export const useUserStore = defineStore('admin-user', {
avatar: '',
nickname: ''
}
cache.local.delete(CACHE_KEY.USER)
},
refresh() {
cache.local.delete(CACHE_KEY.USER)

View File

@@ -200,8 +200,6 @@ const handleLogin = async (params) => {
if (res?.tenantId) {
authUtil.setTenantId(res.tenantId)
}
// 设置userId
localStorage.setItem('userId', res.userId)
ElLoading.service({
lock: true,

3145
yarn.lock

File diff suppressed because it is too large Load Diff