Showing
3 changed files
with
12 additions
and
6 deletions
| 1 | -import { Logger, EmitterEventId, EmitterUtils } from 'wdKit' | 1 | +import { Logger, EmitterEventId, EmitterUtils, DateTimeUtils } from 'wdKit' |
| 2 | import { CustomProtocolDialog } from './CustomProtocolDialog' | 2 | import { CustomProtocolDialog } from './CustomProtocolDialog' |
| 3 | import router from '@ohos.router' | 3 | import router from '@ohos.router' |
| 4 | import { LoginViewModel } from './LoginViewModel' | 4 | import { LoginViewModel } from './LoginViewModel' |
| @@ -45,6 +45,7 @@ struct LoginPage { | @@ -45,6 +45,7 @@ struct LoginPage { | ||
| 45 | @State checkCodePage: boolean = true //判断是否是验证码页面 默认验证码登录 | 45 | @State checkCodePage: boolean = true //判断是否是验证码页面 默认验证码登录 |
| 46 | @State passwordSwitch: boolean = true //密码显示 | 46 | @State passwordSwitch: boolean = true //密码显示 |
| 47 | // @State isPasswordSubmit: boolean = false //账户密码状态 是否出发登录 | 47 | // @State isPasswordSubmit: boolean = false //账户密码状态 是否出发登录 |
| 48 | + lastTime: number = 0 | ||
| 48 | 49 | ||
| 49 | dialogController: CustomDialogController = new CustomDialogController({ | 50 | dialogController: CustomDialogController = new CustomDialogController({ |
| 50 | builder: CustomProtocolDialog({ | 51 | builder: CustomProtocolDialog({ |
| @@ -136,7 +137,12 @@ struct LoginPage { | @@ -136,7 +137,12 @@ struct LoginPage { | ||
| 136 | if (!this.isSubmit) { | 137 | if (!this.isSubmit) { |
| 137 | return | 138 | return |
| 138 | } | 139 | } |
| 139 | - this.loginSubmit() | 140 | + let currentTime = DateTimeUtils.getTimeStamp() |
| 141 | + if (currentTime - this.lastTime > 500) { | ||
| 142 | + this.lastTime = currentTime | ||
| 143 | + this.loginSubmit() | ||
| 144 | + } | ||
| 145 | + | ||
| 140 | 146 | ||
| 141 | }) | 147 | }) |
| 142 | }.padding({ left: 25, right: 25 }).width('100%') | 148 | }.padding({ left: 25, right: 25 }).width('100%') |
-
Please register or login to post a comment