| | |
| | | const util = require('../utils/util.js'); |
| | | |
| | | // 小程序后台 |
| | | // const baseUrl = "http://192.168.0.138:8082" |
| | | const baseUrl = 'https://fyami.com.cn'; |
| | | const baseUrl = "http://192.168.1.9:8082" |
| | | // const baseUrl = 'https://fyami.com.cn'; |
| | | const bu = 'https://fyami.com.cn'; |
| | | const basePicUrl = `${bu}/images/`; |
| | | const baseIconUrl = `${bu}/images/weixin/eplaw/`; |
| | |
| | | const spBu = "https://fyami.com.cn:447" |
| | | const spPicUrl = `${spBu}/images/`; |
| | | |
| | | // const mode = 'debug'; |
| | | const mode = 'prod'; |
| | | const mode = 'debug'; |
| | | // const mode = 'prod'; |
| | | |
| | | function request(fun, hostUrl) { |
| | | const bUrl = hostUrl ? hostUrl : baseUrl; |
| | |
| | | fun.url = bUrl + url; |
| | | } |
| | | var fun1 = util.deepCopy(fun); |
| | | if (mode == 'debug') { |
| | | console.log( |
| | | '|------------------------------------------------------------------------------------------------------------', |
| | | ); |
| | | console.log('|--访问: ', fun.url); |
| | | console.log('|--参数: ', fun.data); |
| | | } |
| | | fun1.success = function (res) { |
| | | if (mode == 'debug') { |
| | | console.log( |
| | | '|------------------------------------------------------------------------------------------------------------', |
| | | ); |
| | | console.log('|--访问: ', fun.url); |
| | | console.log('|--结果: ', res); |
| | | } |
| | | |
| | |
| | | }; |
| | | fun1.fail = function (error) { |
| | | if (mode == 'debug') { |
| | | console.log('--------------请求错误----------------' + fun.url); |
| | | console.log(error); |
| | | console.log('|--错误: ', error); |
| | | } |
| | | wx.showToast({ |
| | | title: '请求失败', |