<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                一、服務端配置文件:application.yml ``` config: #應用id appId: #應用密鑰 appSecret: #服務地址 server-url: https://open.digitalcitizen.com.cn:7280/idauth ``` 二、接口代碼 接口controller類:com.nlp.ctids.controller.ValidateIdentityController 接口方法:com.nlp.ctids.controller.ValidateIdentityController#apply ``` @RequestMapping("/{method}/{authMode}") @ResponseBody public String apply(@PathVariable String method, @PathVariable String authMode, @RequestBody String jsonData, HttpServletRequest request) { String accessToken = tokenService.getAccessToken(); Map<String, String> headers = new HashMap<>(); headers.put("Authorization", accessToken); headers.put("appId", config.appId); String post = HttpUtil.post(config.serverUrl + "/validateIdentity/" + method + "/" + authMode, jsonData, headers); return post; } ``` 三、獲取token方法代碼 方法類:com.nlp.ctids.service.TokenService ``` public CommonResponse getAccessToken(String appId, String appSecret) { CommonResponse commonResponse = tokenMap.get(appId + appSecret); try { if (commonResponse != null) { Map<String, Object> data = (Map<String, Object>) commonResponse.getData(); Long expireTime = (Long) data.get("expireTime"); if (expireTime == null || expireTime < System.currentTimeMillis()) { commonResponse = null; } } } catch (Exception e) { commonResponse = null; } if (commonResponse != null) { return commonResponse; } Map<String, String> data = new HashMap<>(); data.put("appId", appId); data.put("appSecret", appSecret); String response = HttpUtil.post(config.serverUrl + "/auth/getCode", JSON.toJSONString(data), null); commonResponse = JSON.parseObject(response, CommonResponse.class); if ("0".equals(commonResponse.getCode())) { tokenMap.put(appId + appSecret, commonResponse); } return commonResponse; } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看