Merge branch 'master' of http://git.luyuan.tk/luyuan/beelink into zj

This commit is contained in:
asd 2020-10-26 12:01:08 +08:00
commit c792837983
5 changed files with 35 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import { getValue } from '@/utils/common';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import router from '@/router'; import router from '@/router';
import { MessageType } from 'ant-design-vue/types/message'; import { MessageType } from 'ant-design-vue/types/message';
import store from '@/store';
// 泛型接口 // 泛型接口
export interface Get { export interface Get {
@ -21,6 +22,7 @@ axios.interceptors.response.use((response)=>{
login[0](); login[0]();
login.splice(0,1); login.splice(0,1);
if(response.data.code == 1001){ if(response.data.code == 1001){
store.commit("login", false)
router.push("/") router.push("/")
} }
return response; return response;

View File

@ -944,3 +944,12 @@ export async function feedback(text: string) {
message.error(res.msg) message.error(res.msg)
} }
} }
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)
}
}

View File

@ -20,9 +20,15 @@
<span class="score">5.0</span> <span class="score">5.0</span>
</div> </div>
</div> </div>
<div style="display: flex">
<div class="right" @click="bianji"> <div class="right" @click="bianji">
编辑信息 编辑信息
</div> </div>
<div class="right" @click="kaishi">
开始直播
</div>
</div>
</div> </div>
</div> </div>
</template> </template>
@ -77,6 +83,7 @@
} }
</style> </style>
<script lang="ts"> <script lang="ts">
import { livestart } from '@/api';
import router from '@/router'; import router from '@/router';
import { defineComponent, ref } from "vue"; import { defineComponent, ref } from "vue";
@ -91,9 +98,16 @@ export default defineComponent({
router.push("/mine/webcast?id=" + props.info.liveid) router.push("/mine/webcast?id=" + props.info.liveid)
} }
} }
// todo
function kaishi(){
if(props.info != undefined){
livestart(props.info.liveid)
}
}
// const liveinfo = ref(props.liveinfo) // const liveinfo = ref(props.liveinfo)
return { return {
bianji bianji,
kaishi
} }
}, },
}); });

View File

@ -255,6 +255,9 @@ export default defineComponent({
}) })
function navto(index: number | string){ function navto(index: number | string){
if(!store.state.islogin){
return ;
}
if(typeof index == "number"){ if(typeof index == "number"){
router.push({ router.push({
path: nav[index].route path: nav[index].route

View File

@ -270,6 +270,10 @@ export default defineComponent({
*/ */
async function next(e: number) { async function next(e: number) {
if(!ifagree.value){
message.error("请同意用户协议");
return ;
}
if (stepnow.value > e) { if (stepnow.value > e) {
stepnow.value = e; stepnow.value = e;
return; return;