增加 demo 环境变量

This commit is contained in:
whyour
2023-06-10 22:20:19 +08:00
parent 4ce01c5f0e
commit 4cf64e7af0
3 changed files with 11 additions and 3 deletions
+9 -2
View File
@@ -18,6 +18,7 @@ import { SharedContext } from '@/layouts';
const FormItem = Form.Item;
const { Countdown } = Statistic;
const isDemoEnv = window.__ENV__DeployEnv === 'demo';
const Login = () => {
const { reloadUser } = useOutletContext<SharedContext>();
@@ -169,10 +170,16 @@ const Login = () => {
) : (
<Form layout="vertical" onFinish={handleOk}>
<FormItem name="username" label="用户名" hasFeedback>
<Input placeholder="用户名" autoFocus />
<Input
placeholder={`用户名${isDemoEnv ? ': admin' : ''}`}
autoFocus
/>
</FormItem>
<FormItem name="password" label="密码" hasFeedback>
<Input type="password" placeholder="密码" />
<Input
type="password"
placeholder={`密码${isDemoEnv ? ': 123' : ''}`}
/>
</FormItem>
<Row>
{waitTime ? (