From 15133935eb5e258d7d40c751678767f3b86742f0 Mon Sep 17 00:00:00 2001 From: xingyy <373639591@qq.com> Date: Fri, 16 Aug 2024 17:03:01 +0800 Subject: [PATCH] 12312 --- src/api/auth/index.js | 1 + src/service/index.js | 2 +- src/store/auth/index.js | 6 ++++++ src/views/vote/index.vue | 12 ++++++------ 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/api/auth/index.js b/src/api/auth/index.js index 210b866..38b17a7 100644 --- a/src/api/auth/index.js +++ b/src/api/auth/index.js @@ -69,6 +69,7 @@ export const voteStatus = (data) => { export const cWxApi = (data) => { return request({ url: '/api/children/competition/wx', + maxRedirects: 0, method: 'GET', data, }) diff --git a/src/service/index.js b/src/service/index.js index 8393d6e..acc46a6 100644 --- a/src/service/index.js +++ b/src/service/index.js @@ -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) } diff --git a/src/store/auth/index.js b/src/store/auth/index.js index 3d40f33..4e6e3b9 100644 --- a/src/store/auth/index.js +++ b/src/store/auth/index.js @@ -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 ()=>{ diff --git a/src/views/vote/index.vue b/src/views/vote/index.vue index 762c0be..66182fd 100644 --- a/src/views/vote/index.vue +++ b/src/views/vote/index.vue @@ -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) - })*/ + } })