|
|
@@ -1,5 +1,5 @@ |
|
|
|
import { |
|
|
|
appId |
|
|
|
appId,envs |
|
|
|
} from "./api"; |
|
|
|
import { |
|
|
|
encryption |
|
|
@@ -11,28 +11,12 @@ import { |
|
|
|
import { |
|
|
|
sm4Key |
|
|
|
} from "../network/api.js"; |
|
|
|
// 引入 sm-crypto 库 |
|
|
|
|
|
|
|
import { |
|
|
|
SM4Util |
|
|
|
} from '../util/sm4.js' |
|
|
|
const s4 = new SM4Util() |
|
|
|
/** |
|
|
|
* 配置信息,针对不同的平台进行配置 |
|
|
|
*/ |
|
|
|
const envs = { |
|
|
|
//开发环境配置 |
|
|
|
development: { |
|
|
|
baseUrl: "http://192.168.100.63:8087/ifzt/api/interfaceMidGroundIn", |
|
|
|
}, |
|
|
|
//生产环境配置 https://testzeus.etcjz.cn/api/common/transmit/v1/send/zt |
|
|
|
production: { |
|
|
|
baseUrl: "https://testzeus.etcjz.cn/api/common/transmit/v1/send/zt", |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//https://etcfile.etcjz.cn 文件服务器 |
|
|
|
//公参 |
|
|
|
//请求 |
|
|
|
export function request(code, options = {}) { |
|
|
|
//公参 |
|
|
|
const Common = { |
|
|
@@ -44,9 +28,7 @@ export function request(code, options = {}) { |
|
|
|
loginSource: "69af303ba2eb4608a099163f0d2a5dbd" |
|
|
|
} |
|
|
|
//Url 地址 |
|
|
|
//options.url = envs[process.env.NODE_ENV].baseUrl || '' + options.url |
|
|
|
options.url = 'http://192.168.100.63:8087/ifzt/api/interfaceMidGroundIn' |
|
|
|
// options.url = 'http://222.85.144.89:19002/ifzt/api/interfaceMidGroundIn' |
|
|
|
options.url = 'http://'+ envs[process.env.NODE_ENV].baseUrl +':8087/ifzt/api/interfaceMidGroundIn' |
|
|
|
//判断baseUri是否为空 |
|
|
|
if (options.baseUrl) { |
|
|
|
options.url = options.baseUrl |
|
|
@@ -72,7 +54,6 @@ export function request(code, options = {}) { |
|
|
|
'appId': appId |
|
|
|
}), 2); |
|
|
|
} |
|
|
|
|
|
|
|
//是否显示加载中 |
|
|
|
if (options.showLoading) { |
|
|
|
wx.showLoading({ |
|
|
@@ -80,7 +61,6 @@ export function request(code, options = {}) { |
|
|
|
mask: true |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
//参数返回 |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
options.success = (res) => { |