修改小程序登录逻辑
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package com.ruoyi.cms.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WechatAuthVO {
|
||||
private String openid;
|
||||
private String unionid;
|
||||
private String sessionKey;
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.entity.AppUserShow;
|
||||
import com.ruoyi.common.core.domain.entity.MyChart;
|
||||
import com.ruoyi.common.core.domain.entity.AppUser;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* APP用户Mapper接口
|
||||
@@ -26,15 +27,15 @@ public interface AppUserMapper extends BaseMapper<AppUser>
|
||||
|
||||
List<AppUser> selectByJobId(Long jobId);
|
||||
|
||||
AppUser selectByOpenid(String openid);
|
||||
AppUser selectByOpenid(@Param("openid")String openid, @Param("userType") String userType);
|
||||
|
||||
int insertSysUserRole(Map<String,Object> map);
|
||||
|
||||
int insertSysUser(SysUser sysUser);
|
||||
|
||||
MyChart getMyTj(Long userId);
|
||||
MyChart getMyTj(@Param("userId") Long userId);
|
||||
|
||||
SysUser selectSysUserIdcard(String idCard);
|
||||
SysUser selectSysUserIdcard(@Param("idCard") String idCard);
|
||||
|
||||
List<AppUserShow> selectUserApplyList(AppUser appUser);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,11 @@ public interface IAppUserService
|
||||
|
||||
public AppUser getPhone(String phone);
|
||||
|
||||
AppUser selectByOpenid(String openid);
|
||||
public AppUser getPhoneAndNoRole(String phone);
|
||||
|
||||
public AppUser getPhoneAndUserType(String phone,String userType);
|
||||
|
||||
AppUser selectByOpenid(String openid,String userType);
|
||||
|
||||
public AppUser registerAppUser(RegisterBody registerBody);
|
||||
|
||||
|
||||
@@ -185,8 +185,20 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserMapper,AppUser> imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppUser selectByOpenid(String openid) {
|
||||
return appUserMapper.selectByOpenid(openid);
|
||||
public AppUser getPhoneAndNoRole(String phone) {
|
||||
return appUserMapper.selectOne(new LambdaQueryWrapper<AppUser>()
|
||||
.eq(AppUser::getPhone, phone).eq(AppUser::getDelFlag,"0").isNull(AppUser::getIsCompanyUser).orderByDesc(AppUser::getUpdateTime).last("LIMIT 1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppUser getPhoneAndUserType(String phone,String userType) {
|
||||
return appUserMapper.selectOne(new LambdaQueryWrapper<AppUser>()
|
||||
.eq(AppUser::getPhone, phone).eq(AppUser::getIsCompanyUser,userType).eq(AppUser::getDelFlag,"0").orderByDesc(AppUser::getUpdateTime).last("LIMIT 1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppUser selectByOpenid(String openid,String userType) {
|
||||
return appUserMapper.selectByOpenid(openid,userType);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectByOpenid" resultType="com.ruoyi.common.core.domain.entity.AppUser">
|
||||
<include refid="selectAppUserVo"/> WHERE DEL_FLAG = '0' and openid=#{openid} LIMIT 1
|
||||
<include refid="selectAppUserVo"/> WHERE DEL_FLAG = '0' and openid=#{openid} and is_company_user=#{userType} LIMIT 1
|
||||
</select>
|
||||
|
||||
<insert id="insertSysUserRole" parameterType="java.util.Map">
|
||||
|
||||
Reference in New Issue
Block a user