master
xingyy 1 month ago
parent 16a8096b15
commit 15133935eb

@ -69,6 +69,7 @@ export const voteStatus = (data) => {
export const cWxApi = (data) => {
return request({
url: '/api/children/competition/wx',
maxRedirects: 0,
method: 'GET',
data,
})

@ -21,7 +21,7 @@ const request = new Request({
},
//实例的响应拦截器
responseInterceptors: async (response) => {
console.log(response,'response')
if (response.data.status===1){
message.warning(response.data.msg||response.data.err)
}

@ -32,6 +32,12 @@ export const useAuth=createGlobalState(()=>{
const res= await voteAPI({workUid:workUid.value})
if (res.status===0){
message.success('投票成功')
router.push({
path: '/result',
query: {
type: 'hasVoted'
}
})
}
}
const getWorkInfo=async ()=>{

@ -2,6 +2,7 @@
import {useAuth} from "@/store/auth/index.js";
import {useRoute, useRouter} from 'vue-router';
import {cWxApi, voteStatus} from "@/api/auth/index.js";
import axios from "axios";
const {detailData,workUid,getWorkInfo,workData,openMask,sendVote} =useAuth()
const route = useRoute()
@ -11,6 +12,9 @@ if (route.query.uid){
getWorkInfo()
}
voteStatus().then((res)=>{
setTimeout(() => {
}, 2000);
if(res.data.status===2){
router.push({
path: '/result',
@ -20,13 +24,9 @@ if(res.data.status===2){
})
}
if(res.status===401){
console.log('进来也拉')
cWxApi()
/* fetch('https://appointteam.szjixun.cn/api/appointment/wx?notifyUrl=https%3A%2F%2Fkid-art-test.szjixun.cn%2Fvote%3Fuid%3Dede7a252-4e20-4ff6-bb8e-41fb56f82fce').then((res)=>{
console.log(res,'appointteamres')
}).catch((res)=>{
console.log('catch',res)
})*/
}
})
</script>

Loading…
Cancel
Save