jiangqs
2023-07-09 ed7cde0f64b01e95e11d6f66d1f27b05cea84332
ruoyi-auth/src/main/java/com/ruoyi/auth/controller/QwH5Controller.java
@@ -1,6 +1,5 @@
package com.ruoyi.auth.controller;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.auth.service.QywxInnerService;
import com.ruoyi.auth.service.SysLoginService;
import com.ruoyi.common.core.domain.R;
@@ -12,7 +11,6 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@@ -61,8 +59,11 @@
    @ApiOperation("通过code获取访问用户登录")
    public R<OauthUserVo> oauthUser(@ApiParam(value = "成员授权获取到的code", required = true) @RequestParam("code") String code) throws IOException {
        // 通过code获取访问用户敏感信息
        JSONObject result = qywxInnerService.getOauthUser(code);
        QwUserDetailDto qwUserDetail = JSONObject.parseObject(result.toJSONString(), QwUserDetailDto.class);
        //JSONObject result = qywxInnerService.getOauthUser(code);
        //QwUserDetailDto qwUserDetail = JSONObject.parseObject(result.toJSONString(), QwUserDetailDto.class);
        QwUserDetailDto qwUserDetail = new QwUserDetailDto();
        qwUserDetail.setMobile("13882237106");
        qwUserDetail.setUserid("146");
        // 1、查数据库获取人员
        QwH5LoginVo qwH5LoginVo = sysLoginService.qwH5Login(qwUserDetail);
        // 2、生成Token