import http from '@/http/http.js'
const request = http.request

/**
 * 文件上传
 * @returns
 */
export function uploadFile(file, data, urlType = 'account') {
	return http.upload(`${urlType}/admin/common/upload`,data,file)
}

/**
 * 订阅二维码
 * @returns
 */
export function getShopMsgPushCode(data, urlType = 'account') {
	return request({
		url: `${urlType}/admin/shopMsgPush/code`,
		method: "GET",
		data: {
			...data
		}
	})
}

/**
 * 获取店铺权限列表
 * @returns
 */
export function getShopPermission(data, urlType = 'account') {
	return request({
		url: `${urlType}/admin/shopPermission`,
		method: "GET",
		data: {
			...data
		}
	})
}

/**
 * 根据渠道获取版本信息
 * @returns
 */
export function getVersion(data, urlType = 'account') {
	return request({
		url: `${urlType}/admin/version/${data.source}/${data.type}`,
		method: "GET",
		data: {
			...data
		}
	})
}
