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

                在使用nuxt配置好的axios的時候,我在提交base64保存圖片 和 百度編輯器提交數據的時候發現 會被轉譯成其他字符串,導致圖片和文章不能使用。經過層層排查才發現是nuxt自帶的axios導致的問題。 解決方案如下: 1、在plugins創建axioss.js 文件名自己取 2、axioss.js接口配置如下,并配置請求頭。 ``` import?$http?from'axios' //?請求攔截??設置統一header $http.interceptors.request.use(config?=>?{ if?(localStorage.jwtToken) ????????config.headers.Authorization?=?localStorage.jwtToken return?config },?error?=>?{ returnPromise.reject(error) }) exportdefault?{ //獲取個人的簡歷詳情 ????profile(params)?{ returnnewPromise(resolve?=>?{ ????????????$http.get('/api/profile',?params).then(data?=>?{ ????????????????resolve(data) ????????????}) ????????}) ????}, //添加文章 ????articleAdd(params)?{ returnnewPromise(resolve?=>?{ ????????????$http.post('/api/ideas/add',?params).then(data?=>?{ ????????????????resolve(data) ????????????}) ????????}) ????}, } ``` 3、引入使用 import?axioss?from'~/plugins/axioss' ``` ?async?submit()?{ ????????????const?user?=?this.$store.getters.user; ????????????const?newPost?=?{ ????????????????title:?this.title, ????????????????subjectId:this.subjradio, ????????????????description:this.description, ????????????????details:this.$refs.ue2.getContent(), ????????????????name:?user.name, ????????????????imgs:this.imgs, ????????????????checkT:this.oks ????????????}; ??const?res?=?await?axioss.articleAdd(newPost) if(res.data.code==1000){ this.$message({ ????????????????????message:?res.data.msg, ????????????????????type:?'success' ????????????????}); this.$router.push({ ????????????????????path:'/users/artlist' ????????????????}) ????????????}elseif(res.data.code==400){ ????????????????alert(res.data.msg) ????????????} ????????} ``` 問題雖小,但是一旦找不到問題所在 會花很多時間,少走彎路
                  <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>

                              哎呀哎呀视频在线观看