![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue
仰望星空下的自己
PHP开发疯狂进阶中
展开
-
vue+ts 封装axios网络请求封装
request.ts 文件 import axios from 'axios'; import router from '@/router'; import StatusInit from '@/utils/status/StatusInit' // 状态码的策略模式 const CancelToken: any = axios.CancelToken; // axios 的取消请求 let token = localStorage.getItem('token'); const service =原创 2020-11-02 22:48:48 · 3635 阅读 · 7 评论 -
vuejs封装网络请求
vue + axios 网络请求封装 import axios from 'axios' // axios import router from '../src/router' import {Message, LoadingBar, Spin} from 'view-design' // 第三方插件框架 需要自己安装 iview import qs from 'qs' // post请求需要使用该插件 npm install qs // 加载对象 let loading //当前正在请求的数量 let原创 2020-11-02 22:39:03 · 701 阅读 · 0 评论 -
axios 发送post请求ssm框架无法接受请求参数问题的解决
该问题可以通过修改header头和修改请求参数解决。 let header = { 'Content-Type': 'application/json;charset=UTF-8' } if (config.method === 'post') { header['Content-Type'] = 'application/x-www-form-urlencoded' ...原创 2020-04-03 15:36:18 · 574 阅读 · 0 评论 -
记录一次Vue + axios拦截器的问题
记录一次Vue+axios登录拦截器的问题,最近在写Vue的登录拦截器,出现一些问题,在error中使用iview的Message消息提醒时一直出现问题,但是没有报错信息,(没有报错信息最致命的问题),后来try cache后发现是this的问题。 使用了N中方法解决this的指向问题,一直没有解决,后来想到使用js的原型链的方式,没想到解决了 axios.interceptors.respons...原创 2019-07-27 10:58:17 · 277 阅读 · 0 评论