Spaces:
Paused
Paused
xiao commited on
Commit ·
206643b
1
Parent(s): f6d38eb
修改样式
Browse files- app/components/findpwd.module.scss +2 -1
- app/components/login.module.scss +16 -0
- app/components/login.tsx +1 -1
- app/components/register.module.scss +17 -1
- app/components/register.tsx +55 -51
app/components/findpwd.module.scss
CHANGED
|
@@ -6,6 +6,7 @@
|
|
| 6 |
-moz-appearance: none;
|
| 7 |
appearance: none;
|
| 8 |
cursor: pointer;
|
|
|
|
| 9 |
background-color: var(--white);
|
| 10 |
color: var(--black);
|
| 11 |
text-align: left;
|
|
@@ -100,4 +101,4 @@
|
|
| 100 |
display: inline;
|
| 101 |
margin: 0 auto;
|
| 102 |
font-size: 8px;
|
| 103 |
-
}
|
|
|
|
| 6 |
-moz-appearance: none;
|
| 7 |
appearance: none;
|
| 8 |
cursor: pointer;
|
| 9 |
+
width: 163px;
|
| 10 |
background-color: var(--white);
|
| 11 |
color: var(--black);
|
| 12 |
text-align: left;
|
|
|
|
| 101 |
display: inline;
|
| 102 |
margin: 0 auto;
|
| 103 |
font-size: 8px;
|
| 104 |
+
}
|
app/components/login.module.scss
CHANGED
|
@@ -6,6 +6,22 @@
|
|
| 6 |
-moz-appearance: none;
|
| 7 |
appearance: none;
|
| 8 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
background-color: var(--white);
|
| 10 |
color: var(--black);
|
| 11 |
text-align: left;
|
|
|
|
| 6 |
-moz-appearance: none;
|
| 7 |
appearance: none;
|
| 8 |
cursor: pointer;
|
| 9 |
+
width: 163px;
|
| 10 |
+
background-color: var(--white);
|
| 11 |
+
color: var(--black);
|
| 12 |
+
text-align: left;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
.password{
|
| 16 |
+
border: var(--border-in-light);
|
| 17 |
+
padding: 10px;
|
| 18 |
+
border-radius: 10px;
|
| 19 |
+
-webkit-appearance: none;
|
| 20 |
+
-moz-appearance: none;
|
| 21 |
+
appearance: none;
|
| 22 |
+
cursor: pointer;
|
| 23 |
+
width: 185px;
|
| 24 |
+
max-width: 60% !important;
|
| 25 |
background-color: var(--white);
|
| 26 |
color: var(--black);
|
| 27 |
text-align: left;
|
app/components/login.tsx
CHANGED
|
@@ -72,7 +72,7 @@ export function Login() {
|
|
| 72 |
<div>
|
| 73 |
<input
|
| 74 |
type="password"
|
| 75 |
-
className={styles.
|
| 76 |
placeholder={Locale.User.Password}
|
| 77 |
onInput={(e) => onPassword(e.currentTarget.value)}
|
| 78 |
value={password}
|
|
|
|
| 72 |
<div>
|
| 73 |
<input
|
| 74 |
type="password"
|
| 75 |
+
className={styles.password}
|
| 76 |
placeholder={Locale.User.Password}
|
| 77 |
onInput={(e) => onPassword(e.currentTarget.value)}
|
| 78 |
value={password}
|
app/components/register.module.scss
CHANGED
|
@@ -6,6 +6,22 @@
|
|
| 6 |
-moz-appearance: none;
|
| 7 |
appearance: none;
|
| 8 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
background-color: var(--white);
|
| 10 |
color: var(--black);
|
| 11 |
text-align: left;
|
|
@@ -105,4 +121,4 @@
|
|
| 105 |
.title{
|
| 106 |
font-size: 4px;
|
| 107 |
color: red;
|
| 108 |
-
}
|
|
|
|
| 6 |
-moz-appearance: none;
|
| 7 |
appearance: none;
|
| 8 |
cursor: pointer;
|
| 9 |
+
width: 163px;
|
| 10 |
+
background-color: var(--white);
|
| 11 |
+
color: var(--black);
|
| 12 |
+
text-align: left;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
.password{
|
| 16 |
+
border: var(--border-in-light);
|
| 17 |
+
padding: 10px;
|
| 18 |
+
border-radius: 10px;
|
| 19 |
+
-webkit-appearance: none;
|
| 20 |
+
-moz-appearance: none;
|
| 21 |
+
appearance: none;
|
| 22 |
+
cursor: pointer;
|
| 23 |
+
max-width: 60% !important;
|
| 24 |
+
width: 183px;
|
| 25 |
background-color: var(--white);
|
| 26 |
color: var(--black);
|
| 27 |
text-align: left;
|
|
|
|
| 121 |
.title{
|
| 122 |
font-size: 4px;
|
| 123 |
color: red;
|
| 124 |
+
}
|
app/components/register.tsx
CHANGED
|
@@ -3,12 +3,12 @@ import Locale, { AllLangs, changeLang, getLang } from "../locales";
|
|
| 3 |
import { useUserStore } from "../store";
|
| 4 |
import { useEffect, useState } from "react";
|
| 5 |
import styles from "./register.module.scss";
|
| 6 |
-
import ChatIcon from "../icons/chatgpt.svg"
|
| 7 |
import { IconButton } from "./button";
|
| 8 |
import { showToast } from "./ui-lib";
|
| 9 |
|
| 10 |
-
export function Register(){
|
| 11 |
-
const userStore=useUserStore()
|
| 12 |
const [userName, setUserName] = useState("");
|
| 13 |
const [getcode, setgetcode] = useState("");
|
| 14 |
const [codeStatus, setcodeStatus] = useState("");
|
|
@@ -19,62 +19,60 @@ export function Register(){
|
|
| 19 |
const [status, setStatus] = useState("");
|
| 20 |
|
| 21 |
const onUserName = (text: string) => {
|
| 22 |
-
setUserName(text)
|
| 23 |
};
|
| 24 |
const onName = (text: string) => {
|
| 25 |
-
setName(text)
|
| 26 |
};
|
| 27 |
const onPassword = (text: string) => {
|
| 28 |
-
setPassword(text)
|
| 29 |
};
|
| 30 |
const onMail = (text: string) => {
|
| 31 |
-
setMail(text)
|
| 32 |
};
|
| 33 |
const onCode = (text: string) => {
|
| 34 |
-
setCode(text)
|
| 35 |
};
|
| 36 |
|
| 37 |
-
const registerTo=()=>{
|
| 38 |
-
userStore.register(userName,password,name,mail,code)
|
| 39 |
-
setStatus("false")
|
| 40 |
-
setTimeout(()=>{
|
| 41 |
-
setStatus("")
|
| 42 |
-
},4000)
|
| 43 |
-
}
|
| 44 |
|
| 45 |
-
const getMailCode=()=>{
|
| 46 |
-
userStore.getMailCode(mail)
|
| 47 |
-
getCode()
|
| 48 |
-
}
|
| 49 |
-
var countdown=60;
|
| 50 |
-
const getCode=()=>{
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
}
|
| 65 |
|
| 66 |
-
useEffect(()=>{
|
| 67 |
-
setcodeStatus("")
|
| 68 |
-
setgetcode("发送验证码")
|
| 69 |
-
},[])
|
| 70 |
|
| 71 |
return (
|
| 72 |
<ErrorBoundary>
|
| 73 |
<div className="window-header">
|
| 74 |
<div className="window-header-title">
|
| 75 |
-
<div className="window-header-main-title">
|
| 76 |
-
{Locale.User.Register}
|
| 77 |
-
</div>
|
| 78 |
<div className="window-header-sub-title">
|
| 79 |
{Locale.User.RegisterTitle}
|
| 80 |
</div>
|
|
@@ -83,7 +81,9 @@ export function Register(){
|
|
| 83 |
|
| 84 |
<div>
|
| 85 |
<div className={styles.register}>
|
| 86 |
-
<div>
|
|
|
|
|
|
|
| 87 |
{/* <div className={styles.title}>账号为QQ号将自动绑定QQ邮箱方便找回密码</div> */}
|
| 88 |
<div>
|
| 89 |
<input
|
|
@@ -106,7 +106,7 @@ export function Register(){
|
|
| 106 |
<div>
|
| 107 |
<input
|
| 108 |
type="password"
|
| 109 |
-
className={styles.
|
| 110 |
placeholder={Locale.User.Password}
|
| 111 |
onInput={(e) => onPassword(e.currentTarget.value)}
|
| 112 |
value={password}
|
|
@@ -133,22 +133,26 @@ export function Register(){
|
|
| 133 |
disabled={!!codeStatus}
|
| 134 |
text={getcode}
|
| 135 |
className={styles.codeButton}
|
| 136 |
-
onClick={()=>{
|
| 137 |
-
getMailCode()
|
| 138 |
}}
|
| 139 |
></IconButton>
|
| 140 |
</div>
|
| 141 |
<div>
|
| 142 |
-
<span className={styles.wangji}>
|
| 143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
</div>
|
| 145 |
<div>
|
| 146 |
<IconButton
|
| 147 |
text={Locale.User.Register}
|
| 148 |
disabled={!!status}
|
| 149 |
className={styles.registerButton}
|
| 150 |
-
onClick={()=>{
|
| 151 |
-
registerTo()
|
| 152 |
}}
|
| 153 |
></IconButton>
|
| 154 |
</div>
|
|
@@ -156,4 +160,4 @@ export function Register(){
|
|
| 156 |
</div>
|
| 157 |
</ErrorBoundary>
|
| 158 |
);
|
| 159 |
-
}
|
|
|
|
| 3 |
import { useUserStore } from "../store";
|
| 4 |
import { useEffect, useState } from "react";
|
| 5 |
import styles from "./register.module.scss";
|
| 6 |
+
import ChatIcon from "../icons/chatgpt.svg";
|
| 7 |
import { IconButton } from "./button";
|
| 8 |
import { showToast } from "./ui-lib";
|
| 9 |
|
| 10 |
+
export function Register() {
|
| 11 |
+
const userStore = useUserStore();
|
| 12 |
const [userName, setUserName] = useState("");
|
| 13 |
const [getcode, setgetcode] = useState("");
|
| 14 |
const [codeStatus, setcodeStatus] = useState("");
|
|
|
|
| 19 |
const [status, setStatus] = useState("");
|
| 20 |
|
| 21 |
const onUserName = (text: string) => {
|
| 22 |
+
setUserName(text);
|
| 23 |
};
|
| 24 |
const onName = (text: string) => {
|
| 25 |
+
setName(text);
|
| 26 |
};
|
| 27 |
const onPassword = (text: string) => {
|
| 28 |
+
setPassword(text);
|
| 29 |
};
|
| 30 |
const onMail = (text: string) => {
|
| 31 |
+
setMail(text);
|
| 32 |
};
|
| 33 |
const onCode = (text: string) => {
|
| 34 |
+
setCode(text);
|
| 35 |
};
|
| 36 |
|
| 37 |
+
const registerTo = () => {
|
| 38 |
+
userStore.register(userName, password, name, mail, code);
|
| 39 |
+
setStatus("false");
|
| 40 |
+
setTimeout(() => {
|
| 41 |
+
setStatus("");
|
| 42 |
+
}, 4000);
|
| 43 |
+
};
|
| 44 |
|
| 45 |
+
const getMailCode = () => {
|
| 46 |
+
userStore.getMailCode(mail);
|
| 47 |
+
getCode();
|
| 48 |
+
};
|
| 49 |
+
var countdown = 60;
|
| 50 |
+
const getCode = () => {
|
| 51 |
+
if (countdown == 0) {
|
| 52 |
+
setcodeStatus("");
|
| 53 |
+
setgetcode("发送验证码");
|
| 54 |
+
countdown = 60;
|
| 55 |
+
return;
|
| 56 |
+
} else {
|
| 57 |
+
setcodeStatus("true");
|
| 58 |
+
setgetcode("(" + countdown + ")");
|
| 59 |
+
countdown--;
|
| 60 |
+
}
|
| 61 |
+
setTimeout(function () {
|
| 62 |
+
getCode();
|
| 63 |
+
}, 1000);
|
| 64 |
+
};
|
| 65 |
|
| 66 |
+
useEffect(() => {
|
| 67 |
+
setcodeStatus("");
|
| 68 |
+
setgetcode("发送验证码");
|
| 69 |
+
}, []);
|
| 70 |
|
| 71 |
return (
|
| 72 |
<ErrorBoundary>
|
| 73 |
<div className="window-header">
|
| 74 |
<div className="window-header-title">
|
| 75 |
+
<div className="window-header-main-title">{Locale.User.Register}</div>
|
|
|
|
|
|
|
| 76 |
<div className="window-header-sub-title">
|
| 77 |
{Locale.User.RegisterTitle}
|
| 78 |
</div>
|
|
|
|
| 81 |
|
| 82 |
<div>
|
| 83 |
<div className={styles.register}>
|
| 84 |
+
<div>
|
| 85 |
+
<ChatIcon></ChatIcon>
|
| 86 |
+
</div>
|
| 87 |
{/* <div className={styles.title}>账号为QQ号将自动绑定QQ邮箱方便找回密码</div> */}
|
| 88 |
<div>
|
| 89 |
<input
|
|
|
|
| 106 |
<div>
|
| 107 |
<input
|
| 108 |
type="password"
|
| 109 |
+
className={styles.password}
|
| 110 |
placeholder={Locale.User.Password}
|
| 111 |
onInput={(e) => onPassword(e.currentTarget.value)}
|
| 112 |
value={password}
|
|
|
|
| 133 |
disabled={!!codeStatus}
|
| 134 |
text={getcode}
|
| 135 |
className={styles.codeButton}
|
| 136 |
+
onClick={() => {
|
| 137 |
+
getMailCode();
|
| 138 |
}}
|
| 139 |
></IconButton>
|
| 140 |
</div>
|
| 141 |
<div>
|
| 142 |
+
<span className={styles.wangji}>
|
| 143 |
+
<a href="/#/findpwd">{Locale.User.Findpwd}</a>
|
| 144 |
+
</span>
|
| 145 |
+
<span className={styles.zhuce}>
|
| 146 |
+
<a href="/#/login">{Locale.User.Login}</a>
|
| 147 |
+
</span>
|
| 148 |
</div>
|
| 149 |
<div>
|
| 150 |
<IconButton
|
| 151 |
text={Locale.User.Register}
|
| 152 |
disabled={!!status}
|
| 153 |
className={styles.registerButton}
|
| 154 |
+
onClick={() => {
|
| 155 |
+
registerTo();
|
| 156 |
}}
|
| 157 |
></IconButton>
|
| 158 |
</div>
|
|
|
|
| 160 |
</div>
|
| 161 |
</ErrorBoundary>
|
| 162 |
);
|
| 163 |
+
}
|