Quellcode durchsuchen

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

pull/393/head
wanjing vor 10 Monaten
Ursprung
Commit
05496dbea3
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  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 Datei anzeigen

@@ -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 Datei anzeigen

@@ -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…
Abbrechen
Speichern