| | |
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenOPPOService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenVIVOService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenXMService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | | import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.GsonUtil;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | |
| | | private DeviceTokenOPPOService deviceTokenOPPOService;
|
| | |
|
| | | @Resource
|
| | | private DeviceTokenXMService deviceTokenXMService;
|
| | |
|
| | | @Resource
|
| | | private DeviceTokenVIVOService deviceTokenVIVOService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | |
|
| | | @Resource
|
| | |
| | | @Resource
|
| | | private DeviceActiveService deviceActiveService;
|
| | |
|
| | | private static final String PASSWORD_MAX_ERROR = "password_max_error";
|
| | | private static final String EXTRACT_MIN_MONEY = "extract_min_money";
|
| | | private static final String EXTRACT_MAX_MONEY = "extract_max_money";
|
| | |
|
| | | /**
|
| | | *
|
| | | * @param acceptData
|
| | |
| | | public void login(AcceptData acceptData, String code, String vcode, String phone, boolean wxinstall,
|
| | | String tbOpenid, String tbNickName, String tbPortrait, String tbSession, int loginType, Boolean first,
|
| | | HttpSession session, HttpServletRequest request, PrintWriter out) {
|
| | |
|
| | | // 2.0以下版本不允许登录
|
| | | if (!VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | out.print("请升级到最新版本");
|
| | | return;
|
| | | }
|
| | |
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | |
| | | platformType = 2;
|
| | | }
|
| | | userSystemCouponService.copyLotteryPrize(uuser.getId(), platformType, acceptData.getDevice());
|
| | | // 绑定oppo推送
|
| | | // 绑定oppo,vivo推送
|
| | | DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
|
| | | if (active != null) {
|
| | | deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
|
| | | deviceTokenVIVOService.bindUid(uuser.getId(), active.getId());
|
| | | deviceTokenXMService.bindUid(active.getId(), uuser.getId());
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | |
| | |
|
| | | } catch (UserAccountException e) {
|
| | | try {
|
| | | LogHelper.cookieLog("登录出错:" + e.getCode() + "-" + e.getMessage());
|
| | | LogHelper.error("登录出错:" + e.getCode() + "-" + e.getMessage());
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | |
| | | @RequestMapping(value = "register")
|
| | | public void register(AcceptData acceptData, String tbOpenid, String tbNickName, String tbPortrait, String vcode,
|
| | | String phone, HttpServletRequest request, HttpSession session, PrintWriter out) {
|
| | | // 2.0以下版本不允许登录
|
| | | if (!VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | out.print("请升级到最新版本");
|
| | | return;
|
| | | }
|
| | |
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | |
| | | try {
|
| | | userAccountService.register(user);
|
| | | user = userInfoService.getUserByIdWithMybatis(user.getId());
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("user", GsonUtil.toJsonExpose(UserUtil.filterForClientUser(user)));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (UserAccountException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 账号打通
|
| | | * |
| | | * @param acceptData
|
| | | * @param mainUid
|
| | | * @param lessUid
|
| | | * @param session
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "connect")
|
| | | public void connect(AcceptData acceptData, long mainUid, long lessUid, HttpSession session, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (mainUid == 0 || lessUid == 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请上传打通用户ID"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | userAccountService.connectUsers(new UserInfo(mainUid), new UserInfo(lessUid));
|
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(mainUid);
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("user", GsonUtil.toJsonExpose(UserUtil.filterForClientUser(user)));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | String key = "bindalipay-" + uid;
|
| | |
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.bindAlipay, uid + "");
|
| | | if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key))) {
|
| | | out.print(JsonUtil.loadFalseResult(2, "服务器繁忙,请稍后重试"));
|
| | | return;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | String key = "bindalipay-" + uid;
|
| | |
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.bindAlipay, uid + "");
|
| | | if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key))) {
|
| | | out.print(JsonUtil.loadFalseResult(1001, "服务器繁忙,请稍后重试"));
|
| | | return;
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | String key = "bindalipay-" + uid;
|
| | |
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.bindAlipay, uid + "");
|
| | | if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key))) {
|
| | | out.print(JsonUtil.loadFalseResult(1001, "服务器繁忙,请稍后重试"));
|
| | | return;
|
| | |
| | | if (deviceActive != null) {
|
| | | // 解绑OPPO推送的用户绑定
|
| | | deviceTokenOPPOService.unBindUid(uid, deviceActive.getId());
|
| | | // 解绑VIVO推送的用户绑定
|
| | | deviceTokenVIVOService.unBindUid(uid, deviceActive.getId());
|
| | | // 解绑XM推送的用户绑定
|
| | | deviceTokenXMService.unBindUid(deviceActive.getId());
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | |
| | | @RequestMapping(value = "loginNew", method = RequestMethod.POST)
|
| | | public void loginNew(AcceptData acceptData, String vcode, String phone, String code, int loginType,
|
| | | HttpServletRequest request, PrintWriter out) {
|
| | |
|
| | | // 2.0以下版本不允许登录
|
| | | if (!VersionUtil.greaterThan_2_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | out.print("请升级到最新版本");
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | |
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | if (VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | /* 新人红包 */
|
| | | try {
|
| | | userTaoLiJinOriginService.synchDeviceHongbao(uuser.getId(), device);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | // 绑定oppo推送
|
| | | DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
|
| | | if (active != null) {
|
| | | deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
|
| | | deviceTokenVIVOService.bindUid(uuser.getId(), active.getId());
|
| | | deviceTokenXMService.bindUid(active.getId(), uuser.getId());
|
| | | }
|
| | | }
|
| | | });
|
| | |
| | | } catch (UserAccountException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | try {
|
| | | LogHelper.cookieLog("登录出错:" + e.getCode() + "-" + e.getMessage());
|
| | | LogHelper.error("登录出错:" + e.getCode() + "-" + e.getMessage());
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|