|
@@ -4,26 +4,21 @@
|
|
|
<div class="login-logo">
|
|
<div class="login-logo">
|
|
|
<img :src="'./img/login-logo.png'" />
|
|
<img :src="'./img/login-logo.png'" />
|
|
|
</div>
|
|
</div>
|
|
|
- <Form ref="formRef" class="login-form" @submit="formSubmit">
|
|
|
|
|
|
|
+ <Form ref="formRef" class="login-form" @submit="formValidate">
|
|
|
<CellGroup inset>
|
|
<CellGroup inset>
|
|
|
- <Field v-model="formData.userName" name="account" label="账号登录" label-align="top" size="large" placeholder="请输入登录账号/手机号"
|
|
|
|
|
- :rules="[{ required: true, message: '请输入账号登录' }]" />
|
|
|
|
|
|
|
+ <Field v-model="formData.userName" name="account" label="账号登录" label-align="top" size="large"
|
|
|
|
|
+ placeholder="请输入登录账号/手机号" :rules="[{ required: true, message: '请输入账号登录' }]" />
|
|
|
<Field v-model="formData.password" name="password" type="password" label="密码" label-align="top" size="large"
|
|
<Field v-model="formData.password" name="password" type="password" label="密码" label-align="top" size="large"
|
|
|
placeholder="请输入密码" :rules="[{ required: true, message: '请输入密码' }]" autocomplete="off" />
|
|
placeholder="请输入密码" :rules="[{ required: true, message: '请输入密码' }]" autocomplete="off" />
|
|
|
- <!-- <Field>
|
|
|
|
|
- <template #input>
|
|
|
|
|
- <SliderVerify @statu="slide" style="max-width: 100%;margin: auto;" v-if="showSliderVerify" />
|
|
|
|
|
- </template>
|
|
|
|
|
- </Field> -->
|
|
|
|
|
</CellGroup>
|
|
</CellGroup>
|
|
|
</Form>
|
|
</Form>
|
|
|
<div class="login-link">
|
|
<div class="login-link">
|
|
|
<span @click="navigationTo('user-register')">用户注册</span>
|
|
<span @click="navigationTo('user-register')">用户注册</span>
|
|
|
<span @click="navigationTo('user-forget')">忘记密码</span>
|
|
<span @click="navigationTo('user-forget')">忘记密码</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="login-submit">
|
|
|
|
|
|
|
+ <ClickVerify class="login-submit" v-model:show="showClickVerify" @success="formSubmit">
|
|
|
<Button type="primary" native-type="submit" @click="formRef?.submit" round block>登录</Button>
|
|
<Button type="primary" native-type="submit" @click="formRef?.submit" round block>登录</Button>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </ClickVerify>
|
|
|
<div class="login-footer">
|
|
<div class="login-footer">
|
|
|
<div class="login-footer__trem">
|
|
<div class="login-footer__trem">
|
|
|
<Checkbox shape="square" icon-size="16px" v-model="checked">我已阅读并同意</Checkbox>
|
|
<Checkbox shape="square" icon-size="16px" v-model="checked">我已阅读并同意</Checkbox>
|
|
@@ -48,14 +43,13 @@ import { useLogin } from '@/business/login'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
import service from '@/services'
|
|
import service from '@/services'
|
|
|
import plus from '@/utils/h5plus'
|
|
import plus from '@/utils/h5plus'
|
|
|
-import SliderVerify from '@/components/base/slider-verify/index.vue' // 临时调用,待优化
|
|
|
|
|
|
|
+import ClickVerify from '@mobile/components/base/click-verify/index.vue'
|
|
|
|
|
|
|
|
const { routerBack, setGlobalUrlParams, routerTo } = useNavigation()
|
|
const { routerBack, setGlobalUrlParams, routerTo } = useNavigation()
|
|
|
const { formData, userLogin } = useLogin()
|
|
const { formData, userLogin } = useLogin()
|
|
|
const formRef = shallowRef<FormInstance>()
|
|
const formRef = shallowRef<FormInstance>()
|
|
|
const checked = shallowRef(false) // 是否同意协议管理
|
|
const checked = shallowRef(false) // 是否同意协议管理
|
|
|
-const showSliderVerify = shallowRef(true) // 验证滑块组件重载
|
|
|
|
|
-const sliderVerifyStatus = shallowRef(true) // 滑块验证状态
|
|
|
|
|
|
|
+const showClickVerify = shallowRef(false) // 显示验证窗口
|
|
|
|
|
|
|
|
const meta = document.getElementsByTagName('meta')
|
|
const meta = document.getElementsByTagName('meta')
|
|
|
const appVersion = meta.namedItem('revised')?.content ?? '0'
|
|
const appVersion = meta.namedItem('revised')?.content ?? '0'
|
|
@@ -72,44 +66,33 @@ const navigationTo = (name: string) => {
|
|
|
}, '加载中...')
|
|
}, '加载中...')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// 滑块验证
|
|
|
|
|
-const slide = (vfcStatu: { statu: string }) => {
|
|
|
|
|
- if (vfcStatu.statu === 'success') {
|
|
|
|
|
- sliderVerifyStatus.value = true
|
|
|
|
|
|
|
+// 表单验证
|
|
|
|
|
+const formValidate = () => {
|
|
|
|
|
+ if (checked.value) {
|
|
|
|
|
+ showClickVerify.value = true
|
|
|
} else {
|
|
} else {
|
|
|
- sliderVerifyStatus.value = false
|
|
|
|
|
|
|
+ showToast('请先同意使用条款')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 表单提交
|
|
|
const formSubmit = () => {
|
|
const formSubmit = () => {
|
|
|
- if (sliderVerifyStatus.value) {
|
|
|
|
|
- if (checked.value) {
|
|
|
|
|
- fullloading((hideLoading) => {
|
|
|
|
|
- userLogin().then((forcedPasswordChange) => {
|
|
|
|
|
- hideLoading()
|
|
|
|
|
- if (forcedPasswordChange) {
|
|
|
|
|
- dialog('为了您的账户安全,请修改密码!').then(() => {
|
|
|
|
|
- setGlobalUrlParams({ forcedPasswordChange })
|
|
|
|
|
- routerTo('user-password', true)
|
|
|
|
|
- })
|
|
|
|
|
- } else {
|
|
|
|
|
- routerBack()
|
|
|
|
|
- }
|
|
|
|
|
- }).catch((err) => {
|
|
|
|
|
- showSliderVerify.value = false
|
|
|
|
|
- sliderVerifyStatus.value = false
|
|
|
|
|
- formData.password = ''
|
|
|
|
|
- showFailToast(err)
|
|
|
|
|
-
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- showSliderVerify.value = true
|
|
|
|
|
- }, 0)
|
|
|
|
|
|
|
+ fullloading((hideLoading) => {
|
|
|
|
|
+ userLogin().then((forcedPasswordChange) => {
|
|
|
|
|
+ hideLoading()
|
|
|
|
|
+ if (forcedPasswordChange) {
|
|
|
|
|
+ dialog('为了您的账户安全,请修改密码!').then(() => {
|
|
|
|
|
+ setGlobalUrlParams({ forcedPasswordChange })
|
|
|
|
|
+ routerTo('user-password', true)
|
|
|
})
|
|
})
|
|
|
- }, '登录中...')
|
|
|
|
|
- } else {
|
|
|
|
|
- showToast('请先同意使用条款')
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ routerBack()
|
|
|
|
|
+ }
|
|
|
|
|
+ }).catch((err) => {
|
|
|
|
|
+ formData.password = ''
|
|
|
|
|
+ showFailToast(err)
|
|
|
|
|
+ })
|
|
|
|
|
+ }, '登录中...')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
onMounted(() => plus.setStatusBarStyle('dark'))
|
|
onMounted(() => plus.setStatusBarStyle('dark'))
|