门店号管理

master
LegnaYet 6 years ago
parent d3b980cd0f
commit 6ba1860f29

@ -43,6 +43,11 @@ public class LoginBean {
*/
private String cpUserId;
/**
* sessionKey
*/
private String sessionKey;
/**
* id
*/

@ -103,11 +103,13 @@ public class LoginController extends BaseController {
if (accountInfo.get("cpUserId").equals(loginBean.getCpUserId())){
loginBean.getLoginInfo().put("code",LoginEnum.LOGIN_SUCCEED.getCode());
}
loginBean.setSessionKey(accountInfo.get("sessionKey"));
}else{
if (StringUtils.isNotBlank(accountInfo.get("cpUserId"))){
String cpUserId = accountInfo.get("cpUserId");
loginBean = new LoginBean(ERROR_ACCOUNT_NOT_BIND);
loginBean.setLogin(cpUserId);
loginBean.setSessionKey(accountInfo.get("sessionKey"));
}
}
}else{

@ -221,12 +221,13 @@ public class LoginServiceImpl implements LoginService {
@Override
public Map<String, String> qyMiniAutoLogin(String code) throws WxErrorException {
Map<String, String> result = new HashMap<>(3);
Map<String, String> result = new HashMap<>(4);
String cpUserId = qwMailListManageService.getCpUserIdByCode(code);
result.put("cpUserId",cpUserId);
Map<String, String> codeInfo = qwMailListManageService.getCpUserIdByCode(code);
result.put("cpUserId",codeInfo.get("cpUserId"));
result.put("sessionKey",codeInfo.get("sessionKey"));
Map<String, Object> selectAccountMap = new HashMap<>();
selectAccountMap.put("login", cpUserId);
selectAccountMap.put("login", codeInfo.get("cpUserId"));
selectAccountMap.put("type", AccountEnum.ACCOUNT_TYPE_QYWX.getType());
List<PrivilageAccountDO> privilageAccountDOS = privilageAccountDOMapper.selectByMap(selectAccountMap);
//账号不存在

@ -242,10 +242,15 @@ public class QWMailListManageService {
* @return
* @throws WxErrorException
*/
public String getCpUserIdByCode(String code) throws WxErrorException {
public Map<String,String> getCpUserIdByCode(String code) throws WxErrorException {
Map<String,String> result = new HashMap<> ();
wxCpService = WxCpConfiguration.getCpService(1);
WxCpMaJsCode2SessionResult wxCpMaJsCode2SessionResult = wxCpService.jsCode2Session(code);
return wxCpMaJsCode2SessionResult.getUserId();
String userId = wxCpMaJsCode2SessionResult.getUserId();
String sessionKey = wxCpMaJsCode2SessionResult.getSessionKey();
result.put("cpUserId",userId);
result.put("sessionKey",sessionKey);
return result;
}
}

Loading…
Cancel
Save