wushunjie
杜函宇 10 months ago
parent e02740686c
commit 39a739dde9

@ -91,7 +91,8 @@ public class ChiefController {
JSONObject dataJson = JSONUtil.parseObj(getMain.body());
ChiefResponse bean = JSONUtil.toBean(dataJson, ChiefResponse.class);
//判断几个政务端用户,等待商量结果
bean.setToken(singleLoginService.singleLogin(bean.getId(),bean.getName(),null,"02"));
//lj 102 其他是100
bean.setToken(singleLoginService.singleLogin(bean.getId(),bean.getName(),null,"02",bean.getMobile()));
return AjaxResult.success(bean);
} else {
throw new ServiceException("登陆失败");

@ -132,7 +132,7 @@ public class SingleLoginController {
id = bmsEnterpriseBasicInfo.getId();
}
// 设置过期时间为8小时
String token = singleLoginService.singleLogin(req.getUscc(),req.getEpname(),id,"01");
String token = singleLoginService.singleLogin(req.getUscc(),req.getEpname(),id,"01",null);
res.setToken(token);
res.setMain(req);
redisCache.setCacheObject(key, res, expirationSeconds, TimeUnit.MINUTES);

@ -6,5 +6,5 @@ package com.ruoyi.jjh.declaration.single.service;
* @since 2024/6/4 15:16
*/
public interface SingleLoginService {
String singleLogin(String userName,String nickName,Long id,String userType);
String singleLogin(String userName,String nickName,Long id,String userType,String phone);
}

@ -39,7 +39,7 @@ public class SingleLoginServiceImpl implements SingleLoginService {
private ISysUserService userService;
@Override
public String singleLogin(String userName, String nickName, Long id, String userType) {
public String singleLogin(String userName, String nickName, Long id, String userType,String phone) {
// 用户验证
Authentication authentication;
try {
@ -47,11 +47,13 @@ public class SingleLoginServiceImpl implements SingleLoginService {
user.setUserName(userName);
user.setNickName(nickName);
user.setPassword("admin123");
user.setPhonenumber(phone);
Long[] roles = new Long[1];
if("01".equals(userType)){
roles[0]=101L;
}else if("02".equals(userType)){
roles[0]=100L;
//在这里可以判断具体要给什么权限
roles[0]=102L;
}
user.setRoleIds(roles);
user.setStatus("0");

@ -61,6 +61,11 @@ spring:
wall:
config:
multi-statement-allow: true
# 开发环境配置
server:
servlet:
# 应用的访问路径
context-path: /api
#自己客户端地址
returnUrl: http://39.101.188.84:9999/demo/JinJiHu
#returnUrl: http://192.168.0.105:80/

@ -52,7 +52,7 @@ spring:
# 国际化资源文件路径
basename: i18n/messages
profiles:
active: druid
active: internet
# 文件上传
servlet:
multipart:

Loading…
Cancel
Save