import baseurl from '../../baseurl.js'

var request = function(config) {
	return new Promise((resolve, rejected) => {
		uni.request({
			url: baseurl + config.url,
			data: config.data,
			method: config.method,
			timeout: 60000,
			header: config.header,
			success(res) {
				resolve(res.data)
			},
			fail(err) {
				rejected(err)
			}
		})
	})
}

//获取图片接口
export function getImgById(prizeId) {
	return request({
		url: `/applet/score/prize/getImgById/${prizeId}`,
		method: 'get',
		header: {
			region: uni.getStorageSync('region'),
		}
	})
}