//const host = 'http://114.215.00.00:8005';// 测试地址
const host = 'https://xx.xxxxxxxx.net'; // 正式地址
const wxRequest = (params, url) => {
wx.request({
url: url,
method: params.method || 'GET',
data: params.data || {},
header: {
'Content-Type': 'application/json',
'cookie': wx.getStorageSync("cookie") //读取cookie
},
success: (res) => {
params.success && params.success(res)
wx.hideToast()
},
fail: (res) => {
params.fail && params.fail(res)
},
complete: (res) => {
params.complete && params.complete(res)
}
})
}
//登录
const delChild = (params) => wxRequest(params, host + '/auth');
import req from '../../api/api.js'
req.delChild({
method: "PUT",
data: params,
success: (res) => {
wx.showToast({
title: '删除成功',
icon: 'succes',
duration: 3000,
mask: true
});
wx.setStorage({
key: "PhysicalInformation",
data: localPhysicalInformation
});
},
fail: (res) => {
alert(res.data.Message);
}
});