|
|
@@ -1,28 +1,19 @@
|
|
|
<script setup lang="ts">
|
|
|
import { useRoute } from 'vue-router'
|
|
|
import { useWarehouse } from './store'
|
|
|
- import { clearAuthInfo, clearOAuthTemp, getDisplayName, getOAuthLogoutUrl, mockLogin } from './utils/auth'
|
|
|
+ import { clearAuthInfo, clearOAuthTemp, getDisplayName } from './utils/auth'
|
|
|
import { House, Collection, Box, Download, Upload, Notebook, SwitchButton } from '@element-plus/icons-vue'
|
|
|
const faviconUrl = '/favicon.ico'
|
|
|
const route = useRoute()
|
|
|
const warehouse = useWarehouse()
|
|
|
const links = [{ path: '/dashboard', name: '工作台', icon: House }, { path: '/master', name: '基础资料管理', icon: Collection }, { path: '/sku', name: '商品 / SKU 管理', icon: Box }, { path: '/inbound', name: '入库管理', icon: Download }, { path: '/outbound', name: '出库管理', icon: Upload }, { path: '/ledger', name: '库存台账', icon: Notebook }]
|
|
|
function logout() {
|
|
|
- // 先清空本地所有缓存
|
|
|
+ // 清空本地所有缓存
|
|
|
sessionStorage.clear()
|
|
|
clearAuthInfo()
|
|
|
clearOAuthTemp()
|
|
|
- // Mock 模式直接跳登录页;否则跳转到 OIDC 服务端登出,销毁 SSO 会话
|
|
|
- if (mockLogin) {
|
|
|
- location.hash = '#/login'
|
|
|
- } else {
|
|
|
- try {
|
|
|
- location.replace(getOAuthLogoutUrl())
|
|
|
- } catch {
|
|
|
- // 配置异常时回退到 forward.html
|
|
|
- location.replace('/forward.html')
|
|
|
- }
|
|
|
- }
|
|
|
+ // 跳转到登录页
|
|
|
+ location.replace('/#/login')
|
|
|
}
|
|
|
const user = getDisplayName
|
|
|
const now = new Date()
|