|
|
@@ -1,53 +1,67 @@
|
|
|
<template>
|
|
|
- <div class="login">
|
|
|
- <a-row type="flex" justify="center" align="middle">
|
|
|
- <a-col>
|
|
|
- <div class="login-background">
|
|
|
- <div>
|
|
|
- <img src="@/assets/images/logo.png" @click="qtAction('ok')" alt="" />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="login-content">
|
|
|
- <p>账号登录</p>
|
|
|
- <a-form ref="formDom" :model="form" :rules="rules">
|
|
|
- <a-form-item name="account">
|
|
|
- <a-input placeholder="用户名/账号/手机号" v-model:value="form.account">
|
|
|
- <template #prefix>
|
|
|
- <img src="@/assets/images/user.png" alt="" />
|
|
|
- </template>
|
|
|
- </a-input>
|
|
|
- </a-form-item>
|
|
|
- <a-form-item name="password">
|
|
|
- <a-input @keyup.enter="loginAction" placeholder="请输入您的登录密码" type="password" v-model:value="form.password">
|
|
|
- <template #prefix>
|
|
|
- <img src="@/assets/images/password.png" alt="" />
|
|
|
- </template>
|
|
|
- </a-input>
|
|
|
- </a-form-item>
|
|
|
- <a-form-item>
|
|
|
- <div class="login-remember-password">
|
|
|
- <a-checkbox v-model:checked="form.isRemember">
|
|
|
- 记住账号
|
|
|
- </a-checkbox>
|
|
|
- <router-link to="/resetPassword">忘记密码?</router-link>
|
|
|
- </div>
|
|
|
- </a-form-item>
|
|
|
- <a-form-item>
|
|
|
- <div style="text-align:left">
|
|
|
- <a-checkbox v-model:checked="form.isRead">
|
|
|
- 我已阅读并同意
|
|
|
- </a-checkbox>
|
|
|
- <router-link to="/resetPassword">《用户协议》</router-link>
|
|
|
- </div>
|
|
|
- </a-form-item>
|
|
|
- <a-form-item>
|
|
|
- <a-button @click="loginAction" :loading="loading" :disabled="goHomeloading">登录</a-button>
|
|
|
- </a-form-item>
|
|
|
- </a-form>
|
|
|
- </div>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
- </div>
|
|
|
+ <div class="login">
|
|
|
+ <a-row type="flex"
|
|
|
+ justify="center"
|
|
|
+ align="middle">
|
|
|
+ <a-col>
|
|
|
+ <div class="login-background">
|
|
|
+ <div>
|
|
|
+ <img src="@/assets/images/logo.png"
|
|
|
+ @click="qtAction('ok')"
|
|
|
+ alt="" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="login-content">
|
|
|
+ <p>账号登录</p>
|
|
|
+ <a-form ref="formDom"
|
|
|
+ :model="form"
|
|
|
+ :rules="rules">
|
|
|
+ <a-form-item name="account">
|
|
|
+ <a-input placeholder="用户名/账号/手机号"
|
|
|
+ v-model:value="form.account">
|
|
|
+ <template #prefix>
|
|
|
+ <img src="@/assets/images/user.png"
|
|
|
+ alt="" />
|
|
|
+ </template>
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item name="password">
|
|
|
+ <a-input @keyup.enter="loginAction"
|
|
|
+ placeholder="请输入您的登录密码"
|
|
|
+ type="password"
|
|
|
+ v-model:value="form.password">
|
|
|
+ <template #prefix>
|
|
|
+ <img src="@/assets/images/password.png"
|
|
|
+ alt="" />
|
|
|
+ </template>
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item>
|
|
|
+ <div class="login-remember-password">
|
|
|
+ <a-checkbox v-model:checked="form.isRemember">
|
|
|
+ 记住账号
|
|
|
+ </a-checkbox>
|
|
|
+ <router-link to="/resetPassword">忘记密码?</router-link>
|
|
|
+ </div>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item>
|
|
|
+ <div style="text-align:left">
|
|
|
+ <a-checkbox v-model:checked="form.isRead">
|
|
|
+ 我已阅读并同意
|
|
|
+ </a-checkbox>
|
|
|
+ <router-link to="/resetPassword">《用户协议》</router-link>
|
|
|
+ </div>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item>
|
|
|
+ <a-button @click="loginAction"
|
|
|
+ :loading="loading"
|
|
|
+ :disabled="goHomeloading">登录</a-button>
|
|
|
+ </a-form-item>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
@@ -60,7 +74,7 @@ import { localStorageUtil } from '@/utils/tool/storage/index';
|
|
|
import { setLoadComplete } from '@/setup/methods/index';
|
|
|
import eventBus from '@/utils/eventBus/index';
|
|
|
import { QWebChannel } from '@/utils/tool/qwebchannel.js';
|
|
|
-import { qtWebChannel } from '@/main';
|
|
|
+// import { qtWebChannel } from '@/main';
|
|
|
|
|
|
interface Form {
|
|
|
account: string;
|
|
|
@@ -82,6 +96,16 @@ function setRememberAccount(): void {
|
|
|
Object.assign(initForm, { account, isRemember: true });
|
|
|
}
|
|
|
}
|
|
|
+declare global {
|
|
|
+ interface Window {
|
|
|
+ qt: {
|
|
|
+ webChannelTransport: {
|
|
|
+ send: (payload: any) => void;
|
|
|
+ onmessage: (payload: any) => void;
|
|
|
+ };
|
|
|
+ };
|
|
|
+ }
|
|
|
+}
|
|
|
// let qtWebChannel: any = null;
|
|
|
|
|
|
// new QWebChannel(window.qt.webChannelTransport, (channel: any) => {
|
|
|
@@ -92,11 +116,11 @@ function setRememberAccount(): void {
|
|
|
// });
|
|
|
|
|
|
function qtAction(value: any) {
|
|
|
- if (qtWebChannel) {
|
|
|
- qtWebChannel.handleCmd('action');
|
|
|
- } else {
|
|
|
- alert('qtWebChannel is null');
|
|
|
- }
|
|
|
+ // if (qtWebChannel) {
|
|
|
+ // qtWebChannel.handleCmd('action');
|
|
|
+ // } else {
|
|
|
+ // alert('qtWebChannel is null');
|
|
|
+ // }
|
|
|
}
|
|
|
|
|
|
export default defineComponent({
|
|
|
@@ -154,16 +178,16 @@ export default defineComponent({
|
|
|
});
|
|
|
};
|
|
|
onMounted(() => {
|
|
|
- setTimeout(() => {
|
|
|
- if (qtWebChannel) {
|
|
|
- qtWebChannel.operateResult.connect((response: any) => {
|
|
|
- alert(response);
|
|
|
- console.log('response', response);
|
|
|
- });
|
|
|
- } else {
|
|
|
- alert('qtWebChannel is null!!!!');
|
|
|
- }
|
|
|
- });
|
|
|
+ // setTimeout(() => {
|
|
|
+ // if (qtWebChannel) {
|
|
|
+ // qtWebChannel.operateResult.connect((response: any) => {
|
|
|
+ // alert(response);
|
|
|
+ // console.log('response', response);
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // alert('qtWebChannel is null!!!!');
|
|
|
+ // }
|
|
|
+ // });
|
|
|
});
|
|
|
return { qtAction, form, loginAction, rules, formDom, loading, goHomeloading, goHome };
|
|
|
},
|