gaea升级2.0.4.RELEASE

Raod 2 years ago
parent 7c70df8a66
commit eaadabd35f

@ -76,7 +76,7 @@
<dependency>
<groupId>com.anji-plus</groupId>
<artifactId>spring-boot-gaea</artifactId>
<version>2.0.3.RELEASE</version>
<version>2.0.4.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>

@ -231,7 +231,7 @@ public class TokenFilter implements Filter {
}
private void error(HttpServletResponse response) throws IOException {
ResponseBean responseBean = ResponseBean.builder().code("50008").message("The Token has expired").build();
ResponseBean responseBean = ResponseBean.builder().code("User.credentials.expired").message("The Token has expired").build();
response.setContentType(ContentType.APPLICATION_JSON.getMimeType());
response.getWriter().print(JSONObject.toJSONString(responseBean));
}

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.anji.plus.gaea.bean.TreeNode;
import com.anji.plus.gaea.cache.CacheHelper;
import com.anji.plus.gaea.constant.BaseOperationEnum;
import com.anji.plus.gaea.constant.GaeaConstant;
import com.anji.plus.gaea.exception.BusinessException;
import com.anji.plus.gaea.exception.BusinessExceptionBuilder;
import com.anji.plus.gaea.curd.mapper.GaeaBaseMapper;
@ -163,7 +164,7 @@ public class AccessUserServiceImpl implements AccessUserService {
} else {
// 生成用户token
String uuid = GaeaUtils.UUID();
token = jwtBean.createToken(loginName, uuid);
token = jwtBean.createToken(loginName, uuid, 0, GaeaConstant.TENANT_CODE);
cacheHelper.stringSetExpire(tokenKey, token, 3600);
}

@ -27,8 +27,8 @@ service.interceptors.response.use(
* code为非20000是抛错 可结合自己业务进行修改
*/
const res = response.data
// 50008:非法的token; 50012:其他客户端登录了; 50014:Token 过期了;
if (res.code == '50008' || res.code == '50012' || res.code == '50014') {
// User.credentials.expired:非法的token; 50012:其他客户端登录了; 50014:Token 过期了;
if (res.code == 'User.credentials.expired' || res.code == '50012' || res.code == '50014') {
MessageBox.confirm(
'你已被登出,可以取消继续留在该页面,或者重新登录',
'重新登录',

Loading…
Cancel
Save