diff --git a/api/modules/realname.js b/api/modules/realname.js
index 299e825..80c2285 100644
--- a/api/modules/realname.js
+++ b/api/modules/realname.js
@@ -1,11 +1,12 @@
import request from '@/utils/request.js';
export const realnameApi = {
- getLink(identifier, iccid) {
+ getLink(identifier, iccid, options = {}) {
return request({
url: '/api/c/v1/realname/link',
method: 'GET',
- data: { identifier, iccid }
+ data: { identifier, iccid },
+ ...options
});
}
-};
\ No newline at end of file
+};
diff --git a/index.html b/index.html
index 95303c1..a0dda04 100644
--- a/index.html
+++ b/index.html
@@ -6,6 +6,7 @@
+
diff --git a/pages/auth/auth.vue b/pages/auth/auth.vue
index 930d062..6c0e046 100644
--- a/pages/auth/auth.vue
+++ b/pages/auth/auth.vue
@@ -114,22 +114,25 @@
};
const doRealName = async () => {
+ const iccid = currentModalIccid.value;
+ closeModal();
+
try {
- const data = await realnameApi.getLink(userStore.state.identifier, currentModalIccid.value);
+ const data = await realnameApi.getLink(userStore.state.identifier, iccid, { showError: false });
if (data.realname_url) {
uni.setClipboardData({
- data: currentModalIccid.value,
+ data: iccid,
success: () => {
uni.showToast({ title: 'ICCID已复制', icon: 'success' });
}
});
- closeModal();
setTimeout(() => {
window.location.href = data.realname_url;
}, 1500);
}
} catch (e) {
console.error('获取实名链接失败', e);
+ uni.showToast({ title: e?.msg || '获取实名链接失败', icon: 'none' });
}
};
diff --git a/pages/switch/switch.vue b/pages/switch/switch.vue
index a68b777..6c51ae5 100644
--- a/pages/switch/switch.vue
+++ b/pages/switch/switch.vue
@@ -35,6 +35,20 @@
切换此运营商
+
+ 去实名
+
+
+
+
+
+
+ ✕
+
+ 实名认证
+ {{ currentModalIccid }}
+ 点击复制ICCID并跳转实名
+
@@ -42,7 +56,7 @@