From eaaea2b24c2847af0b290575b85389de719626e2 Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Tue, 15 Apr 2025 01:46:36 +0800 Subject: [PATCH] =?UTF-8?q?update:=E6=99=BA=E6=8E=A7=E5=8F=B0=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=89=88=E6=9C=AC=E5=8F=B7=20(#793)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/security/config/ShiroConfig.java | 1 + .../security/controller/LoginController.java | 10 +++++ main/manager-web/src/apis/module/user.js | 18 +++++++- .../src/components/VersionFooter.vue | 39 ++++++++++++++++ .../src/views/DeviceManagement.vue | 25 ++++------- main/manager-web/src/views/ModelConfig.vue | 44 +++++-------------- .../src/views/ParamsManagement.vue | 16 ------- main/manager-web/src/views/UserManagement.vue | 18 +------- main/manager-web/src/views/home.vue | 9 ++-- main/manager-web/src/views/login.vue | 28 +++++++++--- main/manager-web/src/views/register.vue | 8 ++-- main/manager-web/src/views/roleConfig.vue | 3 -- main/xiaozhi-server/config/logger.py | 9 +++- 13 files changed, 126 insertions(+), 102 deletions(-) create mode 100644 main/manager-web/src/components/VersionFooter.vue diff --git a/main/manager-api/src/main/java/xiaozhi/modules/security/config/ShiroConfig.java b/main/manager-api/src/main/java/xiaozhi/modules/security/config/ShiroConfig.java index 7bd356fc..fdcb62b2 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/security/config/ShiroConfig.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/security/config/ShiroConfig.java @@ -76,6 +76,7 @@ public class ShiroConfig { filterMap.put("/favicon.ico", "anon"); filterMap.put("/user/captcha", "anon"); filterMap.put("/user/login", "anon"); + filterMap.put("/user/pub-config", "anon"); filterMap.put("/user/register", "anon"); filterMap.put("/config/server-base", "anon"); filterMap.put("/config/agent-models", "anon"); diff --git a/main/manager-api/src/main/java/xiaozhi/modules/security/controller/LoginController.java b/main/manager-api/src/main/java/xiaozhi/modules/security/controller/LoginController.java index 7db612b5..0ee6a1ce 100644 --- a/main/manager-api/src/main/java/xiaozhi/modules/security/controller/LoginController.java +++ b/main/manager-api/src/main/java/xiaozhi/modules/security/controller/LoginController.java @@ -1,6 +1,8 @@ package xiaozhi.modules.security.controller; import java.io.IOException; +import java.util.HashMap; +import java.util.Map; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -111,4 +113,12 @@ public class LoginController { sysUserTokenService.changePassword(userId, passwordDTO); return new Result<>(); } + + @GetMapping("/pub-config") + @Operation(summary = "公共配置") + public Result> pubConfig() { + Map config = new HashMap<>(); + config.put("version", "0.3.3"); + return new Result>().ok(config); + } } \ No newline at end of file diff --git a/main/manager-web/src/apis/module/user.js b/main/manager-web/src/apis/module/user.js index 748867b2..84d5b7f9 100755 --- a/main/manager-web/src/apis/module/user.js +++ b/main/manager-web/src/apis/module/user.js @@ -106,7 +106,7 @@ export default { }, // 修改用户状态 changeUserStatus(status, userIds, successCallback) { - console.log(555,userIds) + console.log(555, userIds) RequestService.sendRequest() .url(`${getServiceUrl()}/admin/users/changeStatus/${status}`) .method('put') @@ -122,4 +122,20 @@ export default { }) }).send() }, + // 获取公共配置 + getPubConfig(callback) { + RequestService.sendRequest() + .url(`${getServiceUrl()}/user/pub-config`) + .method('GET') + .success((res) => { + RequestService.clearRequestTime(); + callback(res); + }) + .fail((err) => { + console.error('获取公共配置失败:', err); + RequestService.reAjaxFun(() => { + this.getPubConfig(callback); + }); + }).send(); + }, } diff --git a/main/manager-web/src/components/VersionFooter.vue b/main/manager-web/src/components/VersionFooter.vue new file mode 100644 index 00000000..8a8b76a0 --- /dev/null +++ b/main/manager-web/src/components/VersionFooter.vue @@ -0,0 +1,39 @@ + + + + + \ No newline at end of file diff --git a/main/manager-web/src/views/DeviceManagement.vue b/main/manager-web/src/views/DeviceManagement.vue index bffefb07..823bedc6 100644 --- a/main/manager-web/src/views/DeviceManagement.vue +++ b/main/manager-web/src/views/DeviceManagement.vue @@ -4,7 +4,8 @@

设备列表

- + @@ -40,22 +41,17 @@
- {{ isAllSelected ? '取消全选' : '全选' }} + {{ isAllSelected ? '取消全选' : '全选' }} - 新增 + 新增
- @@ -63,9 +59,6 @@
-
@@ -82,7 +75,7 @@ export default { data() { return { addDeviceDialogVisible: false, - selectedDevices: [], + selectedDevices: [], isAllSelected: false, currentAgentId: this.$route.query.agentId || '', currentPage: 1, @@ -99,7 +92,7 @@ export default { return this.deviceList.slice(start, end); }, pageCount() { - return Math.ceil(this.deviceList.length / this.pageSize); + return Math.ceil(this.deviceList.length / this.pageSize); }, visiblePages() { const pages = []; @@ -346,6 +339,4 @@ export default { color: white; } } - - diff --git a/main/manager-web/src/views/ModelConfig.vue b/main/manager-web/src/views/ModelConfig.vue index 343cb06f..2f5a5dae 100644 --- a/main/manager-web/src/views/ModelConfig.vue +++ b/main/manager-web/src/views/ModelConfig.vue @@ -3,21 +3,15 @@
-

{{ modelTypeText }}

+

{{ modelTypeText }}

-
- - - 搜索 - -
+
+ + + 搜索 + +
@@ -93,9 +87,9 @@ @@ -639,20 +629,6 @@ export default { gap: 8px; } -.copyright { - text-align: center; - color: #979db1; - font-size: 12px; - font-weight: 400; - margin-top: auto; - padding: 30px 0 20px; - position: absolute; - bottom: 0; - left: 50%; - transform: translateX(-50%); - width: 100%; -} - .title-wrapper { display: flex; align-items: center; diff --git a/main/manager-web/src/views/ParamsManagement.vue b/main/manager-web/src/views/ParamsManagement.vue index e9baa1e8..02f912a1 100644 --- a/main/manager-web/src/views/ParamsManagement.vue +++ b/main/manager-web/src/views/ParamsManagement.vue @@ -64,8 +64,6 @@ - - @@ -382,20 +380,6 @@ export default { } } -.copyright { - text-align: center; - color: #979db1; - font-size: 12px; - font-weight: 400; - margin-top: auto; - padding: 30px 0 20px; - position: absolute; - bottom: 0; - left: 50%; - transform: translateX(-50%); - width: 100%; -} - .custom-pagination { display: flex; align-items: center; diff --git a/main/manager-web/src/views/UserManagement.vue b/main/manager-web/src/views/UserManagement.vue index 45015d97..617ad04c 100644 --- a/main/manager-web/src/views/UserManagement.vue +++ b/main/manager-web/src/views/UserManagement.vue @@ -42,7 +42,7 @@
- {{ isAllSelected ? '取消全选' : '全选' }} + {{ isAllSelected ? '取消全选' : '全选' }} 启用
- - @@ -465,20 +463,6 @@ export default { color: black; } -.copyright { - text-align: center; - color: #979db1; - font-size: 12px; - font-weight: 400; - margin-top: auto; - padding: 30px 0 20px; - position: absolute; - bottom: 0; - left: 50%; - transform: translateX(-50%); - width: 100%; -} - .custom-pagination { display: flex; align-items: center; diff --git a/main/manager-web/src/views/home.vue b/main/manager-web/src/views/home.vue index 0e9fd32a..5f8115f3 100644 --- a/main/manager-web/src/views/home.vue +++ b/main/manager-web/src/views/home.vue @@ -35,11 +35,11 @@ @deviceManage="handleDeviceManage" @delete="handleDeleteAgent" /> - + + + @@ -49,10 +49,11 @@ import Api from '@/apis/api'; import AddWisdomBodyDialog from '@/components/AddWisdomBodyDialog.vue'; import DeviceItem from '@/components/DeviceItem.vue'; import HeaderBar from '@/components/HeaderBar.vue'; +import VersionFooter from '@/components/VersionFooter.vue'; export default { name: 'HomePage', - components: { DeviceItem, AddWisdomBodyDialog, HeaderBar }, + components: { DeviceItem, AddWisdomBodyDialog, HeaderBar, VersionFooter }, data() { return { addDeviceDialogVisible: false, diff --git a/main/manager-web/src/views/login.vue b/main/manager-web/src/views/login.vue index 23c8479e..af50bc1c 100644 --- a/main/manager-web/src/views/login.vue +++ b/main/manager-web/src/views/login.vue @@ -51,9 +51,7 @@ - + @@ -61,11 +59,14 @@