t
This commit is contained in:
@@ -5,17 +5,20 @@ export default (options = {}) => {
|
||||
if (options.data == undefined) {
|
||||
options.data = {}
|
||||
}
|
||||
options.debounce = options.debounce === undefined ? true : options.debounce
|
||||
// 防止接口重复点击
|
||||
if (arr.indexOf(options.url) === -1) {
|
||||
arr.push(options.url)
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
reject({
|
||||
code: -1,
|
||||
msg: '请勿重复提交',
|
||||
data:options.url
|
||||
if (options.debounce) {
|
||||
if (arr.indexOf(options.url) === -1) {
|
||||
arr.push(options.url)
|
||||
} else {
|
||||
return new Promise((resolve, reject) => {
|
||||
reject({
|
||||
code: -1,
|
||||
msg: '请勿重复提交',
|
||||
data: options.url,
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
return new Promise((reslove, reject) => {
|
||||
let url = options.url.indexOf('http') === -1 ? config.domain + options.url : options.url
|
||||
@@ -70,7 +73,7 @@ export default (options = {}) => {
|
||||
* @param {Number} code 错误码
|
||||
*/
|
||||
function errHandler(res) {
|
||||
console.log(res);
|
||||
console.log(res)
|
||||
switch (res.code) {
|
||||
case 'A0024':
|
||||
uni.reLaunch({ url: '/pages/user/login' })
|
||||
|
||||
Reference in New Issue
Block a user