import {
	getToken
} from './token.js'

export const $post = async ({
	url,
	data = {}
}) => {
	const token = getToken() ? getToken() : '';
	const res = await uni.request({
		url,
		method: 'POST',
		data,
		header: {
			Authorization: 'Bearer ' + token
		}
	});
	if (!!res && res.data != '') {
		return res.data
	} else {
		uni.$lu.toast("请求发生错误")
		return false
	}
}