You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
883 B
39 lines
883 B
import config from '../config.js'
|
|
const json_data={
|
|
appcode:'SHISE' ,//应用编码
|
|
appchannel:'FXXXXHUAWEI' ,//应用发布渠道
|
|
appver: '1.0.0',//应用版本
|
|
appname:'cnic_buyer' ,//应用名称
|
|
manufacturer:'HUAWEI' ,//设备生产商
|
|
phonebrand:'HORNOR' ,//设备品牌
|
|
phonetype:'X30' ,//设备型号
|
|
phoneos:'ANDROID'// 设备系统
|
|
}
|
|
const httpRequest = (params) => {
|
|
uni.showLoading({
|
|
title: "努力加载中..."
|
|
});
|
|
|
|
let httpOptions = {
|
|
url: config.apiUri + params.url,
|
|
data: params.data,
|
|
method: params.method,
|
|
header: {'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'}
|
|
};
|
|
return new Promise((resolve, reject) => {
|
|
uni.request({
|
|
...httpOptions,
|
|
success: res => {
|
|
uni.hideLoading();
|
|
resolve(res);
|
|
},
|
|
fail: err => {
|
|
uni.hideLoading();
|
|
reject(err);
|
|
}
|
|
})
|
|
})
|
|
|
|
}
|
|
|
|
export default httpRequest;
|
|
|