Skip to content

Commit 1904dd7

Browse files
committed
fix(index): 优化微信下载链接获取
- 添加 useHighPerformanceMode 以提高请求性能 - 增加对大小写不敏感的 Location 头处理
1 parent 8d8b11d commit 1904dd7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

source/pages/index/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1636,6 +1636,7 @@ Page({
16361636
wx.request({
16371637
url: `https://z.weixin.qq.com/android/download?channel=latest`,
16381638
method: 'GET',
1639+
useHighPerformanceMode: true,
16391640
redirect: 'manual',
16401641
fail: (err) => {
16411642
this.showErrPopup(err)
@@ -1646,7 +1647,9 @@ Page({
16461647
})
16471648
}
16481649
}).onHeadersReceived(res => {
1649-
const url = res.header.Location;
1650+
const urlPre = res.header.location;
1651+
const urlPre2 = res.header.Location;
1652+
const url = urlPre || urlPre2;
16501653
this.fetchLink(url).then(isSuccess => {
16511654
if (isSuccess.exists && isSuccess.fileSize !== false) this.setData({
16521655
successExpBackLink: url,

0 commit comments

Comments
 (0)