新增go服务token

This commit is contained in:
Teo
2025-07-29 16:24:08 +08:00
parent 7e7e51853d
commit c069b53636
9 changed files with 61 additions and 14 deletions

View File

@ -79,7 +79,7 @@
</template>
<script setup lang="ts">
import { getCodeImg, getTenantList } from '@/api/login';
import { getCodeImg, getGoToken, getTenantList } from '@/api/login';
import { authBinding } from '@/api/system/social/auth';
import { useUserStore } from '@/store/modules/user';
import { LoginData, TenantVO } from '@/api/types';
@ -151,8 +151,12 @@ const handleLogin = () => {
// 调用action的登录方法
const [err] = await to(userStore.login(loginForm.value));
if (!err) {
//获取Go服务Token保存本地
const goToken = await getGoToken();
proxy.$cache.local.set('goToken', goToken.data.token);
const redirectUrl = redirect.value || '/';
await router.push(redirectUrl);
loading.value = false;
} else {
loading.value = false;