// 线上地址
// const BASE_URL = "https://chtech.ncjti.edu.cn/campusclock"
// 本地地址
const BASE_URL = "https://chtech.ncjti.edu.cn/gradiate-school/reporting"
export const myRequest = (options) => {
	uni.showLoading({
		title: "加载中",
		mask: true,
	});
	return new Promise((resolve, reject) => {
		uni.request({
			url: BASE_URL + options.url,
			method: options.method || "GET",
			data: options.data || {},
			success: (res) => {
				uni.hideLoading();
				resolve(res.data)
			},
			fail: (err) => {
				uni.hideLoading();
				uni.showToast({
					title: "请求数据失败",
					icon: "none",
					mask: true
				})
				reject(err)
			}
		})
	})
}
