<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、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ` ~~~ <?php // +---------------------------------------------------------------------- // | Created by PHPstorm: JRKAdmin框架 [ JRKAdmin ] // +---------------------------------------------------------------------- // | Copyright (c) 2019~2022 [LuckyHHY] All rights reserved. // +---------------------------------------------------------------------- // | SiteUrl: http://www.luckyhhy.cn // +---------------------------------------------------------------------- // | Author: LuckyHhy <jackhhy520@qq.com> // +---------------------------------------------------------------------- // | Date: 2020/3/12-10:04 // +---------------------------------------------------------------------- // | Description: // +---------------------------------------------------------------------- use \Firebase\JWT\JWT; use think\facade\Log; const ERRNO_MAP = [ 'OK' => '成功', 'DBERR' => '數據庫查詢錯誤', 'NODATA' => '無數據', 'DATAEXIST' => '數據已存在', 'DATAERR' => '數據錯誤', 'SESSIONERR' => '用戶未登錄', 'LOGINERR' => '用戶登錄失敗', 'PARAMERR' => '參數錯誤', 'USERERR' => '用戶不存在或未激活', 'ROLEERR' => '用戶身份錯誤', 'PWDERR' => '密碼錯誤', 'REQERR' => '非法請求或請求次數受限', 'IPERR' => 'IP受限', 'THIRDERR' => '第三方系統錯誤', 'IOERR' => '文件讀寫錯誤', 'SERVERERR' => '內部錯誤', 'UNKOWNERR' => '未知錯誤', ]; const ERRNO = [ 'OK' => '0', 'DBERR' => '4001', 'NODATA' => '4002', 'DATAEXIST' => '4003', 'DATAERR' => '4004', 'SESSIONERR' => '4101', 'LOGINERR' => '4102', 'PARAMERR' => '4103', 'USERERR' => '4104', 'ROLEERR' => '4105', 'PWDERR' => '4106', 'REQERR' => '4201', 'IPERR' => '4202', 'THIRDERR' => '4301', 'IOERR' => '4302', 'SERVERERR' => '4500', 'UNKOWNERR' => '4501', ]; /** * @return \think\response\Json * @throws Exception * @author: LuckyHhy <jackhhy520@qq.com> * @date: 2020/3/12 * @name: ajaxReturn * @describe:向前端返回JSON數據 */ function ajaxReturn() { // 形參個數 $args_num = func_num_args(); // 形參列表 $args = func_get_args(); if (1 === $args_num) { return json([ 'errno' => ERRNO['OK'], 'msg' => '成功', 'data' => $args[0]]); } if (2 === $args_num) { return json([ 'errno' => $args[0], 'msg' => $args[1]]); } if (3 === $args_num) { return json([ 'errno' => $args[0], 'msg' => $args[1], 'data' => $args[2]]); } throw new Exception("Error The number of parameters can be one or two or three"); } /** * @param $data * @return JWT|string * @author: LuckyHhy <jackhhy520@qq.com> * @date: 2020/3/12 * @name: setJWT * @describe:設置JWT */ function setJWT($data) { $jwt = new JWT(); $token = array( // "iss" => "http://example.org", // 簽發者 // "aud" => "http://example.com", // 認證者 'iat' => time(), // 簽發時間 'nbf' => time(), // 生效時間 'exp' => (time() + 60 * 60 * 24 * 7), // 過期時間 7天后的時間戳 'data' => $data, ); $jwt = $jwt::encode($token, \config('jwt_key'), 'HS256'); return $jwt; } /** * @param $token * @return array|null * @author: LuckyHhy <jackhhy520@qq.com> * @date: 2020/3/12 * @name: getJWT * @describe:獲取JWT內容 */ function getJWT($token) { $jwt = new JWT(); $data = null; try { $jwt_data = $jwt::decode($token, \config('jwt_key'), array('HS256')); $data = (array) ($jwt_data->data); } catch (\Throwable $e) { Log::write($e->getMessage(), 'error'); return null; } return $data; } ~~~ `
                  <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>

                              哎呀哎呀视频在线观看