diff --git a/api/core/types/config.go b/api/core/types/config.go index 026a7954..2872e73a 100644 --- a/api/core/types/config.go +++ b/api/core/types/config.go @@ -169,4 +169,5 @@ type SystemConfig struct { InviteImgCalls int `json:"invite_img_calls"` // 邀请用户注册奖励绘图次数 ForceInvite bool `json:"force_invite"` // 是否强制必须使用邀请码才能注册 + ShowDemoNotice bool `json:"show_demo_notice"` // 显示演示站公告 } diff --git a/web/src/assets/css/chat-plus.css b/web/src/assets/css/chat-plus.css index a55663d9..5e07cdd9 100644 --- a/web/src/assets/css/chat-plus.css +++ b/web/src/assets/css/chat-plus.css @@ -286,12 +286,12 @@ justify-content: right; align-items: center; } -.notice { - background-color: #f6deff; - width: 100%; - padding: 5px 10px; - border-radius: 5px; - color: #cf49ff; +.el-overlay-dialog .el-dialog .el-dialog__body .notice { + padding: 0 20px 0 20px; + line-height: 1.8; +} +.el-overlay-dialog .el-dialog .el-dialog__body .notice .el-text { + font-size: 16px; } .dialog-service { text-align: center; diff --git a/web/src/assets/css/chat-plus.styl b/web/src/assets/css/chat-plus.styl index 4b1f3a13..fe6c2b84 100644 --- a/web/src/assets/css/chat-plus.styl +++ b/web/src/assets/css/chat-plus.styl @@ -381,12 +381,19 @@ $borderColor = #4676d0; } } -.notice { - background-color #F6DEFF - width 100% - padding 5px 10px; - border-radius 5px; - color #CF49FF +.el-overlay-dialog { + .el-dialog { + .el-dialog__body { + .notice { + padding 0 20px 0 20px + line-height 1.8 + + .el-text { + font-size 16px + } + } + } + } } .dialog-service { diff --git a/web/src/router.js b/web/src/router.js index c513579c..6cec3486 100644 --- a/web/src/router.js +++ b/web/src/router.js @@ -106,13 +106,13 @@ const routes = [ path: '/admin/user', name: 'admin-user', meta: {title: '用户管理'}, - component: () => import('@/views/admin/UserList.vue'), + component: () => import('@/views/admin/Users.vue'), }, { path: '/admin/role', name: 'admin-role', meta: {title: '角色管理'}, - component: () => import('@/views/admin/RoleList.vue'), + component: () => import('@/views/admin/Roles.vue'), }, { path: '/admin/apikey', diff --git a/web/src/views/ChatPlus.vue b/web/src/views/ChatPlus.vue index 3efe721d..ab3c1086 100644 --- a/web/src/views/ChatPlus.vue +++ b/web/src/views/ChatPlus.vue @@ -223,6 +223,28 @@ + +
+ + 注意:当前站点仅为开源项目 + ChatPlus + 的演示项目,本项目单纯就是给大家体验项目功能使用。
+ + 体验额度用完之后请不要在当前站点进行任何充值操作!!!
+ 体验额度用完之后请不要在当前站点进行任何充值操作!!!
+ 体验额度用完之后请不要在当前站点进行任何充值操作!!!
+
+ +

+ 我知道了,不再显示 +

+
+
+ @@ -278,6 +300,8 @@ const isLogin = ref(false) const showHello = ref(true) const textInput = ref(null) const showFeedbackDialog = ref(false) +const showDemoNotice = ref(false) +const showNoticeKey = ref("SHOW_DEMO_NOTICE_") if (isMobile()) { router.replace("/mobile") @@ -326,6 +350,10 @@ onMounted(() => { httpGet("/api/admin/config/get?key=system").then(res => { title.value = res.data.title + const show = localStorage.getItem(showNoticeKey.value + loginUser.value.mobile) + if (!show) { + showDemoNotice.value = res.data['show_demo_notice'] + } }).catch(e => { ElMessage.error("获取系统配置失败:" + e.message) }) @@ -847,6 +875,12 @@ const getModelValue = (model_id) => { } return "" } + + +const notShow = () => { + localStorage.setItem(showNoticeKey.value + loginUser.value.mobile, true) + showDemoNotice.value = false +}