3
-
创建您的第一个智能工作空间
+
创建您的第一个数字化平台
+
+
+
+
+
+
@@ -198,6 +212,7 @@ import { defineAsyncComponent, h } from 'vue';
import FileUploader from '@/components/FileUploader.vue';
import { confirmDialog, renderDialog } from '../../../utils/components';
import TFADialog from './TFADialog.vue';
+import ResetPasswordDialog from './ResetPasswordDialog.vue';
import router from '../../../router';
import AddPrepaidCreditsDialog from '../../billing/AddPrepaidCreditsDialog.vue';
@@ -205,12 +220,14 @@ export default {
name: 'AccountProfile',
components: {
TFADialog,
+ ResetPasswordDialog,
FileUploader,
AddPrepaidCreditsDialog,
},
data() {
return {
show2FADialog: false,
+ showResetPasswordDialog: false,
disableAccount2FACode: '',
showProfileEditDialog: false,
showEnableAccountDialog: false,
diff --git a/dashboard/src2/components/settings/profile/ResetPasswordDialog.vue b/dashboard/src2/components/settings/profile/ResetPasswordDialog.vue
new file mode 100644
index 0000000..c95d700
--- /dev/null
+++ b/dashboard/src2/components/settings/profile/ResetPasswordDialog.vue
@@ -0,0 +1,302 @@
+
+
+
+
+
diff --git a/dashboard/src2/pages/LoginSignup.vue b/dashboard/src2/pages/LoginSignup.vue
index 896aecf..60c789a 100644
--- a/dashboard/src2/pages/LoginSignup.vue
+++ b/dashboard/src2/pages/LoginSignup.vue
@@ -202,11 +202,16 @@
+
+ 请输入正确的手机号码格式
+
注册
@@ -435,6 +440,7 @@ export default {
passwordStrengthClass: '',
passwordStrengthText: '',
passwordStrengthTextClass: '',
+ phoneNumberFormatError: false,
};
},
mounted() {
@@ -665,6 +671,14 @@ export default {
toast.error('用户名不能为空');
return;
}
+ if (!this.phoneNumber) {
+ toast.error('手机号不能为空');
+ return;
+ }
+ if (!this.isPhoneNumberValid) {
+ toast.error('请输入正确的手机号码格式');
+ return;
+ }
if (!this.signupPassword) {
toast.error('密码不能为空');
return;
@@ -805,6 +819,14 @@ export default {
}
});
},
+ validatePhoneNumber() {
+ // 失焦时验证手机号格式
+ if (this.phoneNumber && this.phoneNumber.length > 0) {
+ this.phoneNumberFormatError = !this.isPhoneNumberValid;
+ } else {
+ this.phoneNumberFormatError = false;
+ }
+ },
},
computed: {
error() {
@@ -928,6 +950,11 @@ export default {
/[A-Z]/.test(this.signupPassword) &&
/[0-9]/.test(this.signupPassword);
},
+ isPhoneNumberValid() {
+ // 中国大陆手机号验证:11位数字,以1开头,第二位为3-9
+ const phoneRegex = /^1[3-9]\d{9}$/;
+ return phoneRegex.test(this.phoneNumber);
+ },
},
};
\ No newline at end of file