<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、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                // src/utils/token.js ~~~ // cookie保存token import Cookies from 'js-cookie' const TokenKey = 'DME-Token' export function getToken() { return Cookies.get(TokenKey) } export function setToken(token) { // 過期時間為1天 return Cookies.set(TokenKey, token, { expires: 1 }) } export function removeToken() { return Cookies.remove(TokenKey) } ~~~ //httprequest ~~~ /* * @Date: 2018-11-23 * @Description: 構造axios實例類 */ import axios from 'axios' // import store from '@/store' // import { getToken } from '@/utils/token' /** * @class HttpRequest * @param {Object} options { BASEURL, TIMEOUT } * @description 基于axios二次封裝類,提供給不同地址實例使用 * 目前有三個實例(基礎,dataeye,mock),共用一種攔截器 */ export default class HttpRequest { constructor({ BASEURL, TIMEOUT = 10000 }) { this.config = { baseURL: BASEURL, timeout: TIMEOUT } this.instance = axios.create(this.config) // 安裝攔截器 this.interceptors() return this.instance } // 攔截器 interceptors() { // 請求攔截 // this.instance.interceptors.request.use( // config => { // // 判斷vuex中是否存在token // if (store.getters.token) { // // 請求頭攜帶token // config.headers['DME-Token'] = getToken() // } // return config // }, // error => Promise.reject(error) // 請求失敗 // ) // 響應攔截 this.instance.interceptors.response.use( response => { const { status, data } = response // 需要和后端約定狀態碼 if (status === 200) { if (data.code === 2000 || data.code === 3000) { console.log(response) return Promise.reject(response) } return Promise.resolve(data) } console.log(response) return Promise.reject(response) }, error => { console.log(error) Promise.reject(error) } ) } getInstance() { return this.instance } } ~~~
                  <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>

                              哎呀哎呀视频在线观看