| | |
| | | @RequestMapping(value = "getHomeConfig", method = RequestMethod.POST)
|
| | | public void getHomeConfig(AcceptData acceptData, PrintWriter out) {
|
| | | AppHomeFloatImg appHomeFloatImg = configService.getAppHomeFloatImg();
|
| | | if ("ios".equalsIgnoreCase(acceptData.getPlatform()))
|
| | | appHomeFloatImg = null;
|
| | | JSONObject data = new JSONObject();
|
| | | if (appHomeFloatImg != null)
|
| | | data.put("floatImg", appHomeFloatImg);
|
| | |
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | if (!StringUtil.isNullOrEmpty(imei) || !StringUtil.isNullOrEmpty(idfa)) {
|
| | | long startTime = java.lang.System.currentTimeMillis();
|
| | | |
| | | TaoBaoSearchResult result = TaoKeApiUtil.guessDeviceLike(page, 50, imei, idfa);
|
| | |
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null) {
|
| | |
| | | import com.yeshi.fanli.util.factory.MonitorFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller(value = "ShareController1")
|
| | |
| | | descText = descText.substring(0);
|
| | | data.put("descText", descText);
|
| | | //
|
| | | data.put("notifyPicture", "");
|
| | | data.put("notifyDesc", "");
|
| | | String imgs = configService.get("goods_share_notify_imgs");
|
| | | JSONArray array = JSONArray.fromObject(imgs);
|
| | | int p = (int) (array.size() * Math.random());
|
| | | if (p < array.size())
|
| | | data.put("notifyPicture", array.optString(p));
|
| | | data.put("notifyDesc", configService.get("goods_share_notify"));
|
| | |
|
| | | // 添加分享记录
|
| | | BigDecimal rate = new BigDecimal(hongBaoManageService.get("hongbao_goods_proportion"));
|
| | |
| | | */
|
| | | @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,
|
| | | 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) {
|
| | |
| | | tbUserInfo.setTbName(tbNickName);
|
| | | tbUserInfo.setTbPic(tbPortrait);
|
| | | try {
|
| | | LoginResult result = userAccountService.login(session, first, system.getAppid(), code, phone, tbUserInfo,
|
| | | LoginResult result = userAccountService.login(request, first, system.getAppid(), code, phone, tbUserInfo,
|
| | | wxinstall, loginType);
|
| | | if (result == null)
|
| | | LogHelper.error("login-result为空值");
|
| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpSession;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public LoginResult login(HttpSession session, Boolean first, String appId, String code, String phone,
|
| | | public LoginResult login(HttpServletRequest request, Boolean first, String appId, String code, String phone,
|
| | | UserInfo tbUserInfo, boolean wxinstall, int loginType) throws UserAccountException {
|
| | |
|
| | | HttpSession session = request.getSession();
|
| | | if (first != null && first == true)
|
| | | session.removeAttribute("LAST_LOGIN_USER");
|
| | | // 会话中上次登录的用户
|
| | |
| | | updateUserInfo.setPortrait(weiXinUser.getHeadimgurl());
|
| | | updateUserInfo.setWxPic(weiXinUser.getHeadimgurl());
|
| | | updateUserInfo.setWxName(weiXinUser.getNickname());
|
| | | // 设置登录时间与登录类型
|
| | | updateUserInfo.setLastLoginTime(System.currentTimeMillis());
|
| | | updateUserInfo.setLoginType(loginType);
|
| | | updateUserInfo.setLastLoginIp(request.getRemoteHost());
|
| | |
|
| | | userInfoMapper.updateByPrimaryKeySelective(updateUserInfo);
|
| | | // 删除邀请图片
|
| | | spreadUserImgService.deleteImgUrl(userInfo.getId());
|
| | |
| | | userInfo.setWxOpenId(weiXinUser.getOpenid());
|
| | | userInfo.setWxUnionId(weiXinUser.getUnionid());
|
| | | userInfo.setWxPic(weiXinUser.getHeadimgurl());
|
| | | userInfo.setLastLoginTime(System.currentTimeMillis());
|
| | | userInfo.setLoginType(loginType);
|
| | | userInfo.setLastLoginIp(request.getRemoteHost());
|
| | | addUser(userInfo);
|
| | |
|
| | | return new LoginResult(LoginResult.TYPE_NORMAL, userInfo);
|
| | |
| | | userInfo.setTbPic(lastUser.getTbPic());
|
| | | }
|
| | | userInfo.setLastLoginTime(System.currentTimeMillis());
|
| | | userInfo.setLoginType(loginType);
|
| | | userInfo.setLastLoginIp(request.getRemoteHost());
|
| | | addUser(userInfo);
|
| | | session.removeAttribute("LAST_LOGIN_USER");
|
| | | return new LoginResult(LoginResult.TYPE_NORMAL, userInfo);
|
| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpSession;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.LoginResult;
|
| | |
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public LoginResult login(HttpSession session, Boolean first, String appId, String code, String phone,
|
| | | public LoginResult login(HttpServletRequest request, Boolean first, String appId, String code, String phone,
|
| | | UserInfo tbUserInfo, boolean wxinstall, int loginType) throws UserAccountException;
|
| | |
|
| | | /**
|