diff --git a/public/123456789.jpg b/public/123456789.jpg
new file mode 100644
index 0000000..9d5bf70
Binary files /dev/null and b/public/123456789.jpg differ
diff --git a/src/views/management/secure/index.vue b/src/views/management/secure/index.vue
index f87bbe9..f42088f 100644
--- a/src/views/management/secure/index.vue
+++ b/src/views/management/secure/index.vue
@@ -47,7 +47,8 @@
@@ -113,6 +120,7 @@ export default {
isVisible: false,
currentPhone: '',
newPhone: '',
+ phoneError: '',
verificationCode: '',
isCurrentPhoneModalVisible: false,
isVerificationModalVisible: false,
@@ -150,6 +158,16 @@ export default {
this.getUser();
},
methods: {
+ validatePhone() {
+ const phonePattern = /^[0-9]{11}$/; // 只允许11位数字
+ if (!this.newPhone) {
+ this.phoneError = '手机号不能为空';
+ } else if (!phonePattern.test(this.newPhone)) {
+ this.phoneError = '请输入有效的11位手机号';
+ } else {
+ this.phoneError = '';
+ }
+ },
updatePhoneNumber() {
updatePhone(this.newPhone).then(response => {
this.closeNewPhoneModal();