| | |
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.encrypt.DESUtil;
|
| | |
|
| | | import com.alipay.api.AlipayApiException;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | |
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.InviteGetMoneyService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoV2Service;
|
| | |
| | | * @param tbOpenid
|
| | | * @param tbNickName
|
| | | * @param tbPortrait
|
| | | * @param tbSession(淘宝session数据,加密)
|
| | | * @param out
|
| | | */
|
| | | @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, String tbSession, 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("系统不存在"));
|
| | |
| | | }
|
| | |
|
| | | redisManager.clearSMSFrequencyLimit(phone, SMSHistory.TYPE_LOGIN);
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(tbSession)) {
|
| | | try {
|
| | | tbSession = DESUtil.decode(tbSession.replace("\n", ""), StringUtil.getBase64String("YeShiFANLI889*+"),
|
| | | StringUtil.getBase64String("*M#34f?,"));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | JSONObject tbs = JSONObject.fromObject(tbSession);
|
| | | tbOpenid = tbs.optString("openId");
|
| | | tbNickName = tbs.optString("nick");
|
| | | tbPortrait = tbs.optString("avatarUrl");
|
| | | }
|
| | |
|
| | | UserInfo tbUserInfo = new UserInfo();
|
| | |
| | | * @param tbOpenid
|
| | | * @param tbNickName
|
| | | * @param tbPortrait
|
| | | * @param tbSession
|
| | | * -淘宝授权session
|
| | | * @param out
|
| | | */
|
| | |
|
| | | @RequestMapping(value = "bindTaoBao")
|
| | | public void bindTaoBao(AcceptData acceptData, Long uid, String tbOpenid, String tbNickName, String tbPortrait,
|
| | | PrintWriter out) {
|
| | | String tbSession, PrintWriter out) {
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(tbSession)) {
|
| | | try {
|
| | | tbSession = DESUtil.decode(tbSession.replace("\n", ""), StringUtil.getBase64String("YeShiFANLI889*+"),
|
| | | StringUtil.getBase64String("*M#34f?,"));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | JSONObject session = JSONObject.fromObject(tbSession);
|
| | | tbOpenid = session.optString("openId");
|
| | | tbNickName = session.optString("nick");
|
| | | tbPortrait = session.optString("avatarUrl");
|
| | | }
|
| | |
|
| | | try {
|
| | | userAccountService.bindTaoBao(uid, tbOpenid, tbNickName, tbPortrait);
|
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
|