import request from '@/service/index.js'
import {useAuth} from "@/store/auth/index.js";

export const sendCode = (data) => {
    return request({
        url: '/api/children/competition/sendCode',
        method: 'POST',
        data,
    })
}
export const loginRegister = (data) => {
    return request({
        url: '/api/children/competition/login/register',
        method: 'POST',
        data,
    })
}
export const competitionApply = (data) => {
    return request({
        url: '/api/children/competition/apply',
        method: 'POST',
        data,
    })
}
export const uploadFile = (data) => {
    return request({
        isFormData:true,
        url: '/api/upload/file',
        method: 'POST',
        data,
    })
}
export const competitionWorks = (data) => {
    return request({
        isFormData:true,
        url: '/api/children/competition/works',
        method: 'POST',
        data,
    })
}
export const workInfo = (data) => {
    return request({
        url: '/api/children/competition/get/work/info',
        method: 'POST',
        data,
    })
}
export const voteAPI = (data) => {
    return request({
        url: '/api/children/competition/vote',
        method: 'POST',
        data,
    })
}
export const deadlineAPI = (data) => {
    return request({
        url: '/api/children/competition/get/registration/deadline',
        method: 'POST',
        data,
    })
}

export const voteStatus = (data) => {
    return request({
        url: '/api/children/competition/get/vote/status',
        method: 'POST',
        data,
    })
}

export const cWxApi = (data) => {
    return request({
        url: '/api/children/competition/wx',
        method: 'GET',
        data,
    })
}
export const GToken = (data) => {
    return request({
        url: '/api/children/competition/view/login',
        method: 'POST',
        data,
    })
}
export const viewOpenId = (data) => {
    return request({
        url: '/api/children/competition/view/openId',
        method: 'POST',
        data
    })
}
