From fa65e674d4570041b7ff62da31463a0389d7ace3 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Mon, 26 Oct 2020 10:54:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=E4=B8=8D=E8=83=BD=E5=AF=BC=E8=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/base.ts | 2 ++ src/components/NavTop.vue | 3 +++ src/views/login/Sign.vue | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/src/api/base.ts b/src/api/base.ts index c81efc6..a4fa823 100644 --- a/src/api/base.ts +++ b/src/api/base.ts @@ -5,6 +5,7 @@ import { getValue } from '@/utils/common'; import { message } from 'ant-design-vue'; import router from '@/router'; import { MessageType } from 'ant-design-vue/types/message'; +import store from '@/store'; // 泛型接口 export interface Get { @@ -21,6 +22,7 @@ axios.interceptors.response.use((response)=>{ login[0](); login.splice(0,1); if(response.data.code == 1001){ + store.commit("login", false) router.push("/") } return response; diff --git a/src/components/NavTop.vue b/src/components/NavTop.vue index bd32164..ca6c597 100644 --- a/src/components/NavTop.vue +++ b/src/components/NavTop.vue @@ -255,6 +255,9 @@ export default defineComponent({ }) function navto(index: number | string){ + if(!store.state.islogin){ + return ; + } if(typeof index == "number"){ router.push({ path: nav[index].route diff --git a/src/views/login/Sign.vue b/src/views/login/Sign.vue index 0b026e3..81f03d7 100644 --- a/src/views/login/Sign.vue +++ b/src/views/login/Sign.vue @@ -270,6 +270,10 @@ export default defineComponent({ */ async function next(e: number) { + if(!ifagree.value){ + message.error("请同意用户协议"); + return ; + } if (stepnow.value > e) { stepnow.value = e; return; From 41984882143fcbe756930b335af2bb522f5e05ee Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Mon, 26 Oct 2020 11:10:53 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E7=9B=B4=E6=92=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/index.ts | 11 ++++++++++- src/components/LivePlay.vue | 18 ++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/api/index.ts b/src/api/index.ts index ff30ef3..923de5d 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -943,4 +943,13 @@ export async function feedback(text: string) { }else{ message.error(res.msg) } -} \ No newline at end of file +} + +export async function livestart(id: string) { + const res = await put("live/" + id, {status : 1}) + if(res.code == 0){ + message.success(res.msg) + }else{ + message.error(res.msg) + } +} diff --git a/src/components/LivePlay.vue b/src/components/LivePlay.vue index e3a801b..dd1782a 100644 --- a/src/components/LivePlay.vue +++ b/src/components/LivePlay.vue @@ -20,9 +20,15 @@ 5.0分 -