fix: 关闭接口请求loading...

This commit is contained in:
yangzhe 2025-07-15 11:53:04 +08:00
parent c27caa607e
commit 5851a70aae
3 changed files with 7 additions and 5 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
# 忽略 unpackage 文件夹
/unpackage/

View File

@ -33,9 +33,9 @@ const install = (Vue, vm) => {
// config.header.token = token;
// 注释 7/15
uni.showLoading({
title: '请求中...'
});
// uni.showLoading({
// title: '请求中...'
// });
// 注释
// setTimeout(function () {
@ -46,7 +46,7 @@ const install = (Vue, vm) => {
}
// 响应拦截,判断状态码是否通过
Vue.prototype.$u.http.interceptor.response = (res) => {
uni.hideLoading();
// uni.hideLoading();
// 检查是否为401未授权错误
if (res.statusCode === 401) {

View File

@ -109,7 +109,7 @@ class Request {
dataType: 'json',
// 此参数无需处理因为5+和支付宝小程序不支持默认为text即可
responseType: 'text',
showLoading: true, // 是否显示请求中的loading
showLoading: false, // 是否显示请求中的loading
loadingText: '请求中...',
loadingTime: 800, // 在此时间内请求还没回来的话就显示加载中动画单位ms
timer: null, // 定时器