| | |
| | | import com.ruoyi.account.service.TAppUserService; |
| | | import com.ruoyi.account.wx.model.WeixinProperties; |
| | | import com.ruoyi.account.wx.pojo.AppletUserDecodeData; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.system.api.model.LoginUserApplet; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | appUser.setPhone(appletUserDecodeData.getPhoneNumber()); |
| | | } |
| | | } |
| | | if(Objects.nonNull(appUser.getStatus())){ |
| | | throwInfo(appUser.getStatus()); |
| | | } |
| | | appUser.setAvatar(appletUserDecodeData.getAvatarUrl()); |
| | | appUser.setCity(appletUserDecodeData.getCity()); |
| | | appUser.setName(appletUserDecodeData.getNickName()); |
| | |
| | | appUser.setPhone(userInfo.getMobile()); |
| | | } |
| | | } |
| | | if(Objects.nonNull(appUser.getStatus())){ |
| | | throwInfo(appUser.getStatus()); |
| | | } |
| | | appUser.setAvatar(userInfo.getAvatar()); |
| | | appUser.setCity(userInfo.getCity()); |
| | | appUser.setName(userInfo.getNickName()); |
| | |
| | | tokenInfos.put("info",loginUserApplet); |
| | | return tokenInfos; |
| | | } |
| | | |
| | | @Override |
| | | public void throwInfo(Integer status){ |
| | | switch (status){ |
| | | case 2: |
| | | throw new ServiceException("账号被冻结,请联系管理员"); |
| | | case 3: |
| | | throw new ServiceException("账号已注销,请重新注册使用"); |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | } |