feat(@vben/web-antd): 优化登录失败问题
- 增加登录失败刷新token
This commit is contained in:
parent
09eb944612
commit
3781e6cd47
@ -77,6 +77,12 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error: any) {
|
||||
if (error.code === 401) {
|
||||
const { csrf } = await getUserInfoApi(); // 获取新的 token
|
||||
setToken(csrf.token); // 更新 CSRF token
|
||||
accessStore.setAccessToken(csrf.token);
|
||||
}
|
||||
} finally {
|
||||
loginLoading.value = false;
|
||||
}
|
||||
|
@ -238,8 +238,8 @@ const startFetching = async () => {
|
||||
}
|
||||
conversationId.value = res.conversationId;
|
||||
const { filename, url } = extractDocxInfo(res.answer);
|
||||
if (res.messageFiles) {
|
||||
const { id, url } = res.messageFiles[0];
|
||||
if (res.answer) {
|
||||
// const { id, url } = res.messageFiles[0];
|
||||
resultItems.value.push({
|
||||
key: resultItems.value.length + 1,
|
||||
role: 'ai',
|
||||
@ -265,7 +265,7 @@ const startFetching = async () => {
|
||||
onClick: () => {
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = id;
|
||||
link.download = filename;
|
||||
document.body.append(link);
|
||||
link.click();
|
||||
link.remove();
|
||||
|
Loading…
Reference in New Issue
Block a user