import { envs } from '@/utils/network/api.js' | |||||
// export const fileURL = 'http://47.94.96.52/' | // export const fileURL = 'http://47.94.96.52/' | ||||
// export const fileURL = 'http://222.85.144.89:19002/default-bucket/' | // export const fileURL = 'http://222.85.144.89:19002/default-bucket/' | ||||
export const downloadFileURL = 'http://192.168.100.63:8087/user-export-excel/' | |||||
export const fileURL = 'http://192.168.100.63:8087/default-bucket/' | |||||
export const downloadFileURL = 'http://'+ envs[process.env.NODE_ENV].baseUrl +':8087/user-export-excel/' | |||||
export const fileURL = 'http://'+ envs[process.env.NODE_ENV].baseUrl +':8087/default-bucket/' |
/* 接口中常量 */ | /* 接口中常量 */ | ||||
export const URL = "192.168.100.63"; | |||||
/** | |||||
* 配置信息,针对不同的平台进行配置 | |||||
*/ | |||||
export const envs = { | |||||
//开发环境配置 | |||||
development: { | |||||
baseUrl: "192.168.100.63", | |||||
}, | |||||
//生产环境配置 | |||||
production: { | |||||
baseUrl: "222.85.144.89", | |||||
} | |||||
} | |||||
export const appId = "52030131"; //应用appid 综合业务支撑平台使用 | export const appId = "52030131"; //应用appid 综合业务支撑平台使用 | ||||
export const loginTime = 86400; //登录有效时间(单位s) 1天 | export const loginTime = 86400; //登录有效时间(单位s) 1天 | ||||
export const wechatPayConfigId = "6a9a54bc01f6443faea7ffe132b19f6"; //支付配置编号 微信小程序支付 | export const wechatPayConfigId = "6a9a54bc01f6443faea7ffe132b19f6"; //支付配置编号 微信小程序支付 | ||||
export const deviceUpgrade = "896"//BDS-设备升级接口 | export const deviceUpgrade = "896"//BDS-设备升级接口 | ||||
export const cardModifyConfirm = "898" //ASS-卡信息变更确认 | export const cardModifyConfirm = "898" //ASS-卡信息变更确认 | ||||
export const pinCodeUnlock = "862" //ASS-卡PIN解锁 | export const pinCodeUnlock = "862" //ASS-卡PIN解锁 | ||||
//公务车 | //公务车 | ||||
export const gongWuChefindFormatVehicleInfo = "507"; //制式警车信息查询 ,只用于同步IF01001202206010854 | export const gongWuChefindFormatVehicleInfo = "507"; //制式警车信息查询 ,只用于同步IF01001202206010854 |
import { | import { | ||||
appId | |||||
appId,envs | |||||
} from "./api"; | } from "./api"; | ||||
import { | import { | ||||
encryption | encryption | ||||
import { | import { | ||||
sm4Key | sm4Key | ||||
} from "../network/api.js"; | } from "../network/api.js"; | ||||
// 引入 sm-crypto 库 | |||||
import { | import { | ||||
SM4Util | SM4Util | ||||
} from '../util/sm4.js' | } from '../util/sm4.js' | ||||
const s4 = new SM4Util() | 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 = {}) { | export function request(code, options = {}) { | ||||
//公参 | //公参 | ||||
const Common = { | const Common = { | ||||
loginSource: "69af303ba2eb4608a099163f0d2a5dbd" | loginSource: "69af303ba2eb4608a099163f0d2a5dbd" | ||||
} | } | ||||
//Url 地址 | //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是否为空 | //判断baseUri是否为空 | ||||
if (options.baseUrl) { | if (options.baseUrl) { | ||||
options.url = options.baseUrl | options.url = options.baseUrl | ||||
'appId': appId | 'appId': appId | ||||
}), 2); | }), 2); | ||||
} | } | ||||
//是否显示加载中 | //是否显示加载中 | ||||
if (options.showLoading) { | if (options.showLoading) { | ||||
wx.showLoading({ | wx.showLoading({ | ||||
mask: true | mask: true | ||||
}); | }); | ||||
} | } | ||||
//参数返回 | //参数返回 | ||||
return new Promise((resolve, reject) => { | return new Promise((resolve, reject) => { | ||||
options.success = (res) => { | options.success = (res) => { |