|
|
|
|
@ -88,8 +88,39 @@ function goToPreview() {
@@ -88,8 +88,39 @@ function goToPreview() {
|
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
isLoading.value = true |
|
|
|
|
if (trialCode.value) { |
|
|
|
|
trialPhone() |
|
|
|
|
} else { |
|
|
|
|
getPid() |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
const trialPhone = async () => { |
|
|
|
|
if (!mobile.value) { |
|
|
|
|
showToast('请输入手机号'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
const mobileReg = /^1[3-9]\d{9}$/; |
|
|
|
|
if (!mobileReg.test(mobile.value)) { |
|
|
|
|
showToast('请输入正确的手机号'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
await badgeApi.trialPhone({ |
|
|
|
|
phone: mobile.value |
|
|
|
|
}).then((res: any) => { |
|
|
|
|
const timestamp = Date.now() |
|
|
|
|
const payload = JSON.stringify({ userId: res, timestamp }) |
|
|
|
|
userId.value = Encrypt(payload) |
|
|
|
|
localStorage.set('userId', userId.value) |
|
|
|
|
getPid() |
|
|
|
|
}).catch((err) => { |
|
|
|
|
showToast({ |
|
|
|
|
message: err.message, |
|
|
|
|
duration: 2000, |
|
|
|
|
}) |
|
|
|
|
}).finally(() => { |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
const picture = ref(null) |
|
|
|
|
function getbase64Data(data) { |
|
|
|
|
picture.value = data; |
|
|
|
|
@ -348,21 +379,6 @@ const onBlur = async () => {
@@ -348,21 +379,6 @@ const onBlur = async () => {
|
|
|
|
|
showToast('请输入正确的手机号'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
await badgeApi.trialPhone({ |
|
|
|
|
phone: mobile.value |
|
|
|
|
}).then((res: any) => { |
|
|
|
|
const timestamp = Date.now() |
|
|
|
|
const payload = JSON.stringify({ userId: res, timestamp }) |
|
|
|
|
userId.value = Encrypt(payload) |
|
|
|
|
localStorage.set('userId', userId.value) |
|
|
|
|
}).catch((err) => { |
|
|
|
|
showToast({ |
|
|
|
|
message: err.message, |
|
|
|
|
duration: 2000, |
|
|
|
|
}) |
|
|
|
|
}).finally(() => { |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
const key = CryptoJS.enc.Utf8.parse("123abcdefpua2025"); |
|
|
|
|
const iv = CryptoJS.enc.Utf8.parse('DYgjCEIMVrj2W9xN'); |
|
|
|
|
|