mirror of https://gitee.com/stylefeng/roses
【7.3.2】【auth】payload增加一个租户编码
parent
9d8df32228
commit
458744e381
|
@ -380,7 +380,7 @@ public class AuthServiceImpl implements AuthServiceApi {
|
||||||
LoginUser loginUser = userValidateInfo.getLoginUser();
|
LoginUser loginUser = userValidateInfo.getLoginUser();
|
||||||
|
|
||||||
// 9. 生成用户的token
|
// 9. 生成用户的token
|
||||||
DefaultJwtPayload defaultJwtPayload = new DefaultJwtPayload(loginUser.getUserId(), loginUser.getAccount(), loginRequest.getRememberMe(), caToken);
|
DefaultJwtPayload defaultJwtPayload = new DefaultJwtPayload(loginUser.getUserId(), loginUser.getAccount(), loginRequest.getRememberMe(), caToken, loginRequest.getTenantCode());
|
||||||
String jwtToken = JwtContext.me().generateTokenDefaultPayload(defaultJwtPayload);
|
String jwtToken = JwtContext.me().generateTokenDefaultPayload(defaultJwtPayload);
|
||||||
loginUser.setToken(jwtToken);
|
loginUser.setToken(jwtToken);
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,11 @@ public class DefaultJwtPayload {
|
||||||
*/
|
*/
|
||||||
private String caToken;
|
private String caToken;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多租户编码
|
||||||
|
*/
|
||||||
|
private String tenantCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 其他载体信息
|
* 其他载体信息
|
||||||
*/
|
*/
|
||||||
|
@ -78,12 +83,13 @@ public class DefaultJwtPayload {
|
||||||
public DefaultJwtPayload() {
|
public DefaultJwtPayload() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefaultJwtPayload(Long userId, String account, boolean rememberMe, String caToken) {
|
public DefaultJwtPayload(Long userId, String account, boolean rememberMe, String caToken, String tenantCode) {
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
this.account = account;
|
this.account = account;
|
||||||
this.uuid = IdUtil.fastUUID();
|
this.uuid = IdUtil.fastUUID();
|
||||||
this.rememberMe = rememberMe;
|
this.rememberMe = rememberMe;
|
||||||
this.caToken = caToken;
|
this.caToken = caToken;
|
||||||
|
this.tenantCode = tenantCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,7 +201,7 @@ public class CustomerServiceImpl extends ServiceImpl<CustomerMapper, Customer> i
|
||||||
LoginUser loginUser = CustomerFactory.createLoginUser(customer, fileOperatorApi);
|
LoginUser loginUser = CustomerFactory.createLoginUser(customer, fileOperatorApi);
|
||||||
|
|
||||||
// 生成用户的token
|
// 生成用户的token
|
||||||
DefaultJwtPayload defaultJwtPayload = new DefaultJwtPayload(loginUser.getUserId(), loginUser.getAccount(), loginRequest.getRememberMe(), null);
|
DefaultJwtPayload defaultJwtPayload = new DefaultJwtPayload(loginUser.getUserId(), loginUser.getAccount(), loginRequest.getRememberMe(), null, null);
|
||||||
String jwtToken = JwtContext.me().generateTokenDefaultPayload(defaultJwtPayload);
|
String jwtToken = JwtContext.me().generateTokenDefaultPayload(defaultJwtPayload);
|
||||||
loginUser.setToken(jwtToken);
|
loginUser.setToken(jwtToken);
|
||||||
|
|
||||||
|
|
|
@ -656,7 +656,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||||
LoginUser loginUser = userValidateInfo.getLoginUser();
|
LoginUser loginUser = userValidateInfo.getLoginUser();
|
||||||
|
|
||||||
// 生成用户的token
|
// 生成用户的token
|
||||||
DefaultJwtPayload defaultJwtPayload = new DefaultJwtPayload(loginUser.getUserId(), loginUser.getAccount(), false, null);
|
DefaultJwtPayload defaultJwtPayload = new DefaultJwtPayload(loginUser.getUserId(), loginUser.getAccount(), false, null, null);
|
||||||
String jwtToken = JwtContext.me().generateTokenDefaultPayload(defaultJwtPayload);
|
String jwtToken = JwtContext.me().generateTokenDefaultPayload(defaultJwtPayload);
|
||||||
loginUser.setToken(jwtToken);
|
loginUser.setToken(jwtToken);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue