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, } }