|
|
|
@ -393,10 +393,12 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity> |
|
|
|
|
loginRequest.setTenDayEffective(2); |
|
|
|
|
if(identify==0){//员工小程序登录
|
|
|
|
|
if(count<=0){ |
|
|
|
|
return ResponseResult.FAIL(60001,"您不是员工,请使用客户小程序登录!"); |
|
|
|
|
return ResponseResult.FAIL(60001,"您的账号没有权限,无法登录!"); |
|
|
|
|
} |
|
|
|
|
}else{//客户小程序登录
|
|
|
|
|
if(count <=0){//新用户
|
|
|
|
|
//如果员工使用客户小程序登录的情况,关联用户表和员工表查询,如果有数据则代表是员工的数据
|
|
|
|
|
int count2 = userLoginDao.selectUserEmpCount(md5UnionId); |
|
|
|
|
if(count2>0 || count <=0){//代表员工或者新用户
|
|
|
|
|
UserEntity userEntity = new UserEntity(); |
|
|
|
|
userEntity.setAccount(userMap.get("nickName").toString());//账号默认为微信名称
|
|
|
|
|
userEntity.setWechatId(md5UnionId);//加密后unionId
|
|
|
|
@ -404,6 +406,17 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity> |
|
|
|
|
userEntity.setCreateTime(new Date());//创建时间
|
|
|
|
|
userLoginDao.insert(userEntity); |
|
|
|
|
} |
|
|
|
|
/* if(count2>0){//代表员工
|
|
|
|
|
return ResponseResult.FAIL(60002,"您不是客户,请使用员工小程序登录!"); |
|
|
|
|
}else if(count <=0){//新用户
|
|
|
|
|
UserEntity userEntity = new UserEntity(); |
|
|
|
|
userEntity.setAccount(userMap.get("nickName").toString());//账号默认为微信名称
|
|
|
|
|
userEntity.setWechatId(md5UnionId);//加密后unionId
|
|
|
|
|
userEntity.setHeadPortaritUrl(userMap.get("avatarUrl").toString());//头像路径
|
|
|
|
|
userEntity.setCreateTime(new Date());//创建时间
|
|
|
|
|
userLoginDao.insert(userEntity); |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ResponseResult result = login(loginRequest); |
|
|
|
|