add:国际化配置

This commit is contained in:
zhangzq
2026-01-04 19:18:37 +08:00
parent 86029545ee
commit dd3463f5d7
4 changed files with 6 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ public class GlobalExceptionHandler {
@ExceptionHandler(value = NotLoginException.class) @ExceptionHandler(value = NotLoginException.class)
public ResponseEntity<ApiError> notLoginException(Exception e) { public ResponseEntity<ApiError> notLoginException(Exception e) {
// log.error(ThrowableUtil.getStackTrace(e)); // log.error(ThrowableUtil.getStackTrace(e));
e.printStackTrace();
log.error("token超时:-------------------------------------" + e.getMessage()); log.error("token超时:-------------------------------------" + e.getMessage());
return buildResponseEntity(ApiError.error(401, "token 失效")); return buildResponseEntity(ApiError.error(401, "token 失效"));
} }

View File

@@ -101,6 +101,7 @@ security:
excludes: excludes:
# 认证 # 认证
- /auth/login - /auth/login
- /error
- /auth/code - /auth/code
- /auth/logout - /auth/logout
- /webjars/** - /webjars/**
@@ -122,6 +123,7 @@ security:
- /actuator/** - /actuator/**
# 上传 # 上传
- /api/localStorage/pictures - /api/localStorage/pictures
- /api/language/**
# 参数 # 参数
- /api/param/getValueByCode - /api/param/getValueByCode
- /plumelog/** - /plumelog/**

View File

@@ -1,6 +1,9 @@
import request from '@/utils/request' import request from '@/utils/request'
// 国际化开发3。增加文件获取接口 // 国际化开发3。增加文件获取接口
export function fetchMessages(locale) { export function fetchMessages(locale) {
if (locale == null) {
locale = 'zh'
}
return request({ return request({
url: '/api/language/js/' + locale, url: '/api/language/js/' + locale,
method: 'get' method: 'get'