From c22165a8f44ed98350f8238ab978db22a81b2923 Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Tue, 5 Sep 2023 15:35:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 8 ++++---- src/components/Setting/components/User.vue | 30 ++++++++++++++++++++++++++---- src/mock/command.js | 1 + 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/.env b/.env index c4ae906..fe3f0dd 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ -# VITE_BASE_WS1_URL=ws://192.168.8.10:19001/ -# VITE_BASE_WS2_URL=ws://192.168.8.10:19002/ +VITE_BASE_WS1_URL=ws://192.168.8.10:19001/ +VITE_BASE_WS2_URL=ws://192.168.8.10:19002/ -VITE_BASE_WS1_URL=ws://127.0.0.1:19001/ -VITE_BASE_WS2_URL=ws://127.0.0.1:19002/ \ No newline at end of file +# VITE_BASE_WS1_URL=ws://127.0.0.1:19001/ +# VITE_BASE_WS2_URL=ws://127.0.0.1:19002/ \ No newline at end of file diff --git a/src/components/Setting/components/User.vue b/src/components/Setting/components/User.vue index 2d46137..1a9023a 100644 --- a/src/components/Setting/components/User.vue +++ b/src/components/Setting/components/User.vue @@ -3,8 +3,9 @@

添加新用户

- + @@ -13,12 +14,12 @@ class="eye" @click="handleAddPasswordShow" /> -

*用户名限制信息

-

*用户名限制信息

+
返回
-
添加
+
添加
@@ -136,6 +137,7 @@ import { updateUserPermissionLevelJSON, delUserJSON, addUserJson, + getAllUserJSON, } from '@/mock/command' const showkeyboard = ref(false) @@ -150,6 +152,9 @@ const onChange = a => { updateUserNewPassword.value = a } +const newUserUserName = ref('') +const newUserPassword = ref('') + const userStore = useUserStore() const webSocketStore = useWebSocketStore() const userFormVisible = ref(false) @@ -230,12 +235,29 @@ const hideUserModal = () => { userModalVisible.value = false } +const getAllUser = () => { + webSocketStore.sendCommandMsg(getAllUserJSON) +} + const handleOk = () => { if (userModalFlag.value == 1) { // 删除 + webSocketStore.sendCommandMsg(delUserJSON(currDelUserId.value)) } else { // 修改 + webSocketStore.sendCommandMsg( + updateUserPermissionLevelJSON(currDelUserId.value), + ) } + getAllUser() +} + +const addNewUserFunc = () => { + webSocketStore.sendCommandMsg( + addUserJson(newUserUserName.value, newUserPassword.value), + ) + getAllUser() + returnList() } diff --git a/src/mock/command.js b/src/mock/command.js index 34c87ef..c1aa184 100644 --- a/src/mock/command.js +++ b/src/mock/command.js @@ -192,6 +192,7 @@ export const addUserJson = (uid, passwd) => { messageId: 'addUser', uid, passwd, + permission_level: 3, } }