Comments (6)
common
字段已经被默认配置占用了,这里的实现和 axios
是一致的。
全局设置可以
axios.defaults.headers.common['common'] = '你的属性';
// 或者给方法设置
axios.defaults.headers.get['common'] = '你的属性';
axios.defaults.headers.post['common'] = '你的属性';
局部设置可以
axios.get(
'url',
{},
{
headers: {
get: {
common: '你的属性',
},
},
},
);
axios.post(
'url',
{},
{
headers: {
post: {
common: '你的属性',
},
},
},
);
建议在条件允许的情况下,优先考虑换个其他的名称。
from axios-miniprogram.
我在拦截器中,增加header值,2.3.0中 request header 中是包含这些值的,但是在2.3.1中,request header 里面没有这些值,我看了下代码,感觉这里有点奇怪。没明白为啥要delete config.headers。
感谢。
from axios-miniprogram.
意思是说红框中的设置在 2.3.1 中丢失了吗?
from axios-miniprogram.
是的
from axios-miniprogram.
2.3.2 已经修复
from axios-miniprogram.
已测试,OK了,感谢。
from axios-miniprogram.
Related Issues (20)
- 请求url的端口号被替换为undefined HOT 4
- 小程序中无法使用,还是我接入方式不正确 HOT 2
- 是否支持 uni-app vue3 cli模式 HOT 1
- 请问支持快手小程序吗, 只需要get和post HOT 2
- 不能在axios的config中增加自定义字段 HOT 1
- 请问支持uniapp 打包成安卓app吗? HOT 1
- uni-app 即将不再内部支持!
- 不要去掉url的斜线 HOT 4
- 钉钉小程序中真机预览报无权跨域调用 HOT 3
- AxiosResponseData默认应该是any才对吧 HOT 2
- 当上下顺序发送请求后,配置中的数据相同 HOT 1
- post 无法使用formData入参 HOT 5
- 上传文件名为中文时后端怎么还原? HOT 10
- 能否支持最新的axios HOT 3
- 小程序导入 执行完npm 构建 一直提示这个,Error: module 'xxx/xxx/axios-miniprogram.js' is not defined, require args is 'axios-miniprogram' HOT 5
- 文件上传乱码与返回格式问题 HOT 2
- 请求拦截器中,修改header会导致全局变化 HOT 1
- 原生微信小程序 解决 module 'utils/axios-miniprogram.js' is not defined, require args is 'axios-miniprogram' HOT 1
- uniapp h5 打包以后无法请求
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from axios-miniprogram.