mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 13:05:09 +00:00
feat: 路由
This commit is contained in:
12
napcat.webui/src/components/Dashboard.vue
Normal file
12
napcat.webui/src/components/Dashboard.vue
Normal file
@@ -0,0 +1,12 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>面板</h1>
|
||||
<p>欢迎来到面板页面!</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'Dashboard'
|
||||
};
|
||||
</script>
|
||||
@@ -20,7 +20,10 @@
|
||||
import { reactive, ref } from 'vue';
|
||||
import { MessagePlugin } from 'tdesign-vue-next';
|
||||
import { LockOnIcon } from 'tdesign-icons-vue-next';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
|
||||
const formData = reactive({
|
||||
token: '',
|
||||
@@ -28,11 +31,13 @@ const formData = reactive({
|
||||
|
||||
const onSubmit = async ({ validateResult, firstError }) => {
|
||||
if (validateResult === true) {
|
||||
await router.push({ path: '/dashboard' });
|
||||
MessagePlugin.success('登录中...');
|
||||
} else {
|
||||
MessagePlugin.error('登录失败');
|
||||
}
|
||||
};
|
||||
|
||||
</script>
|
||||
<style scoped>
|
||||
.login-container {
|
||||
|
||||
Reference in New Issue
Block a user