|
@@ -2,11 +2,12 @@ import util from './util.js'
|
|
|
class request {
|
|
|
|
|
|
//本地的
|
|
|
- static BASE_URL = 'http://localhost:8014/'
|
|
|
+ static BASE_URL = 'http://localhost:8014/'
|
|
|
// pre环境的
|
|
|
// static BASE_URL = 'https://oapi.shpr.top/'
|
|
|
// 正式的
|
|
|
- // static BASE_URL = 'https://vapi.hsayi.com/'
|
|
|
+// static BASE_URL = 'https://vapi.hsayi.com/'
|
|
|
+
|
|
|
// @todo需要修改正式的域名
|
|
|
|
|
|
static HEAD = {
|
|
@@ -37,9 +38,9 @@ class request {
|
|
|
/**
|
|
|
* POST类型的网络请求
|
|
|
*/
|
|
|
- static postRequest(url, data) {
|
|
|
+ static postRequest(url, data, notUseLoading) {
|
|
|
let headerSign = this.getSignHead();
|
|
|
- return this.requestAll(url, data, headerSign, 'POST')
|
|
|
+ return this.requestAll(url, data, headerSign, 'POST', notUeLoading)
|
|
|
}
|
|
|
|
|
|
static upload(url, name, path, ortherData, header = this.HEAD){
|
|
@@ -93,12 +94,15 @@ class request {
|
|
|
}
|
|
|
return signHeadInfo;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 网络请求
|
|
|
*/
|
|
|
- static requestAll(url, data, header, method) {
|
|
|
-
|
|
|
- wx.showLoading()
|
|
|
+ static requestAll(url, data, header, method, notUseLoading) {
|
|
|
+ if (!notUseLoading) {
|
|
|
+ wx.showLoading()
|
|
|
+ }
|
|
|
return new Promise((resolve, reject) => {
|
|
|
wx.request({
|
|
|
url: url,
|
|
@@ -113,6 +117,7 @@ class request {
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: res?.data?.msg,
|
|
|
+ icon: "none"
|
|
|
})
|
|
|
//其它错误,提示用户错误信息
|
|
|
if (this._errorHandler != null) {
|