<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                # 請求地址 `https://www.lkdzs.cn/api/cet/query` # 請求方式 `get / post` # 請求參數 |參數|必填|說明| |-|-|-| |id|是|準考證號| |name|是|姓名| # 在線調試 ~~~[api] get:/api/cet/query *string:id=準考證號#必填 *string:name=姓名#必填 <<< success { "code": 100, "msg": "success", "date": {} } <<< error { "code": 105, "msg": "error" } ~~~ # 狀態碼 |代碼|消息|備注 |-|-|- |100|success|查詢成功 |101|missing id|缺少id |102|missing name|缺少name |103|timeout|連接超時 |104|fail|查詢失敗 |105|error|錯誤 # 源代碼 ~~~ public function query() { // 接收數據 $id = input('id'); $name = urlencode(input('name')); if (empty($id)) { return json([ 'code' => 101, 'msg' => 'missing id', ]); } if (empty($name)) { return json([ 'code' => 102, 'msg' => 'missing name', ]); } // 請求地址 $url = "http://cache.neea.edu.cn/cet/query?data=CET4_203_DANGCI,{$id},{$name}"; // 初始化CURL $ch = curl_init($url); // 設置返回轉移,存儲返回結果 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // 必選,設置來源,否則請求失敗 curl_setopt($ch, CURLOPT_REFERER, 'ttp://cet.neea.edu.cn/'); // 執行抓取操作 $data = curl_exec($ch); // 判斷是否連接超時 if ($data === false) { return json([ 'code' => '103', 'msg' => 'timeout', ]); } // 替換字符串 $replaceStr = [ "result.callback({", "});", "'", ]; $data = str_replace($replaceStr, "", $data); // 分割字符串 $data = explode(',', $data); // 保存數據 $map = array(); if (count($data) > 0) { foreach ($data as $item) { // 拆分鍵值對 $temp = explode(':', $item); $map[$temp[0]] = $temp[1]; } if (empty($map['error'])) { return json([ 'code' => 100, 'msg' => 'success', 'data' => $map, ]); } return json([ 'code' => 104, 'msg' => 'error', 'data' => $map, ]); } return json([ 'code' => 105, 'msg' => 'fail', ]); } ~~~
                  <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>

                              哎呀哎呀视频在线观看