| | |
| | | @Resource
|
| | | private SystemService systemService;
|
| | |
|
| | | |
| | |
|
| | | @Resource
|
| | | private ShamUserService shamUserService;
|
| | |
|
| | |
| | | */
|
| | | @RequestMapping(value = "login")
|
| | | public void login(AcceptData acceptData, String code, String vcode, String phone, boolean wxinstall,
|
| | | String tbOpenid, String tbNickName, String tbPortrait, int loginType, Boolean first, HttpSession session,HttpServletRequest request,
|
| | | PrintWriter out) {
|
| | | String tbOpenid, String tbNickName, String tbPortrait, int loginType, Boolean first, HttpSession session,
|
| | | HttpServletRequest request, PrintWriter out) {
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | |
| | | root.put("data", data);
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | } catch (UserAccountException e) {
|
| | | try {
|
| | | LogHelper.cookieLog("登录出错:" + e.getCode() + "-" + e.getMessage());
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | }
|
| | | }
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "获取微信用户信息失败"));
|
| | | return;
|
| | | }
|
| | | user = userAccountService.getUserInfoByWXUnionId(system.getAppid(), weiXinUser.getUnionid());
|
| | | try {
|
| | | user = userAccountService.getUserInfoByWXUnionId(system.getAppid(), weiXinUser.getUnionid());
|
| | | } catch (UserAccountException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e, null, "获取用户信息出错");
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | } else if (!StringUtil.isNullOrEmpty(tbOpenid)) {
|
| | | user = userAccountService.getUserInfoByTaoBaoOpenId(system.getAppid(), tbOpenid);
|
| | | try {
|
| | | user = userAccountService.getUserInfoByTaoBaoOpenId(system.getAppid(), tbOpenid);
|
| | | } catch (UserAccountException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | } else if (!StringUtil.isNullOrEmpty(phone)) {
|
| | | user = userAccountService.getUserInfoByPhone(system.getAppid(), phone);
|
| | | try {
|
| | | user = userAccountService.getUserInfoByPhone(system.getAppid(), phone);
|
| | | } catch (UserAccountException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (user == null) {
|
| | |
| | | redisManager.removeCommonString(key);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | @RequestMapping(value = "bindalipaywithverifynew")
|
| | | public void bindAlipayWithVerifyNew(AcceptData acceptData, Long uid, String name, String account, PrintWriter out) {
|
| | |
|
| | |
| | | "PERMIT_CHECK_PERM_IDENTITY_THEFT", "PERMIT_NON_BANK_LIMIT_PAYEE", "EXCEED_LIMIT_UNRN_DM_AMOUNT" };
|
| | | try {
|
| | | BindingAccount bindingAccount = bindingAccountService.changeAlipayBindingWithVerify(uid, name, account);
|
| | | out.print(JsonUtil.loadTrue(0, JsonUtil.getGson().toJson(bindingAccount), "系统已成功转账0.1元到提现账号中,提现账号验证通过,恭喜你!可以提现了。"));
|
| | | out.print(JsonUtil.loadTrue(0, JsonUtil.getGson().toJson(bindingAccount),
|
| | | "系统已成功转账0.1元到提现账号中,提现账号验证通过,恭喜你!可以提现了。"));
|
| | | } catch (AlipayTransferException e1) {
|
| | | if (e1.getSubCode().equalsIgnoreCase("PAYEE_NOT_EXIST")) {
|
| | | String msg = "系统未能成功转账0.1元,提现账号信息有误,请核对后重新填写。";
|
| | |
| | | redisManager.removeCommonString(key);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 获取用户资金详情
|
| | |
| | |
|
| | | private static Logger shareGoodsLogger = Logger.getLogger("shareGoodsLog");
|
| | |
|
| | | private static Logger loginLogger = Logger.getLogger("loginLog");
|
| | |
|
| | | public static void userInfo(Object obj) {
|
| | | userLogger.info(obj);
|
| | | }
|
| | |
| | | shareGoodsLogger.info(obj);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 登录信息
|
| | | * @param obj
|
| | | */
|
| | | public static void lgoinInfo(Object obj) {
|
| | | loginLogger.info(obj);
|
| | | }
|
| | |
|
| | | public static void errorDetailInfo(Throwable e) throws Exception {
|
| | | e.printStackTrace();
|
| | | String date = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy_MM_dd");
|
| | |
| | | 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);
|
| | | logInfo.put("tbUserInfo", tbUserInfo);
|
| | | 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);
|
| | | logInfo.put("tbUserInfo", tbUserInfo);
|
| | | 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);
|
| | | }
|
| | |
|
| | |
| | | * @param unionId
|
| | | * @return
|
| | | */
|
| | | public UserInfo getUserInfoByWXUnionId(String appId, String unionId);
|
| | | public UserInfo getUserInfoByWXUnionId(String appId, String unionId) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 根据系统和淘宝的Openid寻找用户
|
| | |
| | | * @param openId
|
| | | * @return
|
| | | */
|
| | | public UserInfo getUserInfoByTaoBaoOpenId(String appId, String openId);
|
| | | public UserInfo getUserInfoByTaoBaoOpenId(String appId, String openId) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 根据系统和电话号码寻找用户
|
| | |
| | | * @param phone
|
| | | * @return
|
| | | */
|
| | | public UserInfo getUserInfoByPhone(String appId, String phone);
|
| | | public UserInfo getUserInfoByPhone(String appId, String phone) throws UserAccountException;
|
| | |
|
| | | public void addUser(UserInfo user);
|
| | |
|
| | |
| | | log4j.appender.shareGoodsLog.layout=org.apache.log4j.PatternLayout
|
| | | log4j.appender.shareGoodsLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n
|
| | |
|
| | |
|
| | | log4j.logger.loginLog=info,loginLog
|
| | | log4j.appender.loginLog=org.apache.log4j.DailyRollingFileAppender
|
| | | log4j.appender.loginLog.File=logs/user/login.log
|
| | | log4j.appender.loginLog.MaxFileSize=20MB
|
| | | log4j.appender.loginLog.MaxBackupIndex=100
|
| | | log4j.appender.loginLog.layout=org.apache.log4j.PatternLayout
|
| | | log4j.appender.loginLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n
|
| | |
|