Browse Source

zbytest003-2025-02-20 12:34:10

genlitex 3 months ago
parent
commit
dfb5fed5b9
5 changed files with 78 additions and 0 deletions
  1. 4 0
      dist/assets/index-CWn0QqOU.js
  2. 0 0
      dist/assets/index-CfjwyL33.css
  3. 14 0
      dist/index.html
  4. 6 0
      src/router/index.js
  5. 54 0
      src/views/LoginView.vue

File diff suppressed because it is too large
+ 4 - 0
dist/assets/index-CWn0QqOU.js


File diff suppressed because it is too large
+ 0 - 0
dist/assets/index-CfjwyL33.css


+ 14 - 0
dist/index.html

@@ -0,0 +1,14 @@
+<!doctype html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8" />
+    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+    <title>Vite + Vue</title>
+    <script type="module" crossorigin src="/ide/proxy/6008/assets/index-CWn0QqOU.js"></script>
+    <link rel="stylesheet" crossorigin href="/ide/proxy/6008/assets/index-CfjwyL33.css">
+  </head>
+  <body>
+    <div id="app"></div>
+  </body>
+</html>

+ 6 - 0
src/router/index.js

@@ -1,11 +1,17 @@
 import { createRouter, createWebHashHistory } from 'vue-router'
 import HomeView from '../views/HomeView.vue'
+import LoginView from '../views/LoginView.vue'
 
 const routes = [
   {
     path: '/',
     name: 'home',
     component: HomeView
+  },
+  {
+    path: '/login',
+    name: 'login',
+    component: LoginView
   }
 ]
 

+ 54 - 0
src/views/LoginView.vue

@@ -0,0 +1,54 @@
+<template>
+  <div class="bg-gray-200 flex items-center justify-center min-h-screen">
+    <form class="bg-white p-8 rounded-lg shadow-md w-96 space-y-4">
+      <h2 class="text-2xl font-bold text-gray-800 text-center">登录</h2>
+      <div>
+        <label for="username" class="block text-gray-600">用户名</label>
+        <input id="username" v-model="username" type="text" class="w-full px-4 py-2 border border-gray-300 rounded focus:outline-none focus:border-purple-500" />
+      </div>
+      <div>
+        <label for="password" class="block text-gray-600">密码</label>
+        <input id="password" v-model="password" type="password" class="w-full px-4 py-2 border border-gray-300 rounded focus:outline-none focus:border-purple-500" />
+      </div>
+      <div class="flex items-center">
+        <input id="remember" v-model="remember" type="checkbox" class="mr-2" />
+        <label for="remember" class="text-gray-600 text-sm">记住我</label>
+      </div>
+      <button @click.prevent="login" class="w-full bg-purple-600 text-white font-bold py-2 rounded hover:bg-purple-700">登录</button>
+    </form>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      username: '',
+      password: '',
+      remember: false,
+    };
+  },
+  methods: {
+    login() {
+      // Simple validation
+      if (!this.username || !this.password) {
+        alert('用户名和密码不能为空');
+        return;
+      }
+
+      // Dummy login logic
+      if (this.username === 'admin' && this.password === 'admin') {
+        alert('登录成功');
+        // Redirect to home page
+        this.$router.push('/');
+      } else {
+        alert('用户名或密码错误');
+      }
+    },
+  },
+};
+</script>
+
+<style scoped>
+/* Additional styles can be added here if needed */
+</style>

Some files were not shown because too many files changed in this diff