update:优化获取手机号

This commit is contained in:
2026-07-06 11:15:38 +08:00
parent d3e0307854
commit 348d490de8
2 changed files with 10 additions and 5 deletions
+6 -5
View File
@@ -11,6 +11,7 @@ import {
loginAPI,
getHomeData,
getPhoneNumberAPI,
getPhoneNumberAPIv2,
getDeviceBatteryAPI,
} from "@/apis";
@@ -43,12 +44,12 @@ const handleAgree = () => {
async function getphonenumber(e) {
if (e.detail.code) {
const wxResult = await wxLogin();
const result = await getPhoneNumberAPI({
...e.detail,
code: wxResult.code,
// const wxResult = await wxLogin();
const result = await getPhoneNumberAPIv2({
// ...e.detail,
code: e.detail.code,
});
if (result.phone) phone.value = result.phone;
if (result.purePhoneNumber) phone.value = result.purePhoneNumber;
}
}