Skip to content

Commit

Permalink
🐛fix specification problem
Browse files Browse the repository at this point in the history
  • Loading branch information
kkkangKK committed Aug 20, 2024
1 parent f0d6ce7 commit af5095a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 35 deletions.
27 changes: 13 additions & 14 deletions apps/web/app/account/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import ThreeD from "@/components/model/MyModel";

import "@/style/3d.css";

import { Button } from "@/components/ui/button";
import { Form } from "@/components/ui/form";
import { zodResolver } from "@hookform/resolvers/zod";
import Link from "next/link";
Expand Down Expand Up @@ -126,7 +125,6 @@ function Index(props: any) {
});
async function onSubmit(values: any) {
console.log(values);
// showModal();
}

//子组件的回调函数
Expand Down Expand Up @@ -310,11 +308,11 @@ function Index(props: any) {
setBoxHeight(height);
setIsReady(true);
}
},10);
}, 10);
return () => {
clearTimeout(timer);
};
}, []);
}, []);

const RenderThreeD = () => {
if (isReady) {
Expand All @@ -340,7 +338,7 @@ function Index(props: any) {
<div className="card lg:card-side bg-base-100 shadow-xl">
<div
className="w-1/2"
style={{background: 'linear-gradient(to bottom, #11e8bb 0%, #8200c9 100%)'}}
style={{ background: "linear-gradient(to bottom, #11e8bb 0%, #8200c9 100%)" }}
ref={boxRef}
>
{RenderThreeD()}
Expand All @@ -353,6 +351,16 @@ function Index(props: any) {
个人中心
</div>

<label className="label flex justify-end">
<Link
href="/auth/login"
onClick={handleDelete}
className="label-text-alt link link-hover text-[#EF4444] "
>
注销账号
</Link>
</label>

<div className="flex justify-center mb-8">
{/* //表单 */}
<div className="w-[92vw] sm:w-[50vw] md:w-[40vw] lg:w-[30vw] xl:w-[25vw] min-w-[320px] card shrink-0 max-w-sm bg-base-100 font-serif rounded-2xl">
Expand Down Expand Up @@ -390,15 +398,6 @@ function Index(props: any) {
更新信息
</button>
</div>
{/* <label className="label flex justify-end">
<Link
href="/auth/login"
onClick={handleDelete}
className="label-text-alt link link-hover text-[#EF4444] "
>
注销账号
</Link>
</label> */}
</form>
</div>
</Form>
Expand Down
17 changes: 5 additions & 12 deletions apps/web/app/auth/login/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client";

import { defaultSignIn, defaultSignUp, loginBySMS } from "@/api/auth";
import { sendBySMS } from "@/api/sms";
import { sendBySMS } from "@/api/sms";
import MyFormField from "@/components/base/MyFormField";
import Layout from "@/components/page-components/auth/AuthBackGround";
import Oauth2 from "@/components/page-components/auth/Oauth2";
Expand Down Expand Up @@ -30,10 +30,9 @@ const loginFormSchema = z.object({
code: z.string().length(6, { message: "无效的验证码" }).regex(/^\d+$/, {
message: "无效的验证码",
}),
username: z
.string()
// .min(4, { message: "用户名长度不能少于4个字符" })
// .max(12, { message: "用户名长度不能超过20个字符" }),
username: z.string(),
// .min(4, { message: "用户名长度不能少于4个字符" })
// .max(12, { message: "用户名长度不能超过20个字符" }),
});

export type loginFormSchemaType = z.infer<typeof loginFormSchema>;
Expand Down Expand Up @@ -88,13 +87,7 @@ export default function Login() {
? await loginBySMS(form.getValues("phone"), form.getValues("code"))
: await defaultSignIn(form.getValues("username"), form.getValues("password"));
window.localStorage.setItem("token", res.token); //存入本地
window.localStorage.setItem("userId", res.data?.userId);
// if(isPhoneMode) {
// window.localStorage.setItem("userId", res.data.id);
// }
// else{
// window.localStorage.setItem("userId", res.data.userId);
// }
window.localStorage.setItem("userId", res.data?.userId);
console.log(res.token);
router.push("/");
};
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import TemplateList from "../components/page-components/index/TemplateList";

function Main() {
return (
<main className="h-screen">
<div className="h-screen">
<Head mode={"fixed"} />
<Banner />
<DataBox />
<TemplateList />
<Foot />
</main>
</div>
);
}

Expand Down
12 changes: 5 additions & 7 deletions apps/web/components/page-components/index/Head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function Head({ mode }: Readonly<{ mode: string }>) {
};

function scrollFunction() {
var navbar = document.querySelector(".navbar") as HTMLElement;
let navbar = document.querySelector(".navbar") as HTMLElement;
if (navbar) {
if (document.documentElement.scrollTop > window.screen.height) {
// 当滚动距离大于 navbar 的高度时,隐藏 navbar
Expand All @@ -39,9 +39,8 @@ function Head({ mode }: Readonly<{ mode: string }>) {
</div>
<div className="flex-none">
<div className="dropdown dropdown-end">
<div
<button
tabIndex={0}
role="button"
className="btn btn-ghost btn-circle"
>
<Link href="/myWork">
Expand All @@ -56,12 +55,11 @@ function Head({ mode }: Readonly<{ mode: string }>) {
/>
</div>
</Link>
</div>
</button>
</div>
<div className="dropdown dropdown-end">
<div
<button
tabIndex={0}
role="button"
className="btn btn-ghost btn-circle avatar"
>
<div className="w-10 rounded-full">
Expand All @@ -70,7 +68,7 @@ function Head({ mode }: Readonly<{ mode: string }>) {
src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp"
/>
</div>
</div>
</button>
<ul
tabIndex={0}
className="menu menu-sm dropdown-content bg-base-100 rounded-box z-[1] mt-3 w-52 p-2 shadow"
Expand Down

0 comments on commit af5095a

Please sign in to comment.