axios

    0热度

    1回答

    我在javascript中很弱,但我想我明白发生了什么问题。只是不够流畅,无法知道如何修复它,甚至不知道如何正确编写它。我有一个VueJS应用程序,它向access_token的API发送请求。当access_token到期时,它会向API发送refresh_token,并获取新的access_token。我希望它能够在它过期时重新运行正在运行的请求。使用下面的代码我会得到奇怪的行为。当它遇到40

    0热度

    1回答

    我试图单元测试一个脚本,它将部分依赖从axios.get()请求返回给外部资源的数据。 一个测试功能我目前看起来是这样的: export function getFeedData (sub) { if (getFeedId(sub) === 2) { return axios.get('/src/mocks/MockData.json').then((data) => JSO

    1热度

    1回答

    我不确定什么时候我的data.json返回奇怪的文本时,我叫它什么是错的。 axios.get('./data.json').then(resp => { console.log(resp) console.log(resp.data) }) 试过JSON.parse(resp)它似乎不工作。 https://codesandbox.io/s/306ynznk

    1热度

    2回答

    我想上传一个文本文件到我的django后端,但我的request.FILES始终是空的。 我正在使用axios发送文件并按照django的要求将'multipart/form-data'作为请求的内容类型。 我缺少什么? new Vue({ el: '#app', data: { reqtype: '', uploadedFile: '', }

    0热度

    2回答

    这是我的登录页面: class Login extends Component { /*define constructor for state props*/ constructor() { super(); this.state = { email: '', password: '' }; this.ha

    4热度

    3回答

    我想将道具从父组件传递给子组件。我的道具是tid。 这是父组件: <div id="tracksec" class="panel-collapse collapse"> <library :tid="track.category_id"></library> </div> 这是子组件: <script> import Chapter from "./chapter"; impo

    1热度

    1回答

    我的应用程序中有很多AJAX请求,我想为每个请求显示加载图标,并在收到响应时将其删除。我为这些调用使用axios,所以我创建了一个简单的插件类并添加了定制的axios拦截器。 const MyGlobalVariables= { install(Vue, options) { Vue.load_mask = true; MyGlobalVariables.getL

    0热度

    1回答

    我对当前虚拟环境中运行gunicorn服务器上,使用下列.wsgi文件Django的REST服务: import os, sys import site site.addsitedir('/opt/valuation/env/lib/python2.7/site-packages') sys.stdout = sys.stderr os.environ['DJANGO_SETTINGS

    9热度

    1回答

    我已经创建了爱可信拦截器负责将令牌之前每个请求被发送到我的REST API。 import axios from 'axios'; import { store } from '../store/store'; export default function execute() { axios.interceptors.request.use(function(config) {

    0热度

    1回答

    我刚刚继承了一个项目,有点随意使用我不是很熟悉的工具建立。它使用Express,Bookshelf和Axios来访问MySQL数据库。 GET和PUT的快速路由似乎工作得很好,但POST和DELETE每个导致错误500. 这里是我使用的路由(我已经删除了更多的GET和POST路由, ): import express from 'express'; import Points from '../