zhanghua
2025-08-29 f316cadfdd20c70aeb35c12995c0069efcead2b6
ruoyi-admin/src/main/java/org/dromara/web/controller/AuthController.java
@@ -52,6 +52,7 @@
import org.dromara.web.service.SysLoginService;
import org.dromara.web.service.SysRegisterService;
import org.dromara.web.utils.RZTHttpUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.aliyun.teaopenapi.models.Config;
@@ -330,6 +331,7 @@
            log.info("code值:{}", code);
            String accessToken = getRztToken();
            log.info("accessToken值:{}", accessToken);
            if (StrUtil.isNotBlank(accessToken)) {
                Map<String, String> hashMap = new HashMap<>();
                hashMap.put("code", code);
@@ -350,13 +352,18 @@
        return "";
    }
    @Value("${rzt.corpId}")
    private String corpId;
    @Value("${rzt.corpSecret}")
    private String corpSecret;
    private String getRztToken() throws Exception {
        String token = RedisUtils.getCacheObject(redisKey);
        if (StrUtil.isEmpty(token)) {
            String corpId = "ww9904fd98c1b0df9e";
            String corpSecret = "mZdTP-ULDWHEPgFCpl62OwudbP3bODgqN9lC-rUtNSA";
            String accessJson = rzthttpUtils.sendGetRequest("/gettoken?corpId=" + corpId + "&corpsecret=" + corpSecret, null);
            log.info("getRztToken accessJson值:{}", accessJson);
            JSONObject jsonObject = JSON.parseObject(accessJson);
            if (jsonObject.getIntValue("errcode") == 0) {
                String accessToken = jsonObject.getString("access_token");