diff --git a/web/src/main/resources/static/index.html b/web/src/main/resources/static/index.html index bb05b8f..3686fe5 100644 --- a/web/src/main/resources/static/index.html +++ b/web/src/main/resources/static/index.html @@ -762,6 +762,21 @@ var currentTypeFilter = null; function init() { + // 检查URL是否包含登录参数 + const urlParams = new URLSearchParams(window.location.search); + const projectNameFromUrl = urlParams.get('projectName'); + const userNameFromUrl = urlParams.get('userName'); + const passwordFromUrl = urlParams.get('password'); + + // 如果URL包含登录参数,清除旧的userInfo并跳转到login.html处理新的登录 + if (userNameFromUrl && passwordFromUrl) { + console.log('URL包含登录参数,清除旧的用户信息并跳转到登录页面'); + localStorage.removeItem('userInfo'); + // 保留URL参数,让login.html处理 + window.location.href = 'login.html' + window.location.search; + return; + } + var savedUserInfo = localStorage.getItem('userInfo'); if (!savedUserInfo) { window.location.href = 'login.html'; diff --git a/web/src/main/resources/static/login.html b/web/src/main/resources/static/login.html index b5e44f9..af87f38 100644 --- a/web/src/main/resources/static/login.html +++ b/web/src/main/resources/static/login.html @@ -86,18 +86,18 @@