const BASE_URL = 'http://192.168.3.152:8088/glwork'

export function ApiRequest(config = {}){
	let {
		url, 
		data,
		method="GET",
		header={} 
	} = config
	url = BASE_URL + url
	header['token'] = uni.getStorageSync('token')
	return new Promise((resolve, reject)=>{
		uni.request({
			url: url,
			data: data,
			method: method,
			header: header,
			timeout: 60000,
			success: (res)=>{
				resolve(res)
			},
			fail: (err) => {
				reject(err)
			}
		})
	})
}