提交 8b37c86d 编写于 作者: 水晶土豆

Wed Nov 15 15:14:00 CST 2023 inscode

上级 9e8cb4af
...@@ -37,24 +37,19 @@ const onSignUp = () => { ...@@ -37,24 +37,19 @@ const onSignUp = () => {
</script> </script>
<template> <template>
<el-dialog <el-dialog class="el-dialog-first" v-model="dialogFormVisible" :show-close="false" :append-to-body="true">
class="el-dialog-first"
v-model="dialogFormVisible"
:show-close="false"
:append-to-body="true">
<login :hidden="true"></login> <login :hidden="true"></login>
<register :hidden="false" @emitSignIn="onSignIn" @emitSignUp="onSignUp"></register> <register :hidden="false" @emitSignIn="onSignIn" @emitSignUp="onSignUp"></register>
</el-dialog> </el-dialog>
</template> </template>
<style> <style scoped>
.dialog-footer button:first-child { :global(.el-dialog-first .el-dialog__body) {
margin-right: 10px;
}
.el-dialog__body{
padding: 0px; padding: 0px;
border-radius: 30px;
} }
.el-dialog__header{
:global(.el-dialog-first .el-dialog__header) {
display: none; display: none;
} }
</style> </style>
...@@ -15,4 +15,13 @@ const router = createRouter({ ...@@ -15,4 +15,13 @@ const router = createRouter({
routes, // `routes: routes` 的缩写 routes, // `routes: routes` 的缩写
}); });
router.beforeEach((to, from, next) => {
if (to.matched.length === 0) { // 如果未匹配到路由
from.name ? next({ name: from.name }) : next('/')
} else {
next() // 如果匹配到正确跳转
}
})
export default router; export default router;
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册