1.0增加验证功能

main
RogerWork 11 months ago
parent 0a1e684e44
commit c2bc8e78ab
  1. 3
      src/router/index.js
  2. 20
      src/views/mock/index.vue

@ -20,7 +20,7 @@ const routes = [
{
path: 'mock',
name: 'Mock',
component: () => import('@/views/mock/index.vue')
component: () => import('@/views/mock/index.vue'),
}
]
}
@ -28,4 +28,5 @@ const routes = [
const router = createRouter({history: createWebHashHistory(), routes})
export default router

@ -13,6 +13,7 @@ import {ref, computed} from "vue";
import {InfoFilled} from "@element-plus/icons-vue";
import JsonEditorVue from "json-editor-vue3";
import Api_block from "@/components/mock/api_block.vue";
import {onBeforeRouteLeave} from "vue-router";
const mockConfigPost = ref()
let cinema_items = ref([]);
@ -322,6 +323,10 @@ const handleStart = () => {
console.log(selectedOvertimeShowType.value)
console.log(selectedShowInfo.value)
console.log(selectedStatus.value)
if (selectIp.value === '') {
alert('请先选择影院IP!')
return
}
if (checkedMockConfig.value.indexOf('get_overtime_ticket_status') >= 0) {
if (selectedOvertimeShowType.value === '' || selectedShowInfo.value === '' || selectedStatus.value === '') {
alert('请先设置‘超时票务查询’中的选项!')
@ -347,6 +352,10 @@ const handleStart = () => {
}
const handleEnd = () => {
if (selectIp.value === '') {
alert('请先选择影院IP!')
return
}
running.value = false
startBtn_disable.value = false
startBtn_loading.value = false
@ -400,6 +409,17 @@ onMounted(
await get_cinema_items();
}
)
onBeforeRouteLeave((from, to, next) => {
console.log(selectIp.value)
console.log(to.path)
console.log(from.path)
if (to.path === '/mock' && running.value === true) {
alert('请先停止运行!')
}else{
next()
}
})
</script>

Loading…
Cancel
Save