feat: 更新财务系统界面和功能优化
- 替换系统管理和入账管理的图标为更合适的样式 - 优化登录请求的格式和错误处理 - 从localStorage读取用户信息初始化用户状态 - 简化仪表盘路由配置,移除多语言支持 - 调整工作台头部组件,移除不必要的统计信息 - 清理工作台页面,仅保留欢迎信息
This commit is contained in:
@@ -39,7 +39,10 @@ export namespace AuthApi {
|
||||
* 登录
|
||||
*/
|
||||
export async function loginApi(data: AuthApi.LoginParams) {
|
||||
return requestClient.post<AuthApi.LoginResult<AuthApi.UserToken, AuthApi.UserInfo>>('/auth/login', data);
|
||||
return requestClient.post<AuthApi.LoginResult<AuthApi.UserToken, AuthApi.UserInfo>>(
|
||||
'/auth/login',
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import type { RequestClientOptions } from '@vben/request';
|
||||
|
||||
import { useAppConfig } from '@vben/hooks';
|
||||
import { $t } from '@vben/locales';
|
||||
import { preferences } from '@vben/preferences';
|
||||
import {
|
||||
authenticateResponseInterceptor,
|
||||
@@ -39,11 +40,6 @@ function createRequestClient(baseURL: string, options?: RequestClientOptions) {
|
||||
if (preferences.app.loginExpiredMode === 'modal' && accessStore.isAccessChecked) {
|
||||
accessStore.setLoginExpired(true);
|
||||
} else {
|
||||
// 显示登录过期提示
|
||||
message.error({
|
||||
content: '您的登录状态已过期,请重新登录',
|
||||
duration: 3,
|
||||
});
|
||||
// 短暂延迟后跳转,让用户看到提示
|
||||
setTimeout(() => {
|
||||
authStore.logout();
|
||||
@@ -196,7 +192,7 @@ function createRequestClient(baseURL: string, options?: RequestClientOptions) {
|
||||
|
||||
// 如果是401错误,已经在自定义拦截器中处理了,这里不需要额外提示
|
||||
if (responseCode === 401) {
|
||||
return Promise.reject(error);
|
||||
return Promise.reject($t('ui.fallback.http.unauthorized'));
|
||||
}
|
||||
|
||||
// 如果有后端返回的错误信息,优先显示
|
||||
|
||||
Reference in New Issue
Block a user