add:国际化配置
This commit is contained in:
Binary file not shown.
@@ -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 失效"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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/**
|
||||||
|
|||||||
@@ -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'
|
||||||
|
|||||||
Reference in New Issue
Block a user