/**
 * 授权 API
 */
import {
	http
} from '../request/main.js'

/**
 * 获取配置数据
 * 
 * @returns {Promise}
 */
export function getConfig() {
	return http.post('/common/getConfig', {}, {
		muteLogin: true
	})
}

/**
 * 获取活动列表
 *
 * @returns {Promise}
 */
// export function getActivityList(group, page, page_size) {
// 	return http.post('/common/getActivityList', {
// 		group,
// 		page,
// 		page_size
// 	}, {
// 		muteLogin: true
// 	})
// }
export function getActivityList(activity_type, page, page_size) {
	return http.post('/common/getActivityList', {
		activity_type,
		page,
		page_size
	}, {
		muteLogin: true
	})
}

/**
 * 上传图片
 * 
 * @returns {Promise}
 */
export function uploadImage(imageUrl) {
	return http.post('/common/uploadImage', {
		file: {
			file: imageUrl,
			name: 'image'
		}
	}, {
		uploadFile: true
	})
}
