feat: 重新登录逻辑更改

This commit is contained in:
Gsh
2025-08-30 23:58:57 +08:00
parent 08084aa0bc
commit 8abd122773
4 changed files with 40 additions and 11 deletions

View File

@@ -6,7 +6,6 @@ import { useRouter } from 'vue-router';
import { getUserInfo } from '@/api';
import {
SSO_CLIENT_LOGIN_AGAIN,
SSO_SEVER_URL,
} from '@/config/sso.ts';
@@ -50,6 +49,18 @@ function parseUrlParams() {
onMounted(() => {
parseUrlParams();
});
async function onReLogin() {
// 在这里执行退出方法
await userStore.logout();
// 清空回话列表并回到默认页
await sessionStore.requestSessionList(1, true);
await sessionStore.createSessionBtn();
ElMessage({
type: 'success',
message: '退出成功',
});
await router.replace('/');
}
function handleThirdPartyLogin(type: any) {
const redirectUri = encodeURIComponent(`${window.location.origin}/chat`);
console.log('cccc', type);
@@ -184,7 +195,7 @@ function contactCustomerService() {
<!-- 重新登录提示 -->
<!-- 绿色背景 -->
<div class="mb-4 text-gray-600 ">
开通 VIP 需要重新登录意社区生效<br>
开通 VIP 需要重新登录生效<br>
</div>
<div v-if="false" class="order-info p-4 rounded-lg mb-4 bg-[#ffc406] mb-4 text-gray-600 ">
加入售后群获得更多专业支持
@@ -200,9 +211,9 @@ function contactCustomerService() {
class="w-full py-3 text-lg font-medium"
type="primary"
size="large"
@click="handleThirdPartyLogin(SSO_CLIENT_LOGIN_AGAIN)"
@click="onReLogin()"
>
意社区重新登录
重新登录
</ElButton>
<ElButton