wx.pageScrollTo({ scrollTop: 0, // 滚动到页面的顶部位置 });
onShareAppMessage: function () { let that = this return { title: that.data.share.title, path: '/pages/index/index', imageUrl: that.data.share.photo } },
一、标准说法
标准是首字母大写的,X-Your-Custom-Header
不区分大小写
二、微信小程序中
如以下文件上传的请求,Header 中 定义了 accessKey 参数。
wx.uploadFile({
url: url,
filePath: path,
header: {
accessKey : "123456"
},
name: '',
success: function (resu) {
console.log(resu);
},
fail: function (err) {
console.log(err);
}
})
这个 Header 中的 accessKey 在开发环境是不会做改变的,服务器接收到的还是 accessKey,但是在真机环境下就不一样的,会变成 accesskey,全部小写了。当使用 actionContext.Request.Headers 的 Key = 来取时,问题就来了。
使用 HttpContext.Current.Request["accessKey"] 则没问题,应该是它大小写无关的原因。