//我的相关:
const {
	http
} = uni.$u


//测试接口
export const login = (params, config = {}) => http.post('/auth/mini_program', params, config)
export const getUserInfo = (params, config = {}) => http.get('/user/info', params, config)
export const updateUserInfo = (params, config = {}) => http.post('/user/update', params, config)
export const getTuijian = (params, config = {}) => http.get('/user/myShare', params, config)



export const getChargeRecord = (params, config = {}) => http.get('/user/myOrderList', params, config)
export const getConsumerRecord = (params, config = {}) => http.get('/user/myConsumeList', params, config)



export const getJingxuan = (params, config = {}) => http.get('/getHandpick', params, config)



export const getRoleparmas = (params, config = {}) => http.get('/user/myRoleList', params, config)


export const postTask = (params, config = {}) => http.post('/ai/submitTask', params, config)


// export const getGenRes = (params, config = {}) => http.get('/ai/getTaskDetail', params, config)


export const getGenRes = (params, config = {}) => {

	let apiUrl = '/ai/getTaskDetail'
	Object.keys(params).forEach((item, index) => {
		if (index == 0) {
			apiUrl += `?${item}=${params[item]}`
		} else {
			apiUrl += `&${item}=${params[item]}`
		}
	})
	console.log('处理后的apiUrl', apiUrl);
	return http.get(apiUrl, params, config)
}
