import { post } from '../utils/request' import { showMessage } from '../common/toast/toast' import { getDeviceId } from '../utils/lofter-log' export const signupRequest = async (data: {activityId:string}) => { let deviceId = await getDeviceId() return post('//www.lofter.com/spread/common/signup', data, {}, 'json', { deviceId }).then(res => { // 活动party2022 不提示提交成功 if (res.code === 200) { if (data.activityId !== 'party2022') { showMessage({ text: '提交成功' }) } return true } showMessage({ text: res.msg }) return false }) as Promise } export const signupNotify = async () => { let deviceId = await getDeviceId() return post('//www.lofter.com/spread/activity/signup/notify', null, {}, 'json', { deviceId }).then(res => { if (res.code === 200) { showMessage({ text: '报名成功,头像框奖励已发放,请注意查收私信' }) return true } showMessage({ text: res.msg }) return res }) as Promise }