Commit 4c5c7ff2 by songbingqi

修改接口loading传参方式

parent 7f90dec7
...@@ -25,7 +25,8 @@ module.exports = (vm) => { ...@@ -25,7 +25,8 @@ module.exports = (vm) => {
// 请求拦截 // 请求拦截
uni.$u.http.interceptors.request.use( uni.$u.http.interceptors.request.use(
(config) => { (config) => {
const {noLoading = false} = config.params console.log(config)
const {noLoading = false} = config.custom
// 可使用async await 做异步操作 // 可使用async await 做异步操作
if(!noLoading){ if(!noLoading){
uni.showLoading({ uni.showLoading({
......
...@@ -2,7 +2,8 @@ export default { ...@@ -2,7 +2,8 @@ export default {
getMyOrder() { getMyOrder() {
return uni.$u.http return uni.$u.http
.get('/app/getMyOrder', { .get('/app/getMyOrder', {
params: {noLoading:true}, params: {},
custom: {noLoading: true},
}) })
.then((res) => res) .then((res) => res)
.catch((err) => { .catch((err) => {
...@@ -68,7 +69,8 @@ export default { ...@@ -68,7 +69,8 @@ export default {
getHomeOrder(params) { getHomeOrder(params) {
return uni.$u.http return uni.$u.http
.get(`/app/getHomeOrder?shopId=${params.shopId}`, { .get(`/app/getHomeOrder?shopId=${params.shopId}`, {
params: {noLoading:true}, params: {},
custom: {noLoading: true},
}) })
.then((res) => res) .then((res) => res)
.catch((err) => { .catch((err) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment