LoginView.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <div
  3. style="min-height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at top, #dbeafe, #0f172a)"
  4. >
  5. <div style="display: grid; grid-template-columns: 1.2fr 420px; width: 1080px; max-width: 92vw; overflow: hidden; border-radius: 28px; background: #fff">
  6. <div style="padding: 56px; background: linear-gradient(160deg, #0f172a, #1d4ed8); color: #fff">
  7. <div style="font-size: 42px; font-weight: 800; line-height: 1.15">视频脚本<br />管理平台</div>
  8. <p style="margin-top: 18px; color: rgba(255,255,255,0.8); line-height: 1.8">
  9. 用于管理登录、组织架构、菜单权限,以及视频链接拆解任务。
  10. </p>
  11. </div>
  12. <div style="padding: 56px 42px">
  13. <div style="font-size: 28px; font-weight: 700; margin-bottom: 24px">登录</div>
  14. <el-form :model="form" @submit.prevent>
  15. <el-form-item>
  16. <el-input v-model="form.username" placeholder="用户名" size="large" />
  17. </el-form-item>
  18. <el-form-item>
  19. <el-input v-model="form.password" placeholder="密码" show-password size="large" />
  20. </el-form-item>
  21. <el-form-item>
  22. <el-button type="primary" size="large" style="width: 100%" @click="handleLogin">进入系统</el-button>
  23. </el-form-item>
  24. </el-form>
  25. </div>
  26. </div>
  27. </div>
  28. </template>
  29. <script setup>
  30. import { reactive } from "vue";
  31. import { ElMessage } from "element-plus";
  32. import { useRouter } from "vue-router";
  33. import { useAuthStore } from "../stores/auth";
  34. const router = useRouter();
  35. const authStore = useAuthStore();
  36. const form = reactive({
  37. username: "",
  38. password: "",
  39. });
  40. const handleLogin = async () => {
  41. if (!form.username || !form.password) {
  42. ElMessage.warning("请输入用户名和密码");
  43. return;
  44. }
  45. await authStore.login(form);
  46. router.push("/dashboard");
  47. };
  48. </script>