提交 b3be3ddf 编写于 作者: laizhilong's avatar laizhilong

去掉微信开放平台、钉钉开放平台的appid和appsecret,正式使用时通过配置文件引入

上级 a4be4e38
...@@ -38,9 +38,9 @@ public class UserDingtalkRegisterResource { ...@@ -38,9 +38,9 @@ public class UserDingtalkRegisterResource {
@Qualifier("UAAUserService") @Qualifier("UAAUserService")
private AuthenticationUserService userDetailsService; private AuthenticationUserService userDetailsService;
@Value("${ibiz.auth.dingtalk.appid:dingoatysxi5rpbluqgzpk}")// 个人应用开发过程中的唯一性标识AppId,最好在配置文件进行初始化 @Value("${ibiz.auth.dingtalk.appid:}")// 个人应用开发过程中的唯一性标识AppId,最好在配置文件进行初始化
private String DingtalkAppid; private String DingtalkAppid;
@Value("${ibiz.auth.dingtalk.appid:z2SuCSciWQJ6VSFX8jvHzTF0G_rEmHpjHrZct0rGnWrLyl8cZiRny72244EvF4SO}")// 个人应用AppSecret,最好在配置文件进行初始化 @Value("${ibiz.auth.dingtalk.appid:}")// 个人应用AppSecret,最好在配置文件进行初始化
private String DingtalkAppSecret; private String DingtalkAppSecret;
@Value("${ibiz.auth.dingtalk.openid:}") @Value("${ibiz.auth.dingtalk.openid:}")
private String DingtalkOpenid; private String DingtalkOpenid;
...@@ -94,10 +94,12 @@ public class UserDingtalkRegisterResource { ...@@ -94,10 +94,12 @@ public class UserDingtalkRegisterResource {
Map<String, Object> sqlParam = new HashMap<>(); Map<String, Object> sqlParam = new HashMap<>();
sqlParam.put("avatar", openid); sqlParam.put("avatar", openid);
List<JSONObject> select = iSysPSSystemService.select(sql, sqlParam); List<JSONObject> select = iSysPSSystemService.select(sql, sqlParam);
// 该钉钉用户注册过账号,登录系统
if (select.size() > 0) { if (select.size() > 0) {
IBZUSER ibzuser = select.get(0).toJavaObject(IBZUSER.class); IBZUSER ibzuser = select.get(0).toJavaObject(IBZUSER.class);
object.put("ibzuser", ibzuser); object.put("ibzuser", ibzuser);
// 生成登录token信息
userDetailsService.resetByUsername(ibzuser.getLoginname()); userDetailsService.resetByUsername(ibzuser.getLoginname());
AuthenticationUser user = userDetailsService.loadUserByLogin(ibzuser.getLoginname(), ibzuser.getPassword()); AuthenticationUser user = userDetailsService.loadUserByLogin(ibzuser.getLoginname(), ibzuser.getPassword());
final String token = jwtTokenUtil.generateToken(user); final String token = jwtTokenUtil.generateToken(user);
......
...@@ -39,9 +39,9 @@ public class UserWechatRegisterResource { ...@@ -39,9 +39,9 @@ public class UserWechatRegisterResource {
@Qualifier("UAAUserService") @Qualifier("UAAUserService")
private AuthenticationUserService userDetailsService; private AuthenticationUserService userDetailsService;
@Value("${ibiz.auth.wechat.appID:wx4a7473ac9c617f76}")// 微信开放平台appid,最好在配置文件进行初始化 @Value("${ibiz.auth.wechat.appID:}")// 微信开放平台appid,最好在配置文件进行初始化
private String WechatAppid; private String WechatAppid;
@Value("${ibiz.auth.wechat.appsecret:c2b308b9245dffa316b049840fd81a79}")// 微信开放平台appsecret,最好在配置文件进行初始化 @Value("${ibiz.auth.wechat.appsecret:}")// 微信开放平台appsecret,最好在配置文件进行初始化
private String WechatAppsecret; private String WechatAppsecret;
@Value("${ibiz.auth.wechat.openid:}") @Value("${ibiz.auth.wechat.openid:}")
private String WechatOpenid; private String WechatOpenid;
...@@ -129,10 +129,12 @@ public class UserWechatRegisterResource { ...@@ -129,10 +129,12 @@ public class UserWechatRegisterResource {
Map<String, Object> sqlParam = new HashMap<>(); Map<String, Object> sqlParam = new HashMap<>();
sqlParam.put("avatar", openid); sqlParam.put("avatar", openid);
List<JSONObject> select = iSysPSSystemService.select(sql, sqlParam); List<JSONObject> select = iSysPSSystemService.select(sql, sqlParam);
// 该微信用户注册过账号,登录系统
if (select.size() > 0) { if (select.size() > 0) {
IBZUSER ibzuser = select.get(0).toJavaObject(IBZUSER.class); IBZUSER ibzuser = select.get(0).toJavaObject(IBZUSER.class);
object.put("ibzuser", ibzuser); object.put("ibzuser", ibzuser);
// 生成登录token信息
userDetailsService.resetByUsername(ibzuser.getLoginname()); userDetailsService.resetByUsername(ibzuser.getLoginname());
AuthenticationUser user = userDetailsService.loadUserByLogin(ibzuser.getLoginname(), ibzuser.getPassword()); AuthenticationUser user = userDetailsService.loadUserByLogin(ibzuser.getLoginname(), ibzuser.getPassword());
final String token = jwtTokenUtil.generateToken(user); final String token = jwtTokenUtil.generateToken(user);
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册