提交 54e01502 编写于 作者: Q qiang

Merge branch 'master' of https://github.com/zuluoaaa/uni-app into dev

# Conflicts:
#	src/platforms/app-plus/service/api/network/request.js
...@@ -16,7 +16,7 @@ const publishStateChange = res => { ...@@ -16,7 +16,7 @@ const publishStateChange = res => {
delete requestTasks[requestTaskId] delete requestTasks[requestTaskId]
} }
const cookiesPrase = header => { const cookiesParse = header => {
let cookiesStr = header['Set-Cookie'] || header['set-cookie'] let cookiesStr = header['Set-Cookie'] || header['set-cookie']
let cookiesArr = [] let cookiesArr = []
if (!cookiesStr) { if (!cookiesStr) {
...@@ -27,7 +27,7 @@ const cookiesPrase = header => { ...@@ -27,7 +27,7 @@ const cookiesPrase = header => {
} }
const handleCookiesArr = cookiesStr.split(';') const handleCookiesArr = cookiesStr.split(';')
for (let i = 0; i < handleCookiesArr.length; i++) { for (let i = 0; i < handleCookiesArr.length; i++) {
if (handleCookiesArr[i].indexOf('Expires=') !== -1) { if (handleCookiesArr[i].indexOf('Expires=') !== -1 || handleCookiesArr[i].indexOf('expires=') !== -1) {
cookiesArr.push(handleCookiesArr[i].replace(',', '')) cookiesArr.push(handleCookiesArr[i].replace(',', ''))
} else { } else {
cookiesArr.push(handleCookiesArr[i]) cookiesArr.push(handleCookiesArr[i])
...@@ -109,7 +109,7 @@ export function createRequestTaskById (requestTaskId, { ...@@ -109,7 +109,7 @@ export function createRequestTaskById (requestTaskId, {
ok, ok,
status, status,
data, data,
headers, headers,
errorMsg errorMsg
}) => { }) => {
if (aborted) { if (aborted) {
...@@ -126,12 +126,12 @@ export function createRequestTaskById (requestTaskId, { ...@@ -126,12 +126,12 @@ export function createRequestTaskById (requestTaskId, {
data: ok && responseType === 'arraybuffer' ? base64ToArrayBuffer(data) : data, data: ok && responseType === 'arraybuffer' ? base64ToArrayBuffer(data) : data,
statusCode, statusCode,
header: headers, header: headers,
cookies: cookiesPrase(headers) cookies: cookiesParse(headers)
}) })
} else { } else {
let errMsg = 'abort statusCode:' + statusCode let errMsg = 'abort statusCode:' + statusCode
if (errorMsg) { if (errorMsg) {
errMsg = errMsg + ' ' + errorMsg errMsg = errMsg + ' ' + errorMsg
} }
publishStateChange({ publishStateChange({
requestTaskId, requestTaskId,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册