From 9e2af9dbca460ff4538da924ec86af755f59882f Mon Sep 17 00:00:00 2001 From: RockYang Date: Fri, 15 Mar 2024 09:29:19 +0800 Subject: [PATCH] feat: refactor user list page for new UI --- api/core/types/config.go | 1 + api/handler/admin/config_handler.go | 6 +- api/store/vo/user.go | 2 +- gpt-vue/projects/vue-admin/.env.development | 2 - new-ui/projects/vue-admin/index.html | 14 +- .../vue-admin/src/components/CustomLayout.vue | 60 +++++--- .../src/views/System/SystemBaseConfig.vue | 140 ++++++++++-------- .../src/views/User/UserContainer.vue | 44 +++--- .../vue-admin/src/views/User/UserForm.vue | 77 +++++----- 9 files changed, 187 insertions(+), 159 deletions(-) delete mode 100644 gpt-vue/projects/vue-admin/.env.development diff --git a/api/core/types/config.go b/api/core/types/config.go index a5f6c0a4..a8bf061e 100644 --- a/api/core/types/config.go +++ b/api/core/types/config.go @@ -157,6 +157,7 @@ type ModelAPIConfig struct { type SystemConfig struct { Title string `json:"title"` AdminTitle string `json:"admin_title"` + Logo string `json:"logo"` InitPower int `json:"init_power"` // 新用户注册赠送算力值 RegisterWays []string `json:"register_ways"` // 注册方式:支持手机,邮箱注册 diff --git a/api/handler/admin/config_handler.go b/api/handler/admin/config_handler.go index 8c5cbcbf..f81c9b9b 100644 --- a/api/handler/admin/config_handler.go +++ b/api/handler/admin/config_handler.go @@ -79,12 +79,12 @@ func (h *ConfigHandler) Get(c *gin.Context) { return } - var m map[string]interface{} - err := utils.JsonDecode(config.Config, &m) + var value map[string]interface{} + err := utils.JsonDecode(config.Config, &value) if err != nil { resp.ERROR(c, err.Error()) return } - resp.SUCCESS(c, m) + resp.SUCCESS(c, value) } diff --git a/api/store/vo/user.go b/api/store/vo/user.go index 6682b3b7..30660673 100644 --- a/api/store/vo/user.go +++ b/api/store/vo/user.go @@ -8,7 +8,7 @@ type User struct { Nickname string `json:"nickname"` Avatar string `json:"avatar"` Salt string `json:"salt"` // 密码盐 - Power int `json:"calls"` // 剩余算力 + Power int `json:"power"` // 剩余算力 ChatConfig types.UserChatConfig `json:"chat_config"` // 聊天配置 ChatRoles []string `json:"chat_roles"` // 聊天角色集合 ChatModels []string `json:"chat_models"` // AI模型集合 diff --git a/gpt-vue/projects/vue-admin/.env.development b/gpt-vue/projects/vue-admin/.env.development deleted file mode 100644 index 74dbd9ad..00000000 --- a/gpt-vue/projects/vue-admin/.env.development +++ /dev/null @@ -1,2 +0,0 @@ -VITE_PROXY_BASE_URL="/api" -VITE_TARGET_URL="http://172.22.11.2:5678" diff --git a/new-ui/projects/vue-admin/index.html b/new-ui/projects/vue-admin/index.html index 99e15777..a747d4b6 100644 --- a/new-ui/projects/vue-admin/index.html +++ b/new-ui/projects/vue-admin/index.html @@ -1,13 +1,13 @@ - + - ChatPlus-Ai - - -
- - + 极客AI助手-控制台 + + +
+ + diff --git a/new-ui/projects/vue-admin/src/components/CustomLayout.vue b/new-ui/projects/vue-admin/src/components/CustomLayout.vue index 11efb4ff..20be8b4b 100644 --- a/new-ui/projects/vue-admin/src/components/CustomLayout.vue +++ b/new-ui/projects/vue-admin/src/components/CustomLayout.vue @@ -1,6 +1,6 @@