diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-04-21 18:30:14 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-04-21 18:30:14 +0300 |
| commit | b0f974a94db8508c7c77db18c89cd0ef3497f879 (patch) | |
| tree | 74bc894455da45eab58a051a81b1ae320ea09254 /web/html/login.html | |
| parent | 6bebde410529c068b2458ee21a03127728a8c6ae (diff) | |
secret token thanks to @HarlyquinForest
Diffstat (limited to 'web/html/login.html')
| -rw-r--r-- | web/html/login.html | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/web/html/login.html b/web/html/login.html index 4218793c..2f4cb3e6 100644 --- a/web/html/login.html +++ b/web/html/login.html @@ -57,6 +57,11 @@ <a-icon slot="prefix" type="lock" style="color: rgba(0,0,0,.25)"/> </a-input> </a-form-item> + <a-form-item v-if="secretEnable"> + <a-input type="text" placeholder='{{ i18n "secretToken" }}' v-model.trim="user.loginSecret" @keydown.enter.native="login"> + <a-icon slot="prefix" type="key" style="color: rgba(0,0,0,.25)"/> + </a-input> + </a-form-item> <a-form-item> <a-button block @click="login" :loading="loading">{{ i18n "login" }}</a-button> </a-form-item> @@ -98,10 +103,12 @@ data: { loading: false, user: new User(), + secretEnable: false, lang : "" }, created(){ this.lang = getLang(); + this.secretEnable = this.getSecretStatus(); }, methods: { async login() { @@ -111,6 +118,15 @@ if (msg.success) { location.href = basePath + 'xui/'; } + }, + async getSecretStatus() { + this.loading= true; + const msg = await HttpUtil.post('/getSecretStatus'); + this.loading = false; + if (msg.success){ + this.secretEnable = msg.obj; + return msg.obj; + } } } }); |
