|
|
@ -1,7 +1,7 @@ |
|
|
import { useUserStore } from "../stores/modules/userInfo" |
|
|
import { useUserStore } from "../stores/modules/userInfo" |
|
|
import { useDeviceStore } from "../stores/modules/deviceInfo" |
|
|
import { useDeviceStore } from "../stores/modules/deviceInfo" |
|
|
|
|
|
|
|
|
const baseURL = "https://hwjb.homilychart.com/testApi" |
|
|
|
|
|
|
|
|
const baseURL = "https://dbqb.nfdxy.net/testApi" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const httpInterceptor = { |
|
|
const httpInterceptor = { |
|
|
@ -22,7 +22,7 @@ const httpInterceptor = { |
|
|
// 打印最终请求地址
|
|
|
// 打印最终请求地址
|
|
|
console.log('HTTP(finalUrl)=', options.url) |
|
|
console.log('HTTP(finalUrl)=', options.url) |
|
|
// 2.请求超时,默认60s
|
|
|
// 2.请求超时,默认60s
|
|
|
options.timeout = 60000 |
|
|
|
|
|
|
|
|
options.timeout = 10000 |
|
|
console.log(options) |
|
|
console.log(options) |
|
|
//3 添加小程序端请求头
|
|
|
//3 添加小程序端请求头
|
|
|
const sys = uni.getSystemInfoSync(); |
|
|
const sys = uni.getSystemInfoSync(); |
|
|
@ -91,7 +91,7 @@ export const http = (options) => { |
|
|
fail: (err) => { |
|
|
fail: (err) => { |
|
|
reject(err) |
|
|
reject(err) |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: '网络错误', |
|
|
|
|
|
|
|
|
title: '请求超时', |
|
|
icon: 'none' |
|
|
icon: 'none' |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|