修改小数点问题

This commit is contained in:
2023-02-28 21:31:25 +08:00
parent a0b72a542a
commit 1371987bed
4 changed files with 6 additions and 15 deletions

View File

@@ -13,6 +13,7 @@ function buildURL(url, needToken) {
})
wx.showToast({
title: '请先登录',
icon: 'none',
mask: true,
duration: 2000
})
@@ -51,10 +52,8 @@ export function fetchPost(url, params, needToken, multiple) {
console.log(res);
if (response.statusCode == 200) {
if (res.err_code == 0) {
wx.hideLoading();
resolve(res);
} else {
wx.hideLoading();
wx.showToast({
title: res.data.err_msg,
icon: 'none',
@@ -63,7 +62,6 @@ export function fetchPost(url, params, needToken, multiple) {
reject(res);
}
} else {
wx.hideLoading();
wx.showToast({
title: '服务器异常',
icon: 'none',
@@ -74,7 +72,6 @@ export function fetchPost(url, params, needToken, multiple) {
},
fail: function(err) {
console.log(err);
wx.hideLoading();
wx.showToast({
title: '网络错误',
icon: 'none',
@@ -98,10 +95,8 @@ export function fetchPost(url, params, needToken, multiple) {
success: function(res) {
console.log("POST返回数据", url,res);
if (res.data.err_code == 0) {
wx.hideLoading();
resolve(res.data);
} else {
wx.hideLoading();
wx.showToast({
title: res.data.err_msg,
icon: 'none',
@@ -111,7 +106,6 @@ export function fetchPost(url, params, needToken, multiple) {
}
},
fail: function(res) {
wx.hideLoading();
wx.showToast({
title: '网络错误',
icon: 'none',
@@ -144,13 +138,11 @@ export function fetchGet(url, params, needToken) {
console.log("GET返回数据", url, res);
if (res.statusCode == 200) {
if (res.data.err_code == 0) {
wx.hideLoading();
resolve(res.data);
} else {
reject(res);
}
} else {
wx.hideLoading();
reject(res)
wx.showToast({
title: '服务器异常',
@@ -160,7 +152,6 @@ export function fetchGet(url, params, needToken) {
}
},
fail: function(res) {
wx.hideLoading();
reject(res)
wx.showToast({
title: '网络错误',