huanghongfa
2021-01-22 04c96f26282f021fcc59b40d6f11f172fc070af8
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/LoginApi.java
@@ -10,6 +10,7 @@
import com.panzhihua.common.model.vos.LoginReturnVO;
import com.panzhihua.common.model.vos.community.ComActVO;
import com.panzhihua.common.model.vos.community.ComMngStructAreaVO;
import com.panzhihua.common.model.vos.user.SysUserAgreementVO;
import com.panzhihua.common.service.auth.TokenService;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.service.user.UserService;
@@ -60,9 +61,13 @@
             sessionInfo = maService.getUserService().getSessionInfo(code);
        } catch (Exception e) {
            log.error("微信登录失败【{}】", e.getMessage());
            sessionInfo=new WxMaJscode2SessionResult();
            sessionInfo.setOpenid("88888888");
            sessionInfo.setSessionKey("9999999");
            if (code.equals("22")) {
                sessionInfo=new WxMaJscode2SessionResult();
                sessionInfo.setOpenid("88888888");
                sessionInfo.setSessionKey("9999999");
            }else{
                return R.fail("微信登录失败");
            }
        }
        log.info("微信登录成功【{}】", JSONObject.toJSONString(sessionInfo));
        String openid = sessionInfo.getOpenid();
@@ -173,4 +178,11 @@
        loginUserInfoVO.setUserId(userId);
        return userService.putUserCommunityArea(loginUserInfoVO);
    }
    @ApiOperation(value = "用户协议和隐私政策",response = SysUserAgreementVO.class)
    @GetMapping("useragreement")
    public R userAgreement(){
        int type=1;
        return userService.userAgreement(type);
    }
}