|
@@ -1,6 +1,7 @@
|
|
|
import ColHeader from '@/components/col-header'
|
|
|
import request from '@/helpers/request'
|
|
|
import { setAuth } from '@/helpers/utils'
|
|
|
+import ImgCode from '@/components/col-img-code'
|
|
|
import { Button, NumberKeyboard, PasswordInput, Toast } from 'vant'
|
|
|
import { defineComponent } from 'vue'
|
|
|
import styles from './index.module.less'
|
|
@@ -17,10 +18,11 @@ export default defineComponent({
|
|
|
data() {
|
|
|
return {
|
|
|
smsCode: '',
|
|
|
- showKeyboard: true,
|
|
|
+ showKeyboard: false,
|
|
|
countDownStatus: true,
|
|
|
countDownTime: 120, // 倒计时时间
|
|
|
- countTimer: null as any
|
|
|
+ countTimer: null as any,
|
|
|
+ imgCodeStatus: false
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -32,7 +34,8 @@ export default defineComponent({
|
|
|
},
|
|
|
async mounted() {
|
|
|
this.$nextTick(async () => {
|
|
|
- await this.onSendSms()
|
|
|
+ // await this.onSendSms()
|
|
|
+ this.imgCodeStatus = true
|
|
|
})
|
|
|
},
|
|
|
unmounted() {
|
|
@@ -69,7 +72,7 @@ export default defineComponent({
|
|
|
},
|
|
|
async onLogin() {
|
|
|
try {
|
|
|
- let res = await request.post('/api-auth/smsLogin', {
|
|
|
+ const res = await request.post('/api-auth/smsLogin', {
|
|
|
requestType: 'form',
|
|
|
data: {
|
|
|
clientId: 'student',
|
|
@@ -130,6 +133,17 @@ export default defineComponent({
|
|
|
</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ {this.imgCodeStatus ? (
|
|
|
+ <ImgCode
|
|
|
+ v-model:value={this.imgCodeStatus}
|
|
|
+ phone={this.$props.phone}
|
|
|
+ onClose={() => {
|
|
|
+ this.imgCodeStatus = false
|
|
|
+ }}
|
|
|
+ onSendCode={this.onCountDown}
|
|
|
+ />
|
|
|
+ ) : null}
|
|
|
</>
|
|
|
)
|
|
|
}
|