feat: 新增页面布局

This commit is contained in:
duanshuwen
2025-12-01 22:16:34 +08:00
parent edd8b939d3
commit ae19c6c551
13 changed files with 174 additions and 16 deletions

View File

@@ -1,18 +1,11 @@
<template>
<div class="home">
<h2 class="text-2xl font-bold mb-4">欢迎使用智念科技 AI</h2>
<div class="bg-white p-6">
<button
class="bg-blue-300 hover:bg-blue-500 text-white px-4 py-2 rounded mr-2"
@click="openBaidu"
>
打开百度
</button>
</div>
</div>
<Layout>
</Layout>
</template>
<script setup lang="ts">
const openBaidu = () => {
(window as any).ipcAPI?.openBaidu()

View File

@@ -41,6 +41,19 @@
/>
</div>
<p v-if="errors.password" class="mt-1 text-xs text-red-500">{{ errors.password }}</p>
<!-- 验证码 -->
<div class="font-[14px] text-gray-700 mb-[8px] mt-[12px]">验证码</div>
<div class="flex items-center gap-2 border rounded-[10px] box-border px-[12px] py-[10px]">
<input
class="flex-1 focus-visible:outline-none"
type="text"
v-model.trim="form.code"
placeholder="请输入验证码"
@keyup.enter="onSubmit"
/>
<img class="w-[80px] h-[40px]" src="" />
</div>
<p v-if="errors.code" class="mt-1 text-xs text-red-500">{{ errors.code }}</p>
<!-- 记住密码|忘记密码 -->
<div class="flex items-center justify-between mb-[24px] mt-[24px]">
@@ -94,8 +107,8 @@ import { login as apiLogin } from "@/renderer/api/login";
import { RiUser3Fill , RiKey2Fill} from '@remixicon/vue'
const router = useRouter();
const form = reactive({ account: "", password: "", agreement: "" });
const errors = reactive<{ account?: string; password?: string }>({});
const form = reactive({ account: "", password: "", agreement: "", code: "" });
const errors = reactive<{ account?: string; password?: string; code?: string }>({});
const loading = ref(false);
const showPwd = ref(false);
@@ -118,7 +131,7 @@ const onSubmit = async () => {
// const token = res && (res.token || res.data?.token || res.access_token);
// if (!token) throw new Error("登录失败");
// localStorage.setItem("token", token);
await (window as any).ipcAPI.app.setFrameless('/browser')
await (window as any).ipcAPI.app.setFrameless('/home')
} finally {
// loading.value = false;
}