Browse Source

封装了接口打印

wangming 2 tháng trước cách đây
mục cha
commit
0c8c298e9b
1 tập tin đã thay đổi với 6 bổ sung4 xóa
  1. 6 4
      src/components/js_sdk/index.js

+ 6 - 4
src/components/js_sdk/index.js

@@ -19,6 +19,8 @@ http.setConfig(config => {
 });
 http.interceptor.request((config, cancel) => {
 
+    console.log(config.url, '调用了》》》接口')
+
     let containsUrl = ['wap/user/wx/loginByPhone', 'wap/user/loginWx']
     for (let i = 0; i < containsUrl.length; i++) {
         if (!config.url.includes(containsUrl[i])) {
@@ -45,14 +47,14 @@ http.interceptor.response(response => {
                         url: "/pagesA/loginNew/loginNew"
                     })
                 } else {
-                    // uni.reLaunch({
-                    //     url: "/pagesA/loginNew/loginNew"
-                    // })
+                    uni.reLaunch({
+                        url: "/pagesA/loginNew/loginNew"
+                    })
                 }
             },
         });
-
     }
+    console.log(response, '接口打印了')
     return response; // 正常返回响应
 
 });