parent
8d7830b86f
commit
acb9d04fc5
|
|
@ -1,5 +1,7 @@
|
||||||
package com.mdd.front;
|
package com.mdd.front;
|
||||||
|
|
||||||
|
import com.mdd.common.util.StringUtils;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentSkipListMap;
|
import java.util.concurrent.ConcurrentSkipListMap;
|
||||||
|
|
||||||
|
|
@ -25,6 +27,9 @@ public class LikeFrontThreadLocal {
|
||||||
map = new ConcurrentSkipListMap<>();
|
map = new ConcurrentSkipListMap<>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNull(val)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
map.put(key, val);
|
map.put(key, val);
|
||||||
MY_LOCAL.set(map);
|
MY_LOCAL.set(map);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -193,10 +193,15 @@ public class LoginServiceImpl implements ILoginService {
|
||||||
@Override
|
@Override
|
||||||
public LoginTokenVo officeLogin(String code, Integer terminal) {
|
public LoginTokenVo officeLogin(String code, Integer terminal) {
|
||||||
try {
|
try {
|
||||||
WxMpService wxMpService = WxMnpDriver.openSetting();
|
WxMpService wxMpService = WxMnpDriver.oa();
|
||||||
WxOAuth2AccessToken wxOAuth2AccessToken = wxMpService.getOAuth2Service().getAccessToken(code);
|
WxOAuth2AccessToken wxOAuth2AccessToken = wxMpService.getOAuth2Service().getAccessToken(code);
|
||||||
String uniId = wxOAuth2AccessToken.getUnionId();
|
String uniId = wxOAuth2AccessToken.getUnionId();
|
||||||
String openId = wxOAuth2AccessToken.getOpenId();
|
String openId = wxOAuth2AccessToken.getOpenId();
|
||||||
|
|
||||||
|
System.out.println("uniId:" + uniId);
|
||||||
|
System.out.println("openId:" + openId);
|
||||||
|
|
||||||
|
|
||||||
String unionId = uniId == null ? "0" : uniId;
|
String unionId = uniId == null ? "0" : uniId;
|
||||||
|
|
||||||
String avatar = "";
|
String avatar = "";
|
||||||
|
|
@ -226,7 +231,7 @@ public class LoginServiceImpl implements ILoginService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String oaCodeUrl(String url) {
|
public String oaCodeUrl(String url) {
|
||||||
WxMpService wxMpService = WxMnpDriver.openSetting();
|
WxMpService wxMpService = WxMnpDriver.oa();
|
||||||
WxMpOAuth2ServiceImpl wxMpOAuth2Service = new WxMpOAuth2ServiceImpl(wxMpService);
|
WxMpOAuth2ServiceImpl wxMpOAuth2Service = new WxMpOAuth2ServiceImpl(wxMpService);
|
||||||
String state = ToolUtils.makeMd5(ToolUtils.makeToken());
|
String state = ToolUtils.makeMd5(ToolUtils.makeToken());
|
||||||
return wxMpOAuth2Service.buildAuthorizationUrl(url, WxConsts.OAuth2Scope.SNSAPI_USERINFO, state);
|
return wxMpOAuth2Service.buildAuthorizationUrl(url, WxConsts.OAuth2Scope.SNSAPI_USERINFO, state);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue