|
@@ -48,7 +48,14 @@ import Snackbar from '@/plugins/snackbar'
|
|
|
|
|
|
const emits = defineEmits(['handleEnter'])
|
|
|
const { t } = useI18n()
|
|
|
-const props = defineProps({ phoneDisabled: Boolean, phone: String })
|
|
|
+const props = defineProps({
|
|
|
+ phoneDisabled: Boolean,
|
|
|
+ phone: String,
|
|
|
+ scene: { // 短信验证码scene参数: 30-手机号登陆 31-修改手机 32-修改密码 33-忘记密码
|
|
|
+ type: [Number, String],
|
|
|
+ default: 30
|
|
|
+ }
|
|
|
+})
|
|
|
const phoneRules = ref([
|
|
|
value => {
|
|
|
if (value) return true
|
|
@@ -93,11 +100,11 @@ const handleCode = () => {
|
|
|
setTime()
|
|
|
getSmsCode()
|
|
|
}
|
|
|
-// 短信验证码scene参数: 30-手机号登陆 31-修改手机 32-修改密码 33-忘记密码
|
|
|
+
|
|
|
const getSmsCode = async () => {
|
|
|
const query = {
|
|
|
phone: loginData.phone,
|
|
|
- scene: 30
|
|
|
+ scene: props.scene ? props.scene-0 : 30
|
|
|
}
|
|
|
// try {
|
|
|
await sendSmsCode(query)
|