@@ -119,24 +119,33 @@ export default {
});
},
+ // 封装输入验证逻辑
+ validateInput(input, message) {
+ if (!input.trim()) {
+ showDanger(message);
+ return false;
+ }
+ return true;
+ },
// 注册逻辑
register() {
- if (!this.form.username.trim()) {
- showDanger('用户名不能为空')
- return
+ // 验证用户名
+ if (!this.validateInput(this.form.username, '用户名不能为空')) {
+ return;
}
- if (!this.form.password.trim()) {
- showDanger('密码不能为空')
- return
+ // 验证密码
+ if (!this.validateInput(this.form.password, '密码不能为空')) {
+ return;
}
if (this.form.password !== this.form.confirmPassword) {
showDanger('两次输入的密码不一致')
return
}
- if (!this.form.captcha.trim()) {
- showDanger('验证码不能为空')
- return
+ // 验证验证码
+ if (!this.validateInput(this.form.captcha, '验证码不能为空')) {
+ return;
}
+
Api.user.register(this.form, ({data}) => {
console.log(data)
if (data.code === 0) {
@@ -159,6 +168,6 @@ export default {
}
-
\ No newline at end of file
+
From 1ad93ce1fdeafffea3e227fba2200aea0d602b37 Mon Sep 17 00:00:00 2001
From: bobo <2602109904@qq.com>
Date: Thu, 20 Mar 2025 16:57:38 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E5=8F=B3=E4=B8=8A=E8=A7=92=E7=94=A8?=
=?UTF-8?q?=E6=88=B7=E5=90=8D=E6=98=BE=E7=A4=BA=EF=BC=8C=E6=96=B0=E5=A2=9E?=
=?UTF-8?q?=E4=B8=8B=E6=8B=89=E8=8F=9C=E5=8D=95=E6=A0=B7=E5=BC=8F=20?=
=?UTF-8?q?=E6=8E=A5=E6=94=B6username=E5=AD=97=E6=AE=B5=E5=B9=B6=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E5=9C=A8=E5=8F=B3=E4=B8=8A=E8=A7=92=E3=80=82=20?=
=?UTF-8?q?=E5=8F=B3=E4=B8=8A=E8=A7=92=E6=B7=BB=E5=8A=A0=E4=BA=86=E4=B8=8B?=
=?UTF-8?q?=E6=8B=89=E8=8F=9C=E5=8D=95=E6=A0=B7=E5=BC=8F=EF=BC=8C=E5=8C=85?=
=?UTF-8?q?=E5=90=AB=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=EF=BC=8C=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E5=AF=86=E7=A0=81=E4=BB=A5=E5=8F=8A=E9=80=80=E5=87=BA?=
=?UTF-8?q?=E7=99=BB=E5=BD=95=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
main/manager-web/src/components/HeaderBar.vue | 48 +++++++++++++------
1 file changed, 34 insertions(+), 14 deletions(-)
diff --git a/main/manager-web/src/components/HeaderBar.vue b/main/manager-web/src/components/HeaderBar.vue
index acc0e981..afd1e1bb 100644
--- a/main/manager-web/src/components/HeaderBar.vue
+++ b/main/manager-web/src/components/HeaderBar.vue
@@ -2,31 +2,39 @@
@@ -43,6 +51,7 @@ export default {
return {
serach: '',
userInfo: {
+ username: '',
mobile: ''
}
}
@@ -71,7 +80,7 @@ export default {
// 当搜索内容为空时,显示原始完整列表
filteredDevices = this.$parent.originalDevices;
} else {
- // 过滤逻辑
+ // 过滤逻辑
filteredDevices = this.devices.filter(device => {
return device.agentName.includes(searchValue) ||
device.ttsModelName.includes(searchValue) ||
@@ -158,6 +167,7 @@ export default {
text-align: left;
color: #3d4566;
}
+
.console {
width: 90px;
height: 22px;
@@ -172,4 +182,14 @@ export default {
gap: 7px;
margin-left: 15px;
}
-
\ No newline at end of file
+
+.el-dropdown-link {
+ cursor: pointer;
+ color: #5778ff;
+}
+
+.el-icon-arrow-down {
+ font-size: 12px;
+}
+
+