From 9710255b3ed3a3451a306ca863d70478bf3786dd Mon Sep 17 00:00:00 2001 From: yxh Date: Wed, 20 Apr 2022 21:30:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.MD | 167 +++++++++++++++++- internal/app/system/controller/sys_monitor.go | 4 +- internal/app/system/service/middleware.go | 8 +- library/libResponse/response.go | 2 +- manifest/config/config.yaml.bak | 2 +- resource/data/.gitkeep | 0 resource/public/resource/demo.html | 10 ++ 7 files changed, 184 insertions(+), 9 deletions(-) create mode 100644 resource/data/.gitkeep create mode 100644 resource/public/resource/demo.html diff --git a/README.MD b/README.MD index 5ddd7eb..5f89151 100644 --- a/README.MD +++ b/README.MD @@ -1 +1,166 @@ -# GoFrame Template For SingleRepo +# GFast-V3 +
+ +

+

GFast V3.0

+

+

+ + goframe + + + vue + + + element plus + + + typescript + + + vite + + + license + +

+
+ + + +## 平台简介 +* 基于全新Go Frame 2.0+Vue3+Element Plus开发的全栈前后端分离的管理系统 +* 前端采用vue-next-admin 、Vue、Element UI。 +* 本项目由奇讯科技团队开发。 +* 如您想购买云服务器请先领取阿里云优惠券:[点我进入](https://www.aliyun.com/minisite/goods?userCode=fcor2omk ),腾讯云优惠券:[点我领取](https://cloud.tencent.com/act/cps/redirect?redirect=1062&cps_key=20b1c3842f74986b2894e2c5fcde7ea2&from=console ) + +## 特征 +* 高生产率:几分钟即可搭建一个后台管理系统 +* 模块化:单应用多系统的模式,将一个完整的应用拆分为多个系统,后续扩展更加便捷,增加代码复用性。 +* 插件化: 可通过插件的方式扩展系统功能 +* 认证机制:采用gtoken的用户状态认证及casbin的权限认证 +* 路由模式:得利于goframe2.0提供了规范化的路由注册方式,无需注解自动生成api文档 +* 面向接口开发 + + +## 内置功能 + +1. 用户管理:用户是系统操作者,该功能主要完成系统用户配置。 +2. 部门管理:配置系统组织机构(公司、部门、小组),树结构展现支持数据权限。 +3. 岗位管理:配置系统用户所属担任职务。 +4. 菜单管理:配置系统菜单,操作权限,按钮权限标识等。 +5. 角色管理:角色菜单权限分配、设置角色按机构进行数据范围权限划分。 +6. 字典管理:对系统中经常使用的一些较为固定的数据进行维护。 +7. 参数管理:对系统动态配置常用参数。 +8. 操作日志:系统正常操作日志记录和查询;系统异常信息日志记录和查询。 +9. 登录日志:系统登录日志记录查询包含登录异常。 +10. 在线用户:当前系统中活跃用户状态监控。 +11. 定时任务:在线(添加、修改、删除)任务调度包含执行结果日志。 +12. 代码生成:前后端代码的生成。 +13. 服务监控:监视当前系统CPU、内存、磁盘、堆栈等相关信息。 +14. 在线构建器:拖动表单元素生成相应的HTML代码。 +15. 文件上传,缓存标签等。 + +> 项目使用模块化与插件化的方式开发,目前正在升级的插件有:cms系统、万能模型、微信管理、工单系统、问答系统、工作流引擎...,同时也欢迎大家把写好的插件上传到商城,我们来帮您实现技术变现,获取收益! + +> GFast开源以来得到了大家的很多支持,如果您愿意为GFast贡献代码或提供建议,请加微信:qixun007(备注:gfast) + +## 演示地址 +[http://v3.g-fast.cn/sys](http://v3.g-fast.cn/sys) +账号:demo 密码:123456 +## 配置 +项目数据库文件 `resource/data/db.sql` 创建数据库导入后修改配置 `manifest/config/config.yaml.bak` 复制改为`manifest/config/config.yaml` + +其中gfToken配置 +```yaml +gfToken: + cacheKey: "gfToken_" #缓存前缀 + timeOut: 10800 #token超时时间(秒) + maxRefresh: 5400 #token自动刷新时间(秒) + multiLogin: true #是否允许一个账号多人同时登录 + encryptKey: "49c54195e750b04e74a8429b17896586" #加密key (32位) + cacheModel: "redis" #存储引擎 (memory使用内存|redis使用redis) + excludePaths: #排除不做登录验证的路由地址 + - "/api/v1/system/login" +``` + +项目为前后端分离,前端地址: + +github地址:[https://github.com/tiger1103/gfast-ui](https://github.com/tiger1103/gfast-ui) + +gitee地址:[https://gitee.com/tiger1103/gfast-ui](https://gitee.com/tiger1103/gfast-ui) + +## 文档地址 +> 文档正在书写中,请耐心等一等。 + +## 相关视频 +[https://space.bilibili.com/254192571/channel/seriesdetail?sid=223204](https://space.bilibili.com/254192571/channel/seriesdetail?sid=223204) + +## 演示图 + + + + + + + + + + + + + + + + + + +
+ +## 感谢(排名不分先后) +> gf框架 [https://github.com/gogf/gf](https://github.com/gogf/gf) +> +> vue-next-admin [https://gitee.com/lyt-top/vue-next-admin](https://gitee.com/lyt-top/vue-next-admin) +> +> swaggo [https://github.com/swaggo/swag](https://github.com/swaggo/swag) +> +>gtoken [https://github.com/goflyfox/gtoken](https://github.com/goflyfox/gtoken) +> +>casbin [https://github.com/casbin/casbin](https://github.com/casbin/casbin) + + +PHP开源工作流引擎tpflow [https://gitee.com/ntdgg/tpflow](https://gitee.com/ntdgg/tpflow) + +CCflow 国内最优秀的开源流程引擎 [https://gitee.com/opencc/ccflow](https://gitee.com/opencc/ccflow) + +## 交流QQ群 + +> + +> 感谢你使用GFast,公司团队精力时间有限,因此我们不再提供免费的技术服务,目前Gfast QQ交流群有部分用户进行了捐赠,捐赠后请联系作者进vip用户群,vip群中问题将得到优先解答,同时也会根据您的需求进行分析和优先安排,vip群也会提供Gfast的其它福利。 +> 同时您也可以联系我们,雇佣我们团队为您干活,谢谢合作! +>快来加入群聊【Gfast框架交流群】(群号865697297),发现精彩内容,记得备注加群来意。 + +## 免责声明: +> 1、Gfast仅限自己学习使用,一切商业行为与Gfast无关。 + +> 2、用户不得利用Gfast从事非法行为,用户应当合法合规的使用,发现用户在使用产品时有任何的非法行为,Gfast有权配合有关机关进行调查或向政府部门举报,Gfast不承担用户因非法行为造成的任何法律责任,一切法律责任由用户自行承担,如因用户使用造成第三方损害的,用户应当依法予以赔偿。 + +> 3、所有与使用Gfast相关的资源直接风险均由用户承担。 + + +## 商用说明 +> 商用注意事项 +如果您将此项目用于商业用途,请遵守Apache2.0协议并保留作者技术支持声明。 + +* GFast快速开发平台采用Apache-2.0技术协议 +* 二次开发如用于商业性质或开源竞品请不要删除和修改GFast源码头部的版权与作者声明及出处 +* 允许进行商用,但是不允许二次开源出来并进行收费 +* 我们已经申请了相关的软件著作权和相关登记(证书号:软著登字第7511736号) +* 如果您在自己的项目中使用了我们项目中的扩展或模块,请在项目介绍中进行明确说明 + +## 支持开源 +如果您喜爱gfast,请给常熬夜的作者来杯咖啡吧! 点我送咖啡 + +## [感谢JetBrains提供的免费GoLand](https://jb.gg/OpenSource) +[![avatar](https://camo.githubusercontent.com/323657c6e81419b8e151e9da4c71f409e3fcc65d630535170c59fe4807dbc905/68747470733a2f2f676f6672616d652e6f72672f646f776e6c6f61642f7468756d626e61696c732f313131343131392f6a6574627261696e732e706e67)](https://jb.gg/OpenSource) diff --git a/internal/app/system/controller/sys_monitor.go b/internal/app/system/controller/sys_monitor.go index cd29238..9553379 100644 --- a/internal/app/system/controller/sys_monitor.go +++ b/internal/app/system/controller/sys_monitor.go @@ -18,7 +18,7 @@ import ( "time" ) -var Monitor = &sysMonitorController{ +var Monitor = sysMonitorController{ startTime: gtime.Now(), } @@ -113,7 +113,7 @@ func (c *sysMonitorController) List(ctx context.Context, req *system.MonitorSear } } res = new(system.MonitorSearchRes) - *res = system.MonitorSearchRes{ + res = &system.MonitorSearchRes{ "cpuNum": cpuNum, "cpuUsed": cpuUsed, "cpuAvg5": cpuAvg5, diff --git a/internal/app/system/service/middleware.go b/internal/app/system/service/middleware.go index 32e13da..4c7619d 100644 --- a/internal/app/system/service/middleware.go +++ b/internal/app/system/service/middleware.go @@ -58,14 +58,15 @@ func (s *middlewareImpl) Auth(r *ghttp.Request) { ctx := r.GetCtx() //获取登陆用户id adminId := Context().GetUserId(ctx) - /*if r.Method != "GET" && adminId!=1{ - library.FailJson(true, r, "演示系统,您没有操作权限!") - }*/ accessParams := r.Get("accessParams").Strings() accessParamsStr := "" if len(accessParams) > 0 && accessParams[0] != "undefined" { accessParamsStr = "?" + gstr.Join(accessParams, "&") } + url := gstr.TrimLeft(r.Request.URL.Path, "/") + accessParamsStr + /*if r.Method != "GET" && adminId!=1 && !gstr.Contains(url,"api/v1/system/login"){ + libResponse.FailJson(true, r, "对不起!演示系统,不能删改数据!") + }*/ //获取无需验证权限的用户id tagSuperAdmin := false User().NotCheckAuthAdminIds(ctx).Iterator(func(v interface{}) bool { @@ -80,7 +81,6 @@ func (s *middlewareImpl) Auth(r *ghttp.Request) { //不要再往后面执行 return } - url := gstr.TrimLeft(r.Request.URL.Path, "/") + accessParamsStr //获取地址对应的菜单id menuList, err := Rule().GetIsMenuList(ctx) if err != nil { diff --git a/library/libResponse/response.go b/library/libResponse/response.go index a98f732..466e95b 100644 --- a/library/libResponse/response.go +++ b/library/libResponse/response.go @@ -19,7 +19,7 @@ type Response struct { // 数据集 Data interface{} `json:"data"` // 消息 - Msg string `json:"msg"` + Msg string `json:"message"` } var response = new(Response) diff --git a/manifest/config/config.yaml.bak b/manifest/config/config.yaml.bak index 0ce2d37..19d85f2 100644 --- a/manifest/config/config.yaml.bak +++ b/manifest/config/config.yaml.bak @@ -60,7 +60,7 @@ redis: system: notCheckAuthAdminIds: [1,2,31] #无需验证后台权限的用户id - dataDir: "./data" + dataDir: "./resource/data" cache: model: "redis" #缓存模式 memory OR redis prefix: "gFastV3Cache_" #缓存前缀 diff --git a/resource/data/.gitkeep b/resource/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/resource/public/resource/demo.html b/resource/public/resource/demo.html new file mode 100644 index 0000000..f336480 --- /dev/null +++ b/resource/public/resource/demo.html @@ -0,0 +1,10 @@ + + + + + demo + + +hello word + + \ No newline at end of file