yinxia.yang 18 hours ago
parent
commit
58cb7eca34
1 changed files with 4 additions and 13 deletions
  1. 4 13
      src/App.vue

+ 4 - 13
src/App.vue

@@ -1,28 +1,19 @@
 <script setup lang="ts">
 <script setup lang="ts">
 	import { useRoute } from 'vue-router'
 	import { useRoute } from 'vue-router'
 	import { useWarehouse } from './store'
 	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'
 	import { House, Collection, Box, Download, Upload, Notebook, SwitchButton } from '@element-plus/icons-vue'
     const faviconUrl = '/favicon.ico'
     const faviconUrl = '/favicon.ico'
 	const route = useRoute()
 	const route = useRoute()
 	const warehouse = useWarehouse()
 	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 }]
 	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() {
 	function logout() {
-		// 清空本地所有缓存
+		// 清空本地所有缓存
 		sessionStorage.clear()
 		sessionStorage.clear()
 		clearAuthInfo()
 		clearAuthInfo()
 		clearOAuthTemp()
 		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 user = getDisplayName
 	const now = new Date()
 	const now = new Date()