system.js
1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import http from "../request/http";
import { env } from "../env/index";
const serverConfig = {
mockRequestCount: null,
mockTimer: {},
mockCache: null,
};
const configModule = "uplus-fapai-mp";
const configUrl = `https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=${configModule}&env=${env}`;
/**获取mock数据 */
const getFrontConfig = async () => {
return new Promise((resolve, reject) => {
wx.showLoading({ title: "加载中..." });
wx.request({
// url: `${domain}${path}?method=${method}`,
url: configUrl,
// data,
method: "GET",
// header,
dataType: "json",
responseType: "text",
success(response) {
resolve(response.data);
},
fail(error) {
console.log(error, "error");
},
complete() {
wx.hideLoading();
},
})
});
};
// 图片版本号
const getImageVersion = async () => {
const accountInfo = await getFrontConfig();
return accountInfo?.version || Date.now();
};
module.exports = {
getImageVersion,
getFrontConfig,
};