feat: token名字变更,由token变更为zt-token

This commit is contained in:
xiang2lin 2024-09-30 11:20:30 +08:00
parent 1d979524f3
commit ed5d7fff69
4 changed files with 8 additions and 8 deletions

View File

@ -151,7 +151,7 @@ public class LoginServiceImpl implements ILoginService {
List<SysOrganEntity> sysOrganEntities = sysOrganDao.queryUserCompany(sysOrganEntity); List<SysOrganEntity> sysOrganEntities = sysOrganDao.queryUserCompany(sysOrganEntity);
//返回值 //返回值
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
res.put("token", token); res.put("zt-token", token);
res.put("userInfo", sysUserEntity); res.put("userInfo", sysUserEntity);
res.put("company", sysOrganEntities); res.put("company", sysOrganEntities);

View File

@ -117,8 +117,8 @@ public class EntranceServiceImpl implements IEntranceService {
//} //}
// 接口权限验证 结束 // 接口权限验证 结束
} catch (NotLoginException e) { } catch (NotLoginException e) {
logger.error("token无效"); logger.error("zt-token无效");
return BaseResult.getFailureMessageEntity("token无效"); return BaseResult.getFailureMessageEntity("zt-token无效");
} }
} }
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();

View File

@ -63,13 +63,13 @@ public class ExceptionController {
if (notLoginException.getType().equals(NotLoginException.NOT_TOKEN)) { if (notLoginException.getType().equals(NotLoginException.NOT_TOKEN)) {
message = "未提供token"; message = "未提供token";
} else if (notLoginException.getType().equals(NotLoginException.INVALID_TOKEN)) { } else if (notLoginException.getType().equals(NotLoginException.INVALID_TOKEN)) {
message = "token无效"; message = "zt-token无效";
} else if (notLoginException.getType().equals(NotLoginException.TOKEN_TIMEOUT)) { } else if (notLoginException.getType().equals(NotLoginException.TOKEN_TIMEOUT)) {
message = "token已过期"; message = "zt-token已过期";
} else if (notLoginException.getType().equals(NotLoginException.BE_REPLACED)) { } else if (notLoginException.getType().equals(NotLoginException.BE_REPLACED)) {
message = "token已被顶下线"; message = "zt-token已被顶下线";
} else if (notLoginException.getType().equals(NotLoginException.KICK_OUT)) { } else if (notLoginException.getType().equals(NotLoginException.KICK_OUT)) {
message = "token已被踢下线"; message = "zt-token已被踢下线";
} else { } else {
message = "当前会话未登录"; message = "当前会话未登录";
} }

View File

@ -18,7 +18,7 @@ public class SaTokenConfigure {
@Primary @Primary
public SaTokenConfig getSaTokenConfigPrimary() { public SaTokenConfig getSaTokenConfigPrimary() {
SaTokenConfig config = new SaTokenConfig(); SaTokenConfig config = new SaTokenConfig();
config.setTokenName("token"); // token名称 (同时也是cookie名称) config.setTokenName("zt-token"); // token名称 (同时也是cookie名称)
config.setTimeout(30 * 24 * 60 * 60); // token有效期单位s 默认30天 config.setTimeout(30 * 24 * 60 * 60); // token有效期单位s 默认30天
config.setActivityTimeout(-1); // token临时有效期 (指定时间内无操作就视为token过期) 单位: config.setActivityTimeout(-1); // token临时有效期 (指定时间内无操作就视为token过期) 单位:
config.setIsConcurrent(true); // 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录) config.setIsConcurrent(true); // 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)