mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-06 13:05:09 +00:00
feat: QQLogin
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<h2>WebUi Login</h2>
|
||||
<t-form ref="form" :data="formData" :colon="true" :label-width="0" @submit="onSubmit">
|
||||
<t-form-item name="password">
|
||||
<t-input v-model="formData.password" type="password" clearable placeholder="请输入Token">
|
||||
<t-input v-model="formData.token" type="password" clearable placeholder="请输入Token">
|
||||
<template #prefix-icon>
|
||||
<lock-on-icon />
|
||||
</template>
|
||||
@@ -13,7 +13,6 @@
|
||||
<t-button theme="primary" type="submit" block>登录</t-button>
|
||||
</t-form-item>
|
||||
</t-form>
|
||||
<p class="error-message" v-if="errorMessage">{{ errorMessage }}</p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -22,22 +21,16 @@ import { reactive, ref } from 'vue';
|
||||
import { MessagePlugin } from 'tdesign-vue-next';
|
||||
import { LockOnIcon } from 'tdesign-icons-vue-next';
|
||||
|
||||
const formData = reactive({
|
||||
password: '',
|
||||
});
|
||||
|
||||
const errorMessage = ref('');
|
||||
const formData = reactive({
|
||||
token: '',
|
||||
});
|
||||
|
||||
const onSubmit = async ({ validateResult, firstError }) => {
|
||||
if (validateResult === true) {
|
||||
errorMessage.value = '';
|
||||
try {
|
||||
// 处理表单提交逻辑
|
||||
} catch (error) {
|
||||
errorMessage.value = '登录失败,请重试';
|
||||
}
|
||||
MessagePlugin.success('登录中...');
|
||||
} else {
|
||||
errorMessage.value = firstError;
|
||||
MessagePlugin.error('登录失败');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user