|
@@ -1,9 +1,22 @@
|
|
import config from '../config.js';
|
|
import config from '../config.js';
|
|
const getDomain = (uri, method, type) => {
|
|
const getDomain = (uri, method, type) => {
|
|
- if (type && type == 'file') return config.serverUrl + '/files' + uri;
|
|
|
|
- if (type && type == 'integral') return config.serverUrl + '/point/zr/v1/api' + uri;
|
|
|
|
- if (uri.startsWith('/wechat/api')) return config.serverUrl + uri;
|
|
|
|
- else return config.serverUrl + '/point/v1/api' + uri;
|
|
|
|
|
|
+ let wx_env = config.wx_miniProgram;
|
|
|
|
+ let system = config.system;
|
|
|
|
+ let url = config.serverUrl;
|
|
|
|
+ if (type && type == 'file') return url + `/files` + uri;
|
|
|
|
+ if (type && type == 'integral') return url + `/point/zr/v1/api` + uri;
|
|
|
|
+ if (uri.startsWith('/wechat/api')) return url + uri;
|
|
|
|
+ else {
|
|
|
|
+ if (system.uniPlatform == 'app') {
|
|
|
|
+ return url + `/point/v1/api` + uri;
|
|
|
|
+ } else if (system.uniPlatform == 'mp-weixin') {
|
|
|
|
+ if (wx_env.envVersion == 'develop' || wx_env.envVersion == 'trial') {
|
|
|
|
+ return url + `/${config.wx_dev}/point/v1/api` + uri;
|
|
|
|
+ } else if (wx_env.envVersion == 'release') {
|
|
|
|
+ return url + '/point/v1/api' + uri;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
// 获取token
|
|
// 获取token
|
|
const getToken = () => {
|
|
const getToken = () => {
|