Bladeren bron

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

pull/393/head
wanjing 10 maanden geleden
bovenliggende
commit
05496dbea3
2 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. +0
    -2
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/controller/WxController.java
  2. +2
    -0
      tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WxServiceImpl.java

+ 0
- 2
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/controller/WxController.java Bestand weergeven

@@ -22,14 +22,12 @@ public class WxController {
//根据code获取openId且判断用户是否授权
@GetMapping("/checkAuthorize/{code}")
public JsonResult checkAuthorize(@PathVariable("code") String code) {
log.info("进入获取openId接口");
return iWxService.checkAuthorize(code);
}

//根据code获取openId
@GetMapping("/getOpenId/{code}")
public JsonResult getOpenId(@PathVariable("code") String code) {
log.info("进入获取openId接口");
return iWxService.openId(code);
}


+ 2
- 0
tuoheng-service/tuoheng-miniprogram/src/main/java/com/tuoheng/miniprogram/service/impl/WxServiceImpl.java Bestand weergeven

@@ -52,6 +52,7 @@ public class WxServiceImpl implements IWxService {
private static long expiresTime;

public JsonResult checkAuthorize(String code) {
log.info("进入判断用户是否授权接口, code={}", code);
User user = CurrentUserUtil.getUserInfo();
String openidResult = GetOpenIdUtil.getopenid(code, CommonConfig.appId, CommonConfig.appSecret);
if (null != JSONObject.parseObject(openidResult).getInteger("errcode") || StringUtils.isNotEmpty(JSONObject.parseObject(openidResult).getString("errmsg"))) {
@@ -86,6 +87,7 @@ public class WxServiceImpl implements IWxService {
*/
@Override
public JsonResult openId(String code) {
log.info("进入获取openId接口, code={}", code);
if (StringUtils.isEmpty(code)) {
log.info("code为空");
return JsonResult.error("code为空");

Laden…
Annuleren
Opslaan