| | |
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.AccountDetailsFactory;
|
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | |
| | | @Override
|
| | | public LoginResult login(HttpServletRequest request, Boolean first, String appId, String code, String phone,
|
| | | UserInfo tbUserInfo, boolean wxinstall, int loginType) throws UserAccountException {
|
| | |
|
| | | JSONObject logInfo = new JSONObject();
|
| | | logInfo.put("appId", appId);
|
| | | logInfo.put("code", code);
|
| | | logInfo.put("phone", phone);
|
| | | if (tbUserInfo != null)
|
| | | logInfo.put("tbUserInfo", tbUserInfo.getId());
|
| | | logInfo.put("loginType", loginType);
|
| | | LogHelper.lgoinInfo(logInfo.toString());
|
| | |
|
| | | HttpSession session = request.getSession();
|
| | | if (first != null && first == true)
|
| | | session.removeAttribute("LAST_LOGIN_USER");
|
| | |
| | | @Override
|
| | | public LoginResult loginNoInstallWX(String appId, String code, String phone, UserInfo tbUserInfo, int loginType)
|
| | | throws UserAccountException {
|
| | | JSONObject logInfo = new JSONObject();
|
| | | logInfo.put("appId", appId);
|
| | | logInfo.put("code", code);
|
| | | logInfo.put("phone", phone);
|
| | | if (tbUserInfo != null)
|
| | | logInfo.put("tbUserInfo", tbUserInfo.getId());
|
| | | logInfo.put("loginType", loginType);
|
| | | LogHelper.lgoinInfo(logInfo.toString());
|
| | |
|
| | | UserInfo userInfo = null;
|
| | | WeiXinUser weiXinUser = null;
|
| | | switch (loginType) {
|
| | |
| | | * @param unionId
|
| | | * @return
|
| | | */
|
| | | public UserInfo getUserInfoByWXUnionId(String appId, String unionId) {
|
| | | public UserInfo getUserInfoByWXUnionId(String appId, String unionId) throws UserAccountException {
|
| | | if (StringUtil.isNullOrEmpty(appId))
|
| | | throw new UserAccountException(1, "appId为空");
|
| | | if (StringUtil.isNullOrEmpty(unionId))
|
| | | throw new UserAccountException(2, "unionId为空");
|
| | |
|
| | | return userInfoMapper.getUserInfoByAppIdAndWXUnionId(appId, unionId);
|
| | | }
|
| | |
|
| | |
| | | * @param openId
|
| | | * @return
|
| | | */
|
| | | public UserInfo getUserInfoByTaoBaoOpenId(String appId, String openId) {
|
| | |
|
| | | public UserInfo getUserInfoByTaoBaoOpenId(String appId, String openId) throws UserAccountException {
|
| | | if (StringUtil.isNullOrEmpty(appId))
|
| | | throw new UserAccountException(1, "appId为空");
|
| | | if (StringUtil.isNullOrEmpty(openId))
|
| | | throw new UserAccountException(2, "openId为空");
|
| | | return userInfoMapper.getUserInfoByAppIdAndTaoBaoOpenId(appId, openId);
|
| | | }
|
| | |
|
| | |
| | | * @param phone
|
| | | * @return
|
| | | */
|
| | | public UserInfo getUserInfoByPhone(String appId, String phone) {
|
| | |
|
| | | public UserInfo getUserInfoByPhone(String appId, String phone) throws UserAccountException {
|
| | | if (StringUtil.isNullOrEmpty(appId))
|
| | | throw new UserAccountException(1, "appId为空");
|
| | | if (StringUtil.isNullOrEmpty(phone))
|
| | | throw new UserAccountException(2, "phone为空");
|
| | | return userInfoMapper.getUserInfoByAppIdAndPhone(appId, phone);
|
| | | }
|
| | |
|