| | |
| | | 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; |
| | |
| | | } |
| | | |
| | | |
| | | @GetMapping("/h5/oauthUser") |
| | | @ApiOperation("通过code获取访问用户登录") |
| | | public R<OauthUserVo> oauthUser(@ApiParam(value = "成员授权获取到的code", required = true) @RequestParam("code") String code) throws IOException { |
| | | @GetMapping("/h5/oauthStaff") |
| | | @ApiOperation("通过code获取员工端用户登录") |
| | | public R<OauthUserVo> oauthStaff(@ApiParam(value = "成员授权获取到的code", required = true) @RequestParam("code") String code) throws IOException { |
| | | // 通过code获取访问用户敏感信息 |
| | | JSONObject result = qywxInnerService.getOauthUser(code); |
| | | //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 |
| | | return R.ok(tokenService.createQwH5Token(qwH5LoginVo)); |
| | | } |
| | | |
| | | @GetMapping("/h5/oauthUser") |
| | | @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); |
| | | QwUserDetailDto qwUserDetail = new QwUserDetailDto(); |
| | | qwUserDetail.setMobile("13882237106"); |
| | | // 1、查数据库获取人员 |
| | | QwH5LoginVo qwH5LoginVo = sysLoginService.qwH5StaffLogin(qwUserDetail); |
| | | // 2、生成Token |
| | | return R.ok(tokenService.createQwH5Token(qwH5LoginVo)); |
| | | } |
| | | |
| | | @GetMapping("/h5/getAgentConfig") |
| | | @ApiOperation("通过code获取访问用户登录") |
| | | public R<AgentConfigVo> getAgentConfig(@ApiParam(value = "url", required = true) String url, @ApiParam(value = "type", required = false) String type) throws IOException { |