wanshenmean
2025-04-08 517fb253f39bf8120f9bed693d35349727ae650c
´úÂë¹ÜÀí/NEWCode/WIDESEAWCS_PDA/uview-ui/libs/request/index.js
@@ -51,7 +51,8 @@
               }
            } else {
               if (response.statusCode == 200) {
                  if (this.interceptor.response && typeof this.interceptor.response === 'function') {
                  if (this.interceptor.response && typeof this.interceptor.response ===
                     'function') {
                     let resInterceptors = this.interceptor.response(response.data);
                     if (resInterceptors !== false) {
                        resolve(resInterceptors);
@@ -74,9 +75,15 @@
            }
         }
         // åˆ¤æ–­æ˜¯å¦ä¸ºå®Œæ•´ URL,如果是则不使用 baseUrl
         if (options.url.includes('http://') || options.url.includes('https://')) {
            options.url = options.url;
         } else {
         // åˆ¤æ–­ç”¨æˆ·ä¼ é€’çš„URL是否/开头,如果不是,加上/,这里使用了uView的test.js验证库的url()方法
         options.url = validate.url(options.url) ? options.url : (this.config.baseUrl + (options.url.indexOf('/') == 0 ?
            options.url = validate.url(options.url) ? options.url : (this.config.baseUrl + (options.url
               .indexOf('/') == 0 ?
            options.url : '/' + options.url));
         }
         
         // æ˜¯å¦æ˜¾ç¤ºloading
         // åŠ ä¸€ä¸ªæ˜¯å¦å·²æœ‰timer定时器的判断,否则有两个同时请求的时候,后者会清除前者的定时器id