mirror of
https://github.com/whyour/qinglong.git
synced 2025-07-07 11:56:08 +08:00
增加 demo 环境变量
This commit is contained in:
parent
4ce01c5f0e
commit
4cf64e7af0
|
@ -5,7 +5,7 @@ let pickedEnv: Record<string, string>;
|
|||
|
||||
function getPickedEnv() {
|
||||
if (pickedEnv) return pickedEnv;
|
||||
const picked = pick(process.env, ['QlBaseUrl']);
|
||||
const picked = pick(process.env, ['QlBaseUrl', 'DeployEnv']);
|
||||
pickedEnv = picked as Record<string, string>;
|
||||
return picked;
|
||||
}
|
||||
|
|
|
@ -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 ? (
|
||||
|
|
1
typings.d.ts
vendored
1
typings.d.ts
vendored
|
@ -13,4 +13,5 @@ declare module 'pstree.remy';
|
|||
|
||||
interface Window {
|
||||
__ENV__QlBaseUrl: string;
|
||||
__ENV__DeployEnv: string;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user