feat:node-modules
This commit is contained in:
21
node_modules/luch-request/LICENSE.txt
generated
vendored
Normal file
21
node_modules/luch-request/LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) [2022] [luch]
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
81
node_modules/luch-request/history.md
generated
vendored
Normal file
81
node_modules/luch-request/history.md
generated
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
## [3.1.0](https://github.com/lei-mu/luch-request/compare/3.0.8...3.1.0) (2023-05-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 更新请求新配置项。新增‘是否尝试将响应数据json化’配置项。 ([68344a1](https://github.com/lei-mu/luch-request/commit/68344a1d9dcbf586d4a0aff37d02aa0bb27ff45c)), closes [#113](https://github.com/lei-mu/luch-request/issues/113)
|
||||
* 增加`version` 属性,获取插件版本号 ([40403d2](https://github.com/lei-mu/luch-request/commit/40403d2ef57dead0f577a384ac686cc7dcc772da))
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.0.8](https://github.com/lei-mu/luch-request/compare/3.0.7...3.0.8) (2022-08-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `put` 方法增加快手小程序和京东小程序的支持 ([7e15dff](https://github.com/lei-mu/luch-request/commit/7e15dff0ac343ccbd6a298c7c9ae8ef0e2148eb9))
|
||||
* 参考axio源代码 添加支持paramsSerializer。 ([cae1043](https://github.com/lei-mu/luch-request/commit/cae10430dc7222d85e0cadb13512898d66998547))
|
||||
* 返回数据增加`rawData`,保留返回的原始数据 ([3924b7c](https://github.com/lei-mu/luch-request/commit/3924b7c3ea444526be436a31f9e7d5623749580b))
|
||||
* 局部请求配置支持baseURL ([df2d98f](https://github.com/lei-mu/luch-request/commit/df2d98fc063f356ffd525158e9cd47d7eb24f68f))
|
||||
|
||||
|
||||
|
||||
|
||||
## 3.0.7 (2021-09-04)
|
||||
|
||||
1. Bug Fix: 修复通过 `Request.config` 设置全局参数,多个实例`config`存在共同引用bug
|
||||
|
||||
|
||||
## 3.0.6 (2021-05-10)
|
||||
|
||||
1. New Feature: APP端 增加`responseType`配置项
|
||||
|
||||
## 3.0.5 (2021-01-10)
|
||||
### Features
|
||||
|
||||
* [重要] APP不再支持`CONNECT`、`HEAD`、`TRACE`请求方式。[uni.request](https://uniapp.dcloud.io/api/request/request)
|
||||
* [重要]全局默认`timeout`由`30000`ms,改为`60000`ms
|
||||
* [重要]增加`index.d.ts`文件支持。感谢`Mr_Mao`的支持。github:`https://github.com/TuiMao233`
|
||||
* [重要]网络请求相关接口 uni.request、uni.uploadFile、uni.downloadFile 支持 timeout 参数。
|
||||
* [重要]返回结果response 增加`fullPath`参数。
|
||||
|
||||
## 3.0.4 (2020-07-05)
|
||||
|
||||
1. New Feature: request 方法增加 ` firstIpv4 `配置项
|
||||
1. New Feature: 增加 ` middleware `通用请求方法
|
||||
|
||||
## 3.0.3 (2020-06-16)
|
||||
|
||||
1. Bug Fix: 修复` params ` 选项对数组格式化错误bug
|
||||
|
||||
## 3.0.2 (2020-06-04)
|
||||
|
||||
1. Bug Fix: 修复文件上传和request 配置缺少字段bug
|
||||
|
||||
## 3.0.1 (2020-06-02)
|
||||
|
||||
1. Bug Fix: 请求方式都为` GET `的bug
|
||||
|
||||
## 3.0.0 (2020-06-01)
|
||||
|
||||
1. New Feature: 支持多拦截器
|
||||
1. New Feature: 支持局部配置自定义验证器
|
||||
|
||||
## 2.0.1 (2020-05-01)
|
||||
|
||||
1. Bug Fix: 修复多实例全局配置共用问题
|
||||
|
||||
## 2.0.0 (2020-04-24)
|
||||
|
||||
1. New Feature: 增加 request ` withCredentials `选项(仅h5端支持)
|
||||
1. New Feature: h5端 upload 增加 ` files ` ` file `选项。[uni.uploadFile](https://uniapp.dcloud.io/api/request/network-file?id=uploadfile "uni.uploadFile")
|
||||
1. Enhancement: ` params ` 选项参数格式化方法使用axios 格式化方法
|
||||
1. Bug Fix: 对upload 返回data 为空字符串的情况容错
|
||||
1. Change: 修改header与全局合并方式。当前:header = Object.assign(全局,局部)
|
||||
|
||||
## 0.0.0 (2019-05)
|
||||
|
||||
1. luch-request created
|
||||
|
||||
|
||||
109
node_modules/luch-request/package.json
generated
vendored
Normal file
109
node_modules/luch-request/package.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
263
node_modules/luch-request/readme.md
generated
vendored
Normal file
263
node_modules/luch-request/readme.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
132
node_modules/luch-request/src/lib/adapters/index.js
generated
vendored
Normal file
132
node_modules/luch-request/src/lib/adapters/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
51
node_modules/luch-request/src/lib/core/InterceptorManager.js
generated
vendored
Normal file
51
node_modules/luch-request/src/lib/core/InterceptorManager.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
'use strict'
|
||||
|
||||
|
||||
function InterceptorManager() {
|
||||
this.handlers = []
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new interceptor to the stack
|
||||
*
|
||||
* @param {Function} fulfilled The function to handle `then` for a `Promise`
|
||||
* @param {Function} rejected The function to handle `reject` for a `Promise`
|
||||
*
|
||||
* @return {Number} An ID used to remove interceptor later
|
||||
*/
|
||||
InterceptorManager.prototype.use = function use(fulfilled, rejected) {
|
||||
this.handlers.push({
|
||||
fulfilled: fulfilled,
|
||||
rejected: rejected
|
||||
})
|
||||
return this.handlers.length - 1
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove an interceptor from the stack
|
||||
*
|
||||
* @param {Number} id The ID that was returned by `use`
|
||||
*/
|
||||
InterceptorManager.prototype.eject = function eject(id) {
|
||||
if (this.handlers[id]) {
|
||||
this.handlers[id] = null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Iterate over all the registered interceptors
|
||||
*
|
||||
* This method is particularly useful for skipping over any
|
||||
* interceptors that may have become `null` calling `eject`.
|
||||
*
|
||||
* @param {Function} fn The function to call for each interceptor
|
||||
*/
|
||||
InterceptorManager.prototype.forEach = function forEach(fn) {
|
||||
this.handlers.forEach(h => {
|
||||
if (h !== null) {
|
||||
fn(h)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export default InterceptorManager
|
||||
201
node_modules/luch-request/src/lib/core/Request.js
generated
vendored
Normal file
201
node_modules/luch-request/src/lib/core/Request.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
20
node_modules/luch-request/src/lib/core/buildFullPath.js
generated
vendored
Normal file
20
node_modules/luch-request/src/lib/core/buildFullPath.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
'use strict'
|
||||
|
||||
import isAbsoluteURL from '../helpers/isAbsoluteURL'
|
||||
import combineURLs from '../helpers/combineURLs'
|
||||
|
||||
/**
|
||||
* Creates a new URL by combining the baseURL with the requestedURL,
|
||||
* only when the requestedURL is not already an absolute URL.
|
||||
* If the requestURL is absolute, this function returns the requestedURL untouched.
|
||||
*
|
||||
* @param {string} baseURL The base URL
|
||||
* @param {string} requestedURL Absolute or relative URL to combine
|
||||
* @returns {string} The combined full path
|
||||
*/
|
||||
export default function buildFullPath(baseURL, requestedURL) {
|
||||
if (baseURL && !isAbsoluteURL(requestedURL)) {
|
||||
return combineURLs(baseURL, requestedURL)
|
||||
}
|
||||
return requestedURL
|
||||
}
|
||||
33
node_modules/luch-request/src/lib/core/defaults.js
generated
vendored
Normal file
33
node_modules/luch-request/src/lib/core/defaults.js
generated
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* 默认的全局配置
|
||||
*/
|
||||
|
||||
|
||||
export default {
|
||||
baseURL: '',
|
||||
header: {},
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
paramsSerializer: null,
|
||||
// #ifndef MP-ALIPAY
|
||||
responseType: 'text',
|
||||
// #endif
|
||||
custom: {},
|
||||
// #ifdef H5 || APP-PLUS || MP-WEIXIN || MP-ALIPAY || MP-TOUTIAO || MP-KUAISHOU
|
||||
timeout: 60000,
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
sslVerify: true,
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
withCredentials: false,
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
firstIpv4: false,
|
||||
// #endif
|
||||
validateStatus: function validateStatus(status) {
|
||||
return status >= 200 && status < 300
|
||||
},
|
||||
// 是否尝试将响应数据json化
|
||||
forcedJSONParsing: true
|
||||
}
|
||||
6
node_modules/luch-request/src/lib/core/dispatchRequest.js
generated
vendored
Normal file
6
node_modules/luch-request/src/lib/core/dispatchRequest.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import adapter from '../adapters/index'
|
||||
|
||||
|
||||
export default (config) => {
|
||||
return adapter(config)
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user