├── uniapp └── 客户端uniapp.txt ├── gozero ├── common │ ├── utils │ │ ├── upload.go │ │ └── md5.go │ ├── myconfig │ │ └── myconfig.go │ ├── kqueue │ │ ├── kqConfig.go │ │ └── message.go │ ├── uuid │ │ ├── sn_test.go │ │ ├── flakeId.go │ │ ├── sn.go │ │ └── nanoid.go │ ├── tool │ │ ├── krand_test.go │ │ ├── placeholders.go │ │ ├── encryption.go │ │ ├── coinconvert.go │ │ └── krand.go │ ├── globalkey │ │ ├── redisCacheKey.go │ │ └── constantKey.go │ ├── wxminisub │ │ └── tpl.go │ ├── mycache │ │ └── cache_test.go │ ├── result │ │ └── responseBean.go │ ├── xerr │ │ ├── errCode.go │ │ ├── errors.go │ │ └── errMsg.go │ ├── genuid │ │ └── sn.go │ └── middleware │ │ └── commonJwtAuthMiddleware.go ├── deploy │ ├── goctl │ │ ├── model │ │ │ ├── tag.tpl │ │ │ ├── field.tpl │ │ │ ├── interface-insert.tpl │ │ │ ├── table-name.tpl │ │ │ ├── interface-delete.tpl │ │ │ ├── interface-find-one-by-field.tpl │ │ │ ├── err.tpl │ │ │ ├── interface-find-one.tpl │ │ │ ├── interface-update.tpl │ │ │ ├── model-gen.tpl │ │ │ ├── model-new.tpl │ │ │ ├── types.tpl │ │ │ ├── import-no-cache.tpl │ │ │ ├── import.tpl │ │ │ ├── find-one-by-field-extra-method.tpl │ │ │ └── insert.tpl │ │ ├── README.md │ │ ├── api │ │ │ ├── etc.tpl │ │ │ ├── route-addition.tpl │ │ │ ├── types.tpl │ │ │ ├── config.tpl │ │ │ ├── routes.tpl │ │ │ ├── context.tpl │ │ │ ├── middleware.tpl │ │ │ ├── logic.tpl │ │ │ ├── main.tpl │ │ │ ├── template.tpl │ │ │ └── handler.tpl │ │ ├── 1.3.4.zip │ │ ├── rpc │ │ │ ├── config.tpl │ │ │ ├── etc.tpl │ │ │ ├── call-interface-func.tpl │ │ │ ├── svc.tpl │ │ │ ├── template.tpl │ │ │ ├── logic-func.tpl │ │ │ ├── server.tpl │ │ │ ├── call-func.tpl │ │ │ ├── logic.tpl │ │ │ ├── server-func.tpl │ │ │ └── call.tpl │ │ ├── mongo │ │ │ └── err.tpl │ │ └── newapi │ │ │ └── newtemplate.tpl │ └── goctl-tpl │ │ ├── model │ │ ├── tag.tpl │ │ ├── field.tpl │ │ ├── interface-delete.tpl │ │ ├── interface-insert.tpl │ │ ├── interface-find-one-by-field.tpl │ │ ├── table-name.tpl │ │ ├── interface-find-one.tpl │ │ ├── err.tpl │ │ ├── interface-update.tpl │ │ ├── model-gen.tpl │ │ ├── model-new.tpl │ │ ├── types.tpl │ │ ├── import-no-cache.tpl │ │ ├── import.tpl │ │ ├── find-one-by-field-extra-method.tpl │ │ ├── insert.tpl │ │ ├── delete.tpl │ │ └── var.tpl │ │ ├── api │ │ ├── etc.tpl │ │ ├── route-addition.tpl │ │ ├── types.tpl │ │ ├── config.tpl │ │ ├── routes.tpl │ │ ├── context.tpl │ │ ├── middleware.tpl │ │ ├── main.tpl │ │ ├── logic.tpl │ │ ├── template.tpl │ │ └── handler.tpl │ │ ├── rpc │ │ ├── config.tpl │ │ ├── etc.tpl │ │ ├── svc.tpl │ │ ├── template.tpl │ │ ├── logic-func.tpl │ │ ├── server.tpl │ │ ├── logic.tpl │ │ ├── server-func.tpl │ │ ├── call.tpl │ │ └── main.tpl │ │ ├── mongo │ │ ├── err.tpl │ │ └── model_types.tpl │ │ └── newapi │ │ └── newtemplate.tpl ├── app │ ├── basic │ │ └── cmd │ │ │ ├── api │ │ │ ├── .gitignore │ │ │ ├── internal │ │ │ │ ├── config │ │ │ │ │ └── config.go │ │ │ │ ├── handler │ │ │ │ │ └── basic │ │ │ │ │ │ ├── captchaHandler.go │ │ │ │ │ │ ├── myFileListHandler.go │ │ │ │ │ │ ├── fileDetailHandler.go │ │ │ │ │ │ ├── fileListHandler.go │ │ │ │ │ │ ├── delFileListHandler.go │ │ │ │ │ │ ├── getFileByKeyHandler.go │ │ │ │ │ │ └── sendCodeHandler.go │ │ │ │ └── logic │ │ │ │ │ └── basic │ │ │ │ │ ├── sendCodeLogic.go │ │ │ │ │ └── fileListLogic.go │ │ │ ├── basic.go │ │ │ └── desc │ │ │ │ └── sms │ │ │ │ └── sms.api │ │ │ └── rpc │ │ │ ├── .gitignore │ │ │ └── internal │ │ │ ├── config │ │ │ └── config.go │ │ │ ├── listen │ │ │ ├── listen.go │ │ │ └── kqMqs.go │ │ │ └── logic │ │ │ ├── addFileLogic.go │ │ │ ├── sendCodeLogic.go │ │ │ ├── fileDetailLogic.go │ │ │ ├── verifyCodeLogic.go │ │ │ └── fileListLogic.go │ ├── cms │ │ └── cmd │ │ │ └── api │ │ │ ├── .gitignore │ │ │ ├── internal │ │ │ ├── handler │ │ │ │ └── cms │ │ │ │ │ ├── catListHandler.go │ │ │ │ │ ├── artListHandler.go │ │ │ │ │ ├── discussHandler.go │ │ │ │ │ ├── artDetailHandler.go │ │ │ │ │ ├── delDiscussHandler.go │ │ │ │ │ └── discussListHandler.go │ │ │ ├── config │ │ │ │ └── config.go │ │ │ └── logic │ │ │ │ └── cms │ │ │ │ ├── discussLogic.go │ │ │ │ ├── delDiscussLogic.go │ │ │ │ ├── discussListLogic.go │ │ │ │ └── artDetailLogic.go │ │ │ └── cms.go │ └── usercenter │ │ ├── cmd │ │ ├── api │ │ │ ├── .gitignore │ │ │ ├── internal │ │ │ │ ├── config │ │ │ │ │ └── wxMiniConfig.go │ │ │ │ ├── handler │ │ │ │ │ └── user │ │ │ │ │ │ ├── tokenVerifyHandler.go │ │ │ │ │ │ ├── detailHandler.go │ │ │ │ │ │ ├── loginHandler.go │ │ │ │ │ │ ├── registerHandler.go │ │ │ │ │ │ └── loginScanHandler.go │ │ │ │ └── logic │ │ │ │ │ └── user │ │ │ │ │ └── tokenVerifyLogic.go │ │ │ └── usercenter.go │ │ └── rpc │ │ │ ├── .gitignore │ │ │ ├── gateway │ │ │ ├── gw.go │ │ │ └── config.yaml │ │ │ └── internal │ │ │ ├── config │ │ │ └── config.go │ │ │ └── logic │ │ │ ├── getUserAuthByUserIdLogic.go │ │ │ └── getUserAuthByAuthKeyLogic.go │ │ └── model │ │ ├── vars.go │ │ └── memContactsGroup.go ├── pubKey ├── prvKey ├── build-linux.bat ├── build-linux.sh └── modd.conf ├── server ├── stop.sh ├── run2.sh ├── run.sh ├── README.md ├── pubKey.txt ├── prvKey.txt ├── modd.conf ├── packfile │ └── notUsePackFile.go ├── build-linux.bat ├── router │ ├── system │ │ ├── index.go │ │ └── baseMenu.go │ ├── client │ │ ├── index.go │ │ ├── user.go │ │ └── cms.go │ ├── common │ │ ├── index.go │ │ └── common_file.go │ ├── index.go │ └── business │ │ └── index.go ├── resource │ ├── excel │ │ ├── ExcelExport.xlsx │ │ ├── ExcelImport.xlsx │ │ └── ExcelTemplate.xlsx │ └── rbac_model.conf ├── utils │ ├── constant.go │ ├── test │ │ ├── trace.go │ │ └── playerData.go2 │ ├── plugin │ │ └── plugin.go │ ├── reload.go │ ├── db_automation.go │ ├── rotatelogs.go │ └── upload │ │ └── upload.go ├── service │ ├── system │ │ └── index.go │ ├── common │ │ └── index.go │ ├── business │ │ └── index.go │ └── index.go ├── config │ ├── excel.go │ ├── casbin.go │ ├── txim.go │ ├── captcha.go │ ├── jwt.go │ ├── redis.go │ ├── license.go │ ├── timer.go │ ├── email.go │ └── zap.go ├── api │ └── v1 │ │ ├── client │ │ ├── index.go │ │ └── cms.go │ │ ├── common │ │ └── index.go │ │ ├── system │ │ └── index.go │ │ ├── index.go │ │ └── business │ │ └── index.go ├── model │ ├── system │ │ ├── response │ │ │ ├── sys_system.go │ │ │ └── sys_captcha.go │ │ ├── sys_system.go │ │ └── request │ │ │ └── jwt.go │ ├── business │ │ ├── common.go │ │ └── cmsDetail.go │ └── common │ │ └── response │ │ └── common.go ├── mycache │ └── cache_test.go ├── core │ ├── server_win.go │ └── server_other.go ├── middleware │ ├── need_init.go │ ├── loadtls.go │ └── cors.go ├── initialize │ ├── validator.go │ ├── timer.go │ └── redis.go ├── myError │ ├── ettorType.go │ └── myError.go └── global │ └── global.go ├── web ├── .browserslistrc ├── favicon.ico ├── .stylelintignore ├── favicon2.ico ├── src │ ├── components │ │ ├── ReCountTo │ │ │ ├── README.md │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ └── rebound │ │ │ │ └── props.ts │ │ ├── ReAuth │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ └── auth.tsx │ │ ├── ReSplitPane │ │ │ ├── iconfont │ │ │ │ ├── iconfont.ttf │ │ │ │ ├── iconfont.woff │ │ │ │ ├── iconfont.woff2 │ │ │ │ ├── iconfont.json │ │ │ │ └── iconfont.css │ │ │ ├── resizer.tsx │ │ │ └── index.css │ │ ├── ReFlowChart │ │ │ ├── src │ │ │ │ ├── assets │ │ │ │ │ └── iconfont │ │ │ │ │ │ ├── iconfont.eot │ │ │ │ │ │ ├── iconfont.ttf │ │ │ │ │ │ ├── iconfont.woff │ │ │ │ │ │ └── iconfont.woff2 │ │ │ │ └── DataDialog.vue │ │ │ └── index.ts │ │ ├── RePureTableBar │ │ │ ├── src │ │ │ │ └── svg │ │ │ │ │ ├── expand.svg │ │ │ │ │ ├── refresh.svg │ │ │ │ │ ├── drag.svg │ │ │ │ │ ├── collapse.svg │ │ │ │ │ └── settings.svg │ │ │ └── index.ts │ │ ├── ReQrcode │ │ │ ├── src │ │ │ │ └── index.scss │ │ │ └── index.ts │ │ ├── ReFlop │ │ │ └── index.ts │ │ ├── ReCropper │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ ├── circled.css │ │ │ │ └── svg │ │ │ │ ├── arrow-h.svg │ │ │ │ ├── arrow-v.svg │ │ │ │ ├── arrow-up.svg │ │ │ │ ├── arrow-down.svg │ │ │ │ ├── arrow-left.svg │ │ │ │ ├── arrow-right.svg │ │ │ │ ├── upload.svg │ │ │ │ ├── download.svg │ │ │ │ ├── search-minus.svg │ │ │ │ ├── search-plus.svg │ │ │ │ ├── rotate-left.svg │ │ │ │ ├── rotate-right.svg │ │ │ │ └── reload.svg │ │ ├── ReSelector │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ └── index.css │ │ ├── ReBarcode │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ └── index.vue │ │ ├── ReImageVerify │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ └── index.vue │ │ ├── ReSeamlessScroll │ │ │ └── index.ts │ │ ├── ReSegmented │ │ │ ├── index.ts │ │ │ └── src │ │ │ │ └── type.ts │ │ ├── ReAnimateSelector │ │ │ └── index.ts │ │ ├── ReIcon │ │ │ ├── src │ │ │ │ ├── types.ts │ │ │ │ ├── iconifyIconOnline.ts │ │ │ │ └── iconifyIconOffline.ts │ │ │ └── index.ts │ │ ├── ReCol │ │ │ └── index.ts │ │ ├── ReFlicker │ │ │ └── index.css │ │ └── ReTypeit │ │ │ └── index.ts │ ├── assets │ │ ├── car.png │ │ ├── user.jpg │ │ ├── login │ │ │ ├── bg.png │ │ │ └── avatar.svg │ │ ├── iconfont │ │ │ ├── iconfont.ttf │ │ │ ├── iconfont.woff │ │ │ ├── iconfont.woff2 │ │ │ ├── iconfont.css │ │ │ └── iconfont.json │ │ └── svg │ │ │ ├── laptop.svg │ │ │ ├── dark.svg │ │ │ ├── calendar.svg │ │ │ ├── full_screen.svg │ │ │ ├── shop.svg │ │ │ ├── exit_screen.svg │ │ │ ├── back.svg │ │ │ ├── enter_outlined.svg │ │ │ ├── keyboard_esc.svg │ │ │ ├── service.svg │ │ │ ├── day.svg │ │ │ ├── user_avatar.svg │ │ │ ├── back_top.svg │ │ │ ├── globalization.svg │ │ │ └── hot.svg │ ├── utils │ │ ├── bus.ts │ │ ├── README.md │ │ ├── globalPolyfills.ts │ │ ├── progress │ │ │ └── index.ts │ │ └── mitt.ts │ ├── layout │ │ ├── components │ │ │ ├── search │ │ │ │ ├── components │ │ │ │ │ └── index.ts │ │ │ │ └── index.vue │ │ │ ├── sidebar │ │ │ │ ├── extraIcon.vue │ │ │ │ └── topCollapse.vue │ │ │ ├── notice │ │ │ │ └── noticeList.vue │ │ │ └── footer │ │ │ │ └── index.vue │ │ ├── redirect.vue │ │ └── hooks │ │ │ └── useBoolean.ts │ ├── pinia │ │ └── index.ts │ ├── directives │ │ ├── index.ts │ │ └── auth │ │ │ └── index.ts │ ├── store │ │ ├── index.ts │ │ └── modules │ │ │ └── settings.ts │ ├── views │ │ ├── login │ │ │ ├── utils │ │ │ │ ├── static.ts │ │ │ │ ├── enums.ts │ │ │ │ └── motion.ts │ │ │ └── components │ │ │ │ └── qrCode.vue │ │ └── welcome │ │ │ └── components │ │ │ └── Github.vue │ ├── style │ │ ├── index.scss │ │ └── tailwind.css │ ├── api │ │ ├── list.ts │ │ ├── common_file.ts │ │ └── common_db.ts │ └── router │ │ ├── modules │ │ └── about.ts-- │ │ └── enums.ts ├── public │ ├── logo.png │ ├── favicon.ico │ ├── img │ │ ├── bg.jpg │ │ ├── bjt.png │ │ ├── no.png │ │ ├── ren.png │ │ ├── addimg.png │ │ ├── audio.png │ │ ├── avr1.jpg │ │ ├── avr2.jpg │ │ ├── docs.png │ │ ├── fenpei.png │ │ ├── github.png │ │ ├── moren.jpg │ │ ├── news.png │ │ ├── noBody.png │ │ ├── play.png │ │ ├── play_a.png │ │ ├── play_v.png │ │ ├── stop.png │ │ ├── video.png │ │ ├── notFound.png │ │ └── feed-icon.png │ ├── favicon2.ico │ └── platform-config.json ├── .npmrc ├── .gitattributes ├── .gitpod.yml ├── .env ├── .prettierrc.js ├── .markdownlint.json ├── postcss.config.js ├── .eslintignore ├── .editorconfig ├── .gitignore ├── README.md ├── .dockerignore ├── .env.development ├── types │ ├── shims-vue.d.ts │ └── shims-tsx.d.ts ├── Dockerfile ├── tailwind.config.js ├── .lintstagedrc ├── .env.staging ├── .env.production ├── commitlint.config.js └── build │ └── index.ts └── .gitignore /uniapp/客户端uniapp.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gozero/common/utils/upload.go: -------------------------------------------------------------------------------- 1 | package utils 2 | -------------------------------------------------------------------------------- /server/stop.sh: -------------------------------------------------------------------------------- 1 | kill -9 $(lsof -t -i:44088) 2 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/tag.tpl: -------------------------------------------------------------------------------- 1 | `db:"{{.field}}"` -------------------------------------------------------------------------------- /server/run2.sh: -------------------------------------------------------------------------------- 1 | chmod +x ./gocms 2 | ./gocms 3 | 4 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/tag.tpl: -------------------------------------------------------------------------------- 1 | `db:"{{.field}}"` -------------------------------------------------------------------------------- /gozero/deploy/goctl/README.md: -------------------------------------------------------------------------------- 1 | 项目使用额goctl模版, 2 | 可以自己替换 3 | -------------------------------------------------------------------------------- /server/run.sh: -------------------------------------------------------------------------------- 1 | chmod +x ./gocms 2 | nohup ./gocms & 3 | 4 | -------------------------------------------------------------------------------- /web/.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not dead 4 | not ie 11 -------------------------------------------------------------------------------- /gozero/app/basic/cmd/api/.gitignore: -------------------------------------------------------------------------------- 1 | #tmp 2 | tmp 3 | tmp/* 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/rpc/.gitignore: -------------------------------------------------------------------------------- 1 | #tmp 2 | tmp 3 | tmp/* 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /gozero/app/cms/cmd/api/.gitignore: -------------------------------------------------------------------------------- 1 | #tmp 2 | tmp 3 | tmp/* 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/favicon.ico -------------------------------------------------------------------------------- /gozero/app/usercenter/cmd/api/.gitignore: -------------------------------------------------------------------------------- 1 | #tmp 2 | tmp 3 | tmp/* 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /gozero/app/usercenter/cmd/rpc/.gitignore: -------------------------------------------------------------------------------- 1 | #tmp 2 | tmp 3 | tmp/* 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /gozero/common/myconfig/myconfig.go: -------------------------------------------------------------------------------- 1 | package myconfig 2 | 3 | var HttpRoot = "/" 4 | -------------------------------------------------------------------------------- /gozero/pubKey: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | 3 | -----END PUBLIC KEY----- 4 | -------------------------------------------------------------------------------- /server/README.md: -------------------------------------------------------------------------------- 1 | go-cms v2.0 新版 cms/企业官网/文章/新闻/群组/圈子 通用内容管理系统 2 | 升级到 go 1.21 -------------------------------------------------------------------------------- /server/pubKey.txt: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | 3 | -----END PUBLIC KEY----- 4 | -------------------------------------------------------------------------------- /web/.stylelintignore: -------------------------------------------------------------------------------- 1 | /dist/* 2 | /public/* 3 | public/* 4 | src/style/reset.scss -------------------------------------------------------------------------------- /web/favicon2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/favicon2.ico -------------------------------------------------------------------------------- /web/src/components/ReCountTo/README.md: -------------------------------------------------------------------------------- 1 | normal 普通数字动画组件 2 | rebound 回弹式数字动画组件 3 | -------------------------------------------------------------------------------- /web/public/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/logo.png -------------------------------------------------------------------------------- /gozero/prvKey: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | 3 | -----END RSA PRIVATE KEY----- 4 | -------------------------------------------------------------------------------- /server/prvKey.txt: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | 3 | -----END RSA PRIVATE KEY----- 4 | -------------------------------------------------------------------------------- /web/.npmrc: -------------------------------------------------------------------------------- 1 | shamefully-hoist=true 2 | strict-peer-dependencies=false 3 | shell-emulator=true -------------------------------------------------------------------------------- /web/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/favicon.ico -------------------------------------------------------------------------------- /web/public/img/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/bg.jpg -------------------------------------------------------------------------------- /web/public/img/bjt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/bjt.png -------------------------------------------------------------------------------- /web/public/img/no.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/no.png -------------------------------------------------------------------------------- /web/public/img/ren.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/ren.png -------------------------------------------------------------------------------- /web/src/assets/car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/src/assets/car.png -------------------------------------------------------------------------------- /gozero/deploy/goctl/api/etc.tpl: -------------------------------------------------------------------------------- 1 | Name: {{.serviceName}} 2 | Host: {{.host}} 3 | Port: {{.port}} 4 | -------------------------------------------------------------------------------- /web/public/favicon2.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/favicon2.ico -------------------------------------------------------------------------------- /web/public/img/addimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/addimg.png -------------------------------------------------------------------------------- /web/public/img/audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/audio.png -------------------------------------------------------------------------------- /web/public/img/avr1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/avr1.jpg -------------------------------------------------------------------------------- /web/public/img/avr2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/avr2.jpg -------------------------------------------------------------------------------- /web/public/img/docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/docs.png -------------------------------------------------------------------------------- /web/public/img/fenpei.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/fenpei.png -------------------------------------------------------------------------------- /web/public/img/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/github.png -------------------------------------------------------------------------------- /web/public/img/moren.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/moren.jpg -------------------------------------------------------------------------------- /web/public/img/news.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/news.png -------------------------------------------------------------------------------- /web/public/img/noBody.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/noBody.png -------------------------------------------------------------------------------- /web/public/img/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/play.png -------------------------------------------------------------------------------- /web/public/img/play_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/play_a.png -------------------------------------------------------------------------------- /web/public/img/play_v.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/play_v.png -------------------------------------------------------------------------------- /web/public/img/stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/stop.png -------------------------------------------------------------------------------- /web/public/img/video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/video.png -------------------------------------------------------------------------------- /web/src/assets/user.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/src/assets/user.jpg -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/api/etc.tpl: -------------------------------------------------------------------------------- 1 | Name: {{.serviceName}} 2 | Host: {{.host}} 3 | Port: {{.port}} 4 | -------------------------------------------------------------------------------- /web/public/img/notFound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/notFound.png -------------------------------------------------------------------------------- /web/src/assets/login/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/src/assets/login/bg.png -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/field.tpl: -------------------------------------------------------------------------------- 1 | {{.name}} {{.type}} {{.tag}} {{if .hasComment}}// {{.comment}}{{end}} -------------------------------------------------------------------------------- /gozero/deploy/goctl/1.3.4.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/gozero/deploy/goctl/1.3.4.zip -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/field.tpl: -------------------------------------------------------------------------------- 1 | {{.name}} {{.type}} {{.tag}} {{if .hasComment}}// {{.comment}}{{end}} -------------------------------------------------------------------------------- /server/modd.conf: -------------------------------------------------------------------------------- 1 | 2 | #usercenter 3 | **/*.go { 4 | daemon +sigkill: go run ./main.go 5 | } 6 | -------------------------------------------------------------------------------- /server/packfile/notUsePackFile.go: -------------------------------------------------------------------------------- 1 | //go:build !packfile 2 | // +build !packfile 3 | 4 | package packfile 5 | -------------------------------------------------------------------------------- /web/public/img/feed-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/public/img/feed-icon.png -------------------------------------------------------------------------------- /server/build-linux.bat: -------------------------------------------------------------------------------- 1 | SET CGO_ENABLED=0 2 | SET GOOS=linux 3 | SET GOARCH=amd64 4 | go build -o gocms main.go 5 | -------------------------------------------------------------------------------- /web/.gitattributes: -------------------------------------------------------------------------------- 1 | public/wasm/capture.worker.js linguist-language=Vue 2 | public/wasm/index.js linguist-language=Vue -------------------------------------------------------------------------------- /server/router/system/index.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | type RouterGroup struct { 4 | BaseRouter 5 | MenuRouter 6 | } 7 | -------------------------------------------------------------------------------- /web/src/assets/iconfont/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/src/assets/iconfont/iconfont.ttf -------------------------------------------------------------------------------- /web/src/assets/iconfont/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/src/assets/iconfont/iconfont.woff -------------------------------------------------------------------------------- /web/src/components/ReAuth/index.ts: -------------------------------------------------------------------------------- 1 | import auth from "./src/auth"; 2 | 3 | const Auth = auth; 4 | 5 | export { Auth }; 6 | -------------------------------------------------------------------------------- /web/src/utils/bus.ts: -------------------------------------------------------------------------------- 1 | 2 | // using ES6 modules 3 | import mitt from 'mitt' 4 | 5 | export const emitter = mitt() 6 | 7 | -------------------------------------------------------------------------------- /server/resource/excel/ExcelExport.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/server/resource/excel/ExcelExport.xlsx -------------------------------------------------------------------------------- /server/resource/excel/ExcelImport.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/server/resource/excel/ExcelImport.xlsx -------------------------------------------------------------------------------- /server/resource/excel/ExcelTemplate.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/server/resource/excel/ExcelTemplate.xlsx -------------------------------------------------------------------------------- /server/utils/constant.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | const ( 4 | ConfigEnv = "GVA_CONFIG" 5 | ConfigFile = "config.yaml" 6 | ) 7 | -------------------------------------------------------------------------------- /web/.gitpod.yml: -------------------------------------------------------------------------------- 1 | ports: 2 | - port: 3344 3 | onOpen: open-preview 4 | tasks: 5 | - init: pnpm install && pnpm serve 6 | -------------------------------------------------------------------------------- /web/src/assets/iconfont/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/src/assets/iconfont/iconfont.woff2 -------------------------------------------------------------------------------- /gozero/common/kqueue/kqConfig.go: -------------------------------------------------------------------------------- 1 | package kqueue 2 | 3 | type KqConfig struct { 4 | Brokers []string 5 | Topic string 6 | } 7 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/interface-delete.tpl: -------------------------------------------------------------------------------- 1 | Delete(ctx context.Context, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) error -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/interface-insert.tpl: -------------------------------------------------------------------------------- 1 | Insert(ctx context.Context, data *{{.upperStartCamelObject}}) (sql.Result,error) -------------------------------------------------------------------------------- /server/service/system/index.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | type ServiceGroup struct { 4 | UserService 5 | SystemConfigService 6 | } 7 | -------------------------------------------------------------------------------- /server/config/excel.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type Excel struct { 4 | Dir string `mapstructure:"dir" json:"dir" yaml:"dir"` 5 | } 6 | -------------------------------------------------------------------------------- /server/service/common/index.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | type ServiceGroup struct { 4 | CommonDbService 5 | CommonFileService 6 | } 7 | -------------------------------------------------------------------------------- /web/src/layout/components/search/components/index.ts: -------------------------------------------------------------------------------- 1 | import SearchModal from "./SearchModal.vue"; 2 | 3 | export { SearchModal }; 4 | -------------------------------------------------------------------------------- /web/src/pinia/index.ts: -------------------------------------------------------------------------------- 1 | import { createPinia } from 'pinia' 2 | 3 | const store = createPinia() 4 | 5 | export { 6 | store 7 | } 8 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/api/route-addition.tpl: -------------------------------------------------------------------------------- 1 | 2 | server.AddRoutes( 3 | {{.routes}} {{.jwt}}{{.signature}} {{.prefix}} {{.timeout}} 4 | ) 5 | -------------------------------------------------------------------------------- /web/.env: -------------------------------------------------------------------------------- 1 | # 平台本地运行端口号 2 | VITE_PORT = 8848 3 | 4 | # 是否隐藏首页 隐藏 true 不隐藏 false (勿删除,VITE_HIDE_HOME只需在.env文件配置) 5 | VITE_HIDE_HOME = true 6 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/api/route-addition.tpl: -------------------------------------------------------------------------------- 1 | 2 | server.AddRoutes( 3 | {{.routes}} {{.jwt}}{{.signature}} {{.prefix}} {{.timeout}} 4 | ) 5 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/interface-insert.tpl: -------------------------------------------------------------------------------- 1 | Insert(ctx context.Context, session sqlx.Session,data *{{.upperStartCamelObject}}) (sql.Result,error) -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/table-name.tpl: -------------------------------------------------------------------------------- 1 | 2 | func (m *default{{.upperStartCamelObject}}Model) TableName() string { 3 | return m.table 4 | } 5 | -------------------------------------------------------------------------------- /web/src/directives/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./auth"; 2 | export * from "./copy"; 3 | export * from "./longpress"; 4 | export * from "./optimize"; 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .cloudbase 3 | /web/node_modules 4 | /web/dist 5 | /server/res 6 | /server/log 7 | /server/gocms 8 | /gozero-old/ 9 | /gokit-old/ -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/interface-find-one-by-field.tpl: -------------------------------------------------------------------------------- 1 | FindOneBy{{.upperField}}(ctx context.Context, {{.in}}) (*{{.upperStartCamelObject}}, error) -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/table-name.tpl: -------------------------------------------------------------------------------- 1 | 2 | func (m *default{{.upperStartCamelObject}}Model) tableName() string { 3 | return m.table 4 | } 5 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/interface-delete.tpl: -------------------------------------------------------------------------------- 1 | Delete(ctx context.Context,session sqlx.Session, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) error 2 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/interface-find-one-by-field.tpl: -------------------------------------------------------------------------------- 1 | FindOneBy{{.upperField}}(ctx context.Context, {{.in}}) (*{{.upperStartCamelObject}}, error) -------------------------------------------------------------------------------- /web/src/components/ReSplitPane/iconfont/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/src/components/ReSplitPane/iconfont/iconfont.ttf -------------------------------------------------------------------------------- /gozero/common/uuid/sn_test.go: -------------------------------------------------------------------------------- 1 | package uuid 2 | 3 | import "testing" 4 | 5 | func TestGenSn(t *testing.T) { 6 | GenSn(SN_PREFIX_HOMESTAY_ORDER) 7 | } 8 | -------------------------------------------------------------------------------- /web/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: true, 3 | singleQuote: false, 4 | arrowParens: "avoid", 5 | trailingComma: "none" 6 | }; 7 | -------------------------------------------------------------------------------- /web/src/components/ReSplitPane/iconfont/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/src/components/ReSplitPane/iconfont/iconfont.woff -------------------------------------------------------------------------------- /web/src/components/ReSplitPane/iconfont/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/src/components/ReSplitPane/iconfont/iconfont.woff2 -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/interface-find-one.tpl: -------------------------------------------------------------------------------- 1 | FindOne(ctx context.Context, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) (*{{.upperStartCamelObject}}, error) -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/err.tpl: -------------------------------------------------------------------------------- 1 | package {{.pkg}} 2 | 3 | import "github.com/zeromicro/go-zero/core/stores/sqlx" 4 | 5 | var ErrNotFound = sqlx.ErrNotFound 6 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/interface-find-one.tpl: -------------------------------------------------------------------------------- 1 | FindOne(ctx context.Context, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) (*{{.upperStartCamelObject}}, error) -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/err.tpl: -------------------------------------------------------------------------------- 1 | package {{.pkg}} 2 | 3 | import "github.com/zeromicro/go-zero/core/stores/sqlx" 4 | 5 | var ErrNotFound = sqlx.ErrNotFound 6 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/interface-update.tpl: -------------------------------------------------------------------------------- 1 | Update(ctx context.Context, {{if .containsIndexCache}}newData{{else}}data{{end}} *{{.upperStartCamelObject}}) error -------------------------------------------------------------------------------- /gozero/deploy/goctl/rpc/config.tpl: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import "github.com/zeromicro/go-zero/zrpc" 4 | 5 | type Config struct { 6 | zrpc.RpcServerConf 7 | } 8 | -------------------------------------------------------------------------------- /server/api/v1/client/index.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import commSev "go-cms/service/common" 4 | 5 | type ApiGroup struct { 6 | commSev.BaseApi 7 | CmsApi 8 | } 9 | -------------------------------------------------------------------------------- /gozero/common/tool/krand_test.go: -------------------------------------------------------------------------------- 1 | package tool 2 | 3 | import "testing" 4 | 5 | func TestMd5ByString(t *testing.T) { 6 | s := Md5ByString("AAA") 7 | t.Log(s) 8 | } 9 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/api/types.tpl: -------------------------------------------------------------------------------- 1 | // Code generated by goctl. DO NOT EDIT. 2 | package types{{if .containsTime}} 3 | import ( 4 | "time" 5 | ){{end}} 6 | {{.types}} 7 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/rpc/config.tpl: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import "github.com/zeromicro/go-zero/zrpc" 4 | 5 | type Config struct { 6 | zrpc.RpcServerConf 7 | } 8 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/rpc/etc.tpl: -------------------------------------------------------------------------------- 1 | Name: {{.serviceName}}.rpc 2 | ListenOn: 0.0.0.0:8080 3 | Etcd: 4 | Hosts: 5 | - 127.0.0.1:2379 6 | Key: {{.serviceName}}.rpc 7 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/api/types.tpl: -------------------------------------------------------------------------------- 1 | // Code generated by goctl. DO NOT EDIT. 2 | package types{{if .containsTime}} 3 | import ( 4 | "time" 5 | ){{end}} 6 | {{.types}} 7 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/rpc/etc.tpl: -------------------------------------------------------------------------------- 1 | Name: {{.serviceName}}.rpc 2 | ListenOn: 127.0.0.1:8080 3 | Etcd: 4 | Hosts: 5 | - 127.0.0.1:2379 6 | Key: {{.serviceName}}.rpc 7 | -------------------------------------------------------------------------------- /web/src/components/ReFlowChart/src/assets/iconfont/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/src/components/ReFlowChart/src/assets/iconfont/iconfont.eot -------------------------------------------------------------------------------- /web/src/components/ReFlowChart/src/assets/iconfont/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/src/components/ReFlowChart/src/assets/iconfont/iconfont.ttf -------------------------------------------------------------------------------- /web/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff -------------------------------------------------------------------------------- /web/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/88act/go-cms/HEAD/web/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff2 -------------------------------------------------------------------------------- /server/config/casbin.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type Casbin struct { 4 | ModelPath string `mapstructure:"model-path" json:"modelPath" yaml:"model-path"` // 存放casbin模型的相对路径 5 | } 6 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/api/config.tpl: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import {{.authImport}} 4 | 5 | type Config struct { 6 | rest.RestConf 7 | {{.auth}} 8 | {{.jwtTrans}} 9 | } 10 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/api/config.tpl: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import {{.authImport}} 4 | 5 | type Config struct { 6 | rest.RestConf 7 | {{.auth}} 8 | {{.jwtTrans}} 9 | } 10 | -------------------------------------------------------------------------------- /server/model/system/response/sys_system.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | import "go-cms/config" 4 | 5 | type SysConfigResponse struct { 6 | Config config.Server `json:"config"` 7 | } 8 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/mongo/err.tpl: -------------------------------------------------------------------------------- 1 | 2 | package model 3 | 4 | import "errors" 5 | 6 | var ErrNotFound = errors.New("not found") 7 | var ErrInvalidObjectId = errors.New("invalid objectId") 8 | -------------------------------------------------------------------------------- /server/model/system/response/sys_captcha.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | type SysCaptchaResponse struct { 4 | CaptchaId string `json:"captchaId"` 5 | PicPath string `json:"picPath"` 6 | } 7 | -------------------------------------------------------------------------------- /server/model/system/sys_system.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "go-cms/config" 5 | ) 6 | 7 | // 配置文件结构体 8 | type System struct { 9 | Config config.Server `json:"config"` 10 | } 11 | -------------------------------------------------------------------------------- /server/router/client/index.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | type RouterGroup struct { 4 | // golang_coder Begin; DO NOT EDIT. 5 | cmsRouter 6 | userRouter 7 | // golang_coder End; DO NOT EDIT. 8 | } 9 | -------------------------------------------------------------------------------- /server/router/common/index.go: -------------------------------------------------------------------------------- 1 | package commom 2 | 3 | type RouterGroup struct { 4 | // golang_coder Begin; DO NOT EDIT. 5 | CommonDbRouter 6 | CommonFileRouter 7 | // golang_coder End; DO NOT EDIT. 8 | } 9 | -------------------------------------------------------------------------------- /web/src/components/RePureTableBar/src/svg/expand.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/ReQrcode/src/index.scss: -------------------------------------------------------------------------------- 1 | .qrcode { 2 | &--disabled { 3 | background: rgb(255 255 255 / 95%); 4 | 5 | & > div { 6 | transform: translate(-50%, -50%); 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /gozero/app/usercenter/cmd/api/internal/config/wxMiniConfig.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | // 微信小程序配置 4 | type WxMiniConf struct { 5 | AppId string `json:"AppId"` //微信appId 6 | Secret string `json:"Secret"` //微信secret 7 | } 8 | -------------------------------------------------------------------------------- /server/api/v1/common/index.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | //通用api 列表 4 | type ApiGroup struct { 5 | // golang_coder Begin; DO NOT EDIT. 6 | CommonDbApi 7 | CommonFileApi 8 | // golang_coder End; DO NOT EDIT. 9 | } 10 | -------------------------------------------------------------------------------- /server/config/txim.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type Txim struct { 4 | Appid int `mapstructure:"appid" json:"appid" yaml:"appid"` // appid 5 | Key string `mapstructure:"key" json:"key" yaml:"key"` // key 6 | 7 | } 8 | -------------------------------------------------------------------------------- /web/src/components/ReFlop/index.ts: -------------------------------------------------------------------------------- 1 | import reFlop from "./src/index.vue"; 2 | import { withInstall } from "@pureadmin/utils"; 3 | 4 | /** 时间翻牌组件 */ 5 | export const ReFlop = withInstall(reFlop); 6 | 7 | export default ReFlop; 8 | -------------------------------------------------------------------------------- /web/src/components/ReCropper/index.ts: -------------------------------------------------------------------------------- 1 | import reCropper from "./src"; 2 | import { withInstall } from "@pureadmin/utils"; 3 | 4 | /** 图片裁剪组件 */ 5 | export const ReCropper = withInstall(reCropper); 6 | 7 | export default ReCropper; 8 | -------------------------------------------------------------------------------- /web/src/components/ReQrcode/index.ts: -------------------------------------------------------------------------------- 1 | import reQrcode from "./src/index"; 2 | import { withInstall } from "@pureadmin/utils"; 3 | 4 | /** 二维码组件 */ 5 | export const ReQrcode = withInstall(reQrcode); 6 | 7 | export default ReQrcode; 8 | -------------------------------------------------------------------------------- /web/src/components/ReSelector/index.ts: -------------------------------------------------------------------------------- 1 | import reSelector from "./src"; 2 | import { withInstall } from "@pureadmin/utils"; 3 | 4 | /** 选择器组件 */ 5 | export const ReSelector = withInstall(reSelector); 6 | 7 | export default ReSelector; 8 | -------------------------------------------------------------------------------- /web/src/components/ReBarcode/index.ts: -------------------------------------------------------------------------------- 1 | import reBarcode from "./src/index.vue"; 2 | import { withInstall } from "@pureadmin/utils"; 3 | 4 | /** 条形码组件 */ 5 | export const ReBarcode = withInstall(reBarcode); 6 | 7 | export default ReBarcode; 8 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/interface-update.tpl: -------------------------------------------------------------------------------- 1 | Update(ctx context.Context,session sqlx.Session, data *{{.upperStartCamelObject}}) (sql.Result, error) 2 | UpdateWithVersion(ctx context.Context,session sqlx.Session,data *{{.upperStartCamelObject}}) error -------------------------------------------------------------------------------- /web/src/store/index.ts: -------------------------------------------------------------------------------- 1 | import type { App } from "vue"; 2 | import { createPinia } from "pinia"; 3 | const store = createPinia(); 4 | 5 | export function setupStore(app: App) { 6 | app.use(store); 7 | } 8 | 9 | export { store }; 10 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/rpc/call-interface-func.tpl: -------------------------------------------------------------------------------- 1 | {{if .hasComment}}{{.comment}} 2 | {{end}}{{.method}}(ctx context.Context{{if .hasReq}}, in *{{.pbRequest}}{{end}}, opts ...grpc.CallOption) ({{if .notStream}}*{{.pbResponse}}, {{else}}{{.streamBody}},{{end}} error) -------------------------------------------------------------------------------- /web/.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "default": true, 3 | "MD003": false, 4 | "MD033": false, 5 | "MD013": false, 6 | "MD001": false, 7 | "MD025": false, 8 | "MD024": false, 9 | "MD007": { "indent": 4 }, 10 | "no-hard-tabs": false 11 | } 12 | -------------------------------------------------------------------------------- /web/src/views/login/utils/static.ts: -------------------------------------------------------------------------------- 1 | import bg from "@/assets/login/bg.png"; 2 | import avatar from "@/assets/login/avatar.svg?component"; 3 | import illustration from "@/assets/login/illustration.svg?component"; 4 | 5 | export { bg, avatar, illustration }; 6 | -------------------------------------------------------------------------------- /gozero/common/globalkey/redisCacheKey.go: -------------------------------------------------------------------------------- 1 | package globalkey 2 | 3 | /** 4 | redis key except "model cache key" in here, 5 | but "model cache key" in model 6 | */ 7 | 8 | // CacheUserTokenKey /** 用户登陆的token 9 | const CacheUserTokenKey = "user_token:%d" 10 | -------------------------------------------------------------------------------- /gozero/common/wxminisub/tpl.go: -------------------------------------------------------------------------------- 1 | package wxminisub 2 | 3 | //订单支付成功 4 | const OrderPaySuccessTemplateID = "QIJPmfxaNqYzSjOlXGk1T6Xfw94JwbSPuOd3u_hi3WE" 5 | 6 | //支付成功入驻通知 7 | const OrderPaySuccessLiveKnowTemplateID = "kmm-maRr6v_9eMxEPpj-5clJ2YW_EFpd8-ngyYk63e4" 8 | -------------------------------------------------------------------------------- /web/src/assets/svg/laptop.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/ReImageVerify/index.ts: -------------------------------------------------------------------------------- 1 | import reImageVerify from "./src/index.vue"; 2 | import { withInstall } from "@pureadmin/utils"; 3 | 4 | /** 图形验证码组件 */ 5 | export const ReImageVerify = withInstall(reImageVerify); 6 | 7 | export default ReImageVerify; 8 | -------------------------------------------------------------------------------- /web/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | "postcss-import": {}, 4 | "tailwindcss/nesting": {}, 5 | tailwindcss: {}, 6 | autoprefixer: {}, 7 | ...(process.env.NODE_ENV === "production" ? { cssnano: {} } : {}) 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/mongo/err.tpl: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "errors" 5 | 6 | "github.com/zeromicro/go-zero/core/stores/mon" 7 | ) 8 | 9 | var ( 10 | ErrNotFound = mon.ErrNotFound 11 | ErrInvalidObjectId = errors.New("invalid objectId") 12 | ) 13 | -------------------------------------------------------------------------------- /web/src/components/ReSeamlessScroll/index.ts: -------------------------------------------------------------------------------- 1 | import reSeamlessScroll from "./src/index.vue"; 2 | import { withInstall } from "@pureadmin/utils"; 3 | 4 | /** 无缝滚动组件 */ 5 | export const ReSeamlessScroll = withInstall(reSeamlessScroll); 6 | 7 | export default ReSeamlessScroll; 8 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/model-gen.tpl: -------------------------------------------------------------------------------- 1 | // Code generated by goctl. DO NOT EDIT! 2 | 3 | package {{.pkg}} 4 | {{.imports}} 5 | {{.vars}} 6 | {{.types}} 7 | {{.new}} 8 | {{.insert}} 9 | {{.find}} 10 | {{.update}} 11 | {{.delete}} 12 | {{.extraMethod}} 13 | {{.tableName}} 14 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/rpc/svc.tpl: -------------------------------------------------------------------------------- 1 | package svc 2 | 3 | import {{.imports}} 4 | 5 | type ServiceContext struct { 6 | Config config.Config 7 | } 8 | 9 | func NewServiceContext(c config.Config) *ServiceContext { 10 | return &ServiceContext{ 11 | Config:c, 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /server/model/business/common.go: -------------------------------------------------------------------------------- 1 | package business 2 | 3 | // //文件简单类型 add by ljd 4 | // type FileObj struct { 5 | // Path string `json:"path"` 6 | // Guid string `json:"guid"` 7 | // //MediaType int `json:"mediaType"` 8 | // //Ext string `json:"ext"` 9 | // } 10 | -------------------------------------------------------------------------------- /web/src/components/RePureTableBar/src/svg/refresh.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/model-gen.tpl: -------------------------------------------------------------------------------- 1 | // Code generated by goctl. DO NOT EDIT! 2 | 3 | package {{.pkg}} 4 | {{.imports}} 5 | {{.vars}} 6 | {{.types}} 7 | {{.new}} 8 | {{.delete}} 9 | {{.find}} 10 | {{.insert}} 11 | {{.update}} 12 | {{.extraMethod}} 13 | {{.tableName}} 14 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/rpc/svc.tpl: -------------------------------------------------------------------------------- 1 | package svc 2 | 3 | import {{.imports}} 4 | 5 | type ServiceContext struct { 6 | Config config.Config 7 | } 8 | 9 | func NewServiceContext(c config.Config) *ServiceContext { 10 | return &ServiceContext{ 11 | Config:c, 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /web/src/assets/svg/dark.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/RePureTableBar/index.ts: -------------------------------------------------------------------------------- 1 | import pureTableBar from "./src/bar"; 2 | import { withInstall } from "@pureadmin/utils"; 3 | 4 | /** 配合 `@pureadmin/table` 实现快速便捷的表格操作 https://github.com/pure-admin/pure-admin-table */ 5 | export const PureTableBar = withInstall(pureTableBar); 6 | -------------------------------------------------------------------------------- /web/src/assets/svg/calendar.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/ReSegmented/index.ts: -------------------------------------------------------------------------------- 1 | import reSegmented from "./src/index"; 2 | import { withInstall } from "@pureadmin/utils"; 3 | 4 | /** 分段控制器组件 */ 5 | export const ReSegmented = withInstall(reSegmented); 6 | 7 | export default ReSegmented; 8 | export type { OptionsType } from "./src/type"; 9 | -------------------------------------------------------------------------------- /web/src/utils/README.md: -------------------------------------------------------------------------------- 1 | ### 注意 2 | 3 | - `vue-pure-admin` 从 `3.3.0` 版本之后(不包括 `3.3.0` 版本),大部分工具和 `hooks` 都集成到了 [@pureadmin/utils](https://pure-admin-utils.netlify.app/) 4 | - [npm](https://www.npmjs.com/package/@pureadmin/utils) 5 | - [文档代码地址](https://github.com/pure-admin/pure-admin-utils-docs) 6 | -------------------------------------------------------------------------------- /web/.eslintignore: -------------------------------------------------------------------------------- 1 | public 2 | dist 3 | *.d.ts 4 | /src/assets 5 | package.json 6 | .eslintrc.js 7 | .prettierrc.js 8 | commitlint.config.js 9 | postcss.config.js 10 | tailwind.config.js 11 | stylelint.config.js 12 | src/components/ReSplitPane/iconfont 13 | src/components/ReFlowChart/src/assets/iconfont -------------------------------------------------------------------------------- /gozero/common/tool/placeholders.go: -------------------------------------------------------------------------------- 1 | package tool 2 | 3 | import "strings" 4 | 5 | //替换 6 | func InPlaceholders(n int) string { 7 | var b strings.Builder 8 | for i := 0; i < n-1; i++ { 9 | b.WriteString("?,") 10 | } 11 | if n > 0 { 12 | b.WriteString("?") 13 | } 14 | return b.String() 15 | } 16 | -------------------------------------------------------------------------------- /gozero/build-linux.bat: -------------------------------------------------------------------------------- 1 | SET CGO_ENABLED=0 2 | SET GOOS=linux 3 | SET GOARCH=amd64 4 | 5 | 6 | go build -o ./run/usercenter-api ./app/usercenter/cmd/api/usercenter.go 7 | 8 | go build -o ./run/basic-api ./app/basic/cmd/api/basic.go 9 | 10 | go build -o ./run/cms-api ./app/cms/cmd/api/cms.go 11 | 12 | -------------------------------------------------------------------------------- /web/src/components/ReAnimateSelector/index.ts: -------------------------------------------------------------------------------- 1 | import reAnimateSelector from "./src/index.vue"; 2 | import { withInstall } from "@pureadmin/utils"; 3 | 4 | /** [animate.css](https://animate.style/) 选择器组件 */ 5 | export const ReAnimateSelector = withInstall(reAnimateSelector); 6 | 7 | export default ReAnimateSelector; 8 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/newapi/newtemplate.tpl: -------------------------------------------------------------------------------- 1 | type Request { 2 | Name string `path:"name,options=you|me"` 3 | } 4 | 5 | type Response { 6 | Message string `json:"message"` 7 | } 8 | 9 | service {{.name}}-api { 10 | @handler {{.handler}}Handler 11 | get /from/:name(Request) returns (Response) 12 | } 13 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/newapi/newtemplate.tpl: -------------------------------------------------------------------------------- 1 | 2 | type Request { 3 | Name string `path:"name,options=you|me"` 4 | } 5 | 6 | type Response { 7 | Message string `json:"message"` 8 | } 9 | 10 | service {{.name}}-api { 11 | @handler {{.handler}}Handler 12 | get /from/:name(Request) returns (Response) 13 | } 14 | -------------------------------------------------------------------------------- /server/utils/test/trace.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "os" 5 | "runtime/trace" 6 | ) 7 | 8 | func main() { 9 | f, err := os.Create("trace.out") 10 | if err != nil { 11 | panic(err) 12 | } 13 | defer f.Close() 14 | 15 | err = trace.Start(f) 16 | if err != nil { 17 | panic(err) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /web/src/utils/globalPolyfills.ts: -------------------------------------------------------------------------------- 1 | // 如果项目出现 `global is not defined` 报错,可能是您引入某个库的问题,比如 aws-sdk-js https://github.com/aws/aws-sdk-js 2 | // 解决办法就是将该文件引入 src/main.ts 即可 import "@/utils/globalPolyfills"; 3 | if (typeof (window as any).global === "undefined") { 4 | (window as any).global = window; 5 | } 6 | 7 | export {}; 8 | -------------------------------------------------------------------------------- /web/.editorconfig: -------------------------------------------------------------------------------- 1 | # http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | end_of_line = lf 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [*.md] 13 | insert_final_newline = false 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/api/routes.tpl: -------------------------------------------------------------------------------- 1 | // Code generated by goctl. DO NOT EDIT. 2 | package handler 3 | 4 | import ( 5 | "net/http"{{if .hasTimeout}} 6 | "time"{{end}} 7 | 8 | {{.importPackages}} 9 | ) 10 | 11 | func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { 12 | {{.routesAdditions}} 13 | } 14 | -------------------------------------------------------------------------------- /server/resource/rbac_model.conf: -------------------------------------------------------------------------------- 1 | [request_definition] 2 | r = sub, obj, act 3 | 4 | [policy_definition] 5 | p = sub, obj, act 6 | 7 | [role_definition] 8 | g = _, _ 9 | 10 | [policy_effect] 11 | e = some(where (p.eft == allow)) 12 | 13 | [matchers] 14 | m = r.sub == p.sub && ParamsMatch(r.obj,p.obj) && r.act == p.act 15 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/api/routes.tpl: -------------------------------------------------------------------------------- 1 | // Code generated by goctl. DO NOT EDIT. 2 | package handler 3 | 4 | import ( 5 | "net/http"{{if .hasTimeout}} 6 | "time"{{end}} 7 | 8 | {{.importPackages}} 9 | ) 10 | 11 | func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { 12 | {{.routesAdditions}} 13 | } 14 | -------------------------------------------------------------------------------- /web/src/components/ReCropper/src/circled.css: -------------------------------------------------------------------------------- 1 | @import "cropperjs/dist/cropper.css"; 2 | @import "tippy.js/dist/tippy.css"; 3 | @import "tippy.js/themes/light.css"; 4 | @import "tippy.js/animations/perspective.css"; 5 | 6 | .re-circled { 7 | .cropper-view-box, 8 | .cropper-face { 9 | border-radius: 50%; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/rpc/template.tpl: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package {{.package}}; 4 | option go_package="./{{.package}}"; 5 | 6 | message Request { 7 | string ping = 1; 8 | } 9 | 10 | message Response { 11 | string pong = 1; 12 | } 13 | 14 | service {{.serviceName}} { 15 | rpc Ping(Request) returns(Response); 16 | } 17 | -------------------------------------------------------------------------------- /gozero/app/usercenter/model/vars.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "database/sql" 5 | ) 6 | 7 | // 统一model 执行接口 8 | type Executable interface { 9 | Exec(query string, args ...interface{}) (sql.Result, error) 10 | } 11 | 12 | var UserAuthTypeSystem string = "system" //平台内部 13 | var UserAuthTypeSmallWX string = "wxMini" //微信小程序 14 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/rpc/template.tpl: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package {{.package}}; 4 | option go_package="./{{.package}}"; 5 | 6 | message Request { 7 | string ping = 1; 8 | } 9 | 10 | message Response { 11 | string pong = 1; 12 | } 13 | 14 | service {{.serviceName}} { 15 | rpc Ping(Request) returns(Response); 16 | } 17 | -------------------------------------------------------------------------------- /server/config/captcha.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type Captcha struct { 4 | KeyLong int `mapstructure:"key-long" json:"keyLong" yaml:"key-long"` // 验证码长度 5 | ImgWidth int `mapstructure:"img-width" json:"imgWidth" yaml:"img-width"` // 验证码宽度 6 | ImgHeight int `mapstructure:"img-height" json:"imgHeight" yaml:"img-height"` // 验证码高度 7 | } 8 | -------------------------------------------------------------------------------- /web/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | .eslintcache 7 | report.html 8 | 9 | yarn.lock 10 | npm-debug.log* 11 | .pnpm-error.log* 12 | .pnpm-debug.log 13 | tests/**/coverage/ 14 | 15 | # Editor directories and files 16 | .idea 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | tsconfig.tsbuildinfo -------------------------------------------------------------------------------- /web/src/assets/svg/full_screen.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/assets/svg/shop.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/api/v1/system/index.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import "go-cms/service" 4 | 5 | type ApiGroup struct { 6 | BaseUserApi 7 | BaseMenuApi 8 | SystemApi 9 | } 10 | 11 | var userService = service.ServiceGroupApp.SystemServiceGroup.UserService 12 | var systemConfigService = service.ServiceGroupApp.SystemServiceGroup.SystemConfigService 13 | -------------------------------------------------------------------------------- /server/utils/plugin/plugin.go: -------------------------------------------------------------------------------- 1 | package plugin 2 | 3 | import ( 4 | "github.com/gin-gonic/gin" 5 | ) 6 | 7 | const ( 8 | OnlyFuncName = "Plugin" 9 | ) 10 | 11 | // Plugin 插件模式接口化 12 | type Plugin interface { 13 | // Register 注册路由 14 | Register(group *gin.RouterGroup) 15 | 16 | // RouterPath 用户返回注册路由 17 | RouterPath() string 18 | } 19 | -------------------------------------------------------------------------------- /web/README.md: -------------------------------------------------------------------------------- 1 | 本前端项目修改自 [ vue-pure-admin ](https://github.com/pure-admin/vue-pure-admin) 2 | 可以参考上面项目学习 3 | 4 | 5 | 6 | 如果您还没安装 pnpm,请执行下面命令进行安装 7 | npm install -g pnpm 8 | 9 | 10 | 本地开发 11 | pnpm install 12 | 13 | 安装依赖 14 | 15 | pnpm install 16 | 启动平台 17 | 18 | pnpm dev 19 | 安装一个包 20 | 21 | pnpm add 包名 22 | 卸载一个包 23 | 24 | pnpm remove 包名 -------------------------------------------------------------------------------- /gozero/deploy/goctl/api/context.tpl: -------------------------------------------------------------------------------- 1 | package svc 2 | 3 | import ( 4 | {{.configImport}} 5 | ) 6 | 7 | type ServiceContext struct { 8 | Config {{.config}} 9 | {{.middleware}} 10 | } 11 | 12 | func NewServiceContext(c {{.config}}) *ServiceContext { 13 | return &ServiceContext{ 14 | Config: c, 15 | {{.middlewareAssignment}} 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | dist 4 | dist-ssr 5 | *.local 6 | .eslintcache 7 | report.html 8 | 9 | yarn.lock 10 | npm-debug.log* 11 | .pnpm-error.log* 12 | .pnpm-debug.log 13 | tests/**/coverage/ 14 | 15 | # Editor directories and files 16 | .idea 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | tsconfig.tsbuildinfo 22 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/api/context.tpl: -------------------------------------------------------------------------------- 1 | package svc 2 | 3 | import ( 4 | {{.configImport}} 5 | ) 6 | 7 | type ServiceContext struct { 8 | Config {{.config}} 9 | {{.middleware}} 10 | } 11 | 12 | func NewServiceContext(c {{.config}}) *ServiceContext { 13 | return &ServiceContext{ 14 | Config: c, 15 | {{.middlewareAssignment}} 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/model-new.tpl: -------------------------------------------------------------------------------- 1 | 2 | func new{{.upperStartCamelObject}}Model(conn sqlx.SqlConn{{if .withCache}}, c cache.CacheConf{{end}}) *default{{.upperStartCamelObject}}Model { 3 | return &default{{.upperStartCamelObject}}Model{ 4 | {{if .withCache}}CachedConn: sqlc.NewConn(conn, c){{else}}conn:conn{{end}}, 5 | table: {{.table}}, 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/types.tpl: -------------------------------------------------------------------------------- 1 | 2 | type ( 3 | {{.lowerStartCamelObject}}Model interface{ 4 | {{.method}} 5 | } 6 | 7 | default{{.upperStartCamelObject}}Model struct { 8 | {{if .withCache}}sqlc.CachedConn{{else}}conn sqlx.SqlConn{{end}} 9 | table string 10 | } 11 | 12 | {{.upperStartCamelObject}} struct { 13 | {{.fields}} 14 | } 15 | ) 16 | -------------------------------------------------------------------------------- /server/utils/reload.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "errors" 5 | "os" 6 | "os/exec" 7 | "runtime" 8 | "strconv" 9 | ) 10 | 11 | func Reload() error { 12 | if runtime.GOOS == "windows" { 13 | return errors.New("系统不支持") 14 | } 15 | pid := os.Getpid() 16 | cmd := exec.Command("kill", "-1", strconv.Itoa(pid)) 17 | return cmd.Run() 18 | } 19 | -------------------------------------------------------------------------------- /web/src/components/ReCropper/src/svg/arrow-h.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/ReCropper/src/svg/arrow-v.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/model-new.tpl: -------------------------------------------------------------------------------- 1 | 2 | func new{{.upperStartCamelObject}}Model(conn sqlx.SqlConn{{if .withCache}}, c cache.CacheConf{{end}}) *default{{.upperStartCamelObject}}Model { 3 | return &default{{.upperStartCamelObject}}Model{ 4 | {{if .withCache}}CachedConn: sqlc.NewConn(conn, c){{else}}conn:conn{{end}}, 5 | table: {{.table}}, 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/types.tpl: -------------------------------------------------------------------------------- 1 | 2 | type ( 3 | {{.lowerStartCamelObject}}Model interface{ 4 | {{.method}} 5 | } 6 | 7 | default{{.upperStartCamelObject}}Model struct { 8 | {{if .withCache}}sqlc.CachedConn{{else}}conn sqlx.SqlConn{{end}} 9 | table string 10 | } 11 | 12 | {{.upperStartCamelObject}} struct { 13 | {{.fields}} 14 | } 15 | ) 16 | -------------------------------------------------------------------------------- /server/config/jwt.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type JWT struct { 4 | SigningKey string `mapstructure:"signing-key" json:"signingKey" yaml:"signing-key"` // jwt签名 5 | ExpiresTime int64 `mapstructure:"expires-time" json:"expiresTime" yaml:"expires-time"` // 过期时间 6 | BufferTime int64 `mapstructure:"buffer-time" json:"bufferTime" yaml:"buffer-time"` // 缓冲时间 7 | } 8 | -------------------------------------------------------------------------------- /gozero/common/globalkey/constantKey.go: -------------------------------------------------------------------------------- 1 | package globalkey 2 | 3 | /** 4 | global constant key 5 | */ 6 | 7 | //软删除 8 | var DelStateNo int64 = 0 //未删除 9 | var DelStateYes int64 = 1 //已删除 10 | 11 | //时间格式化模版 12 | var DateTimeFormatTplStandardDateTime = "Y-m-d H:i:s" 13 | var DateTimeFormatTplStandardDate = "Y-m-d" 14 | var DateTimeFormatTplStandardTime = "H:i:s" 15 | -------------------------------------------------------------------------------- /web/src/assets/svg/exit_screen.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gozero/build-linux.sh: -------------------------------------------------------------------------------- 1 | go build -o ./run/usercenter-rpc ./app/usercenter/cmd/rpc/usercenter.go 2 | 3 | go build -o ./run/usercenter-api ./app/usercenter/cmd/api/usercenter.go 4 | 5 | go build -o ./run/basic-rpc ./app/basic/cmd/rpc/basic.go 6 | 7 | go build -o ./run/basic-api ./app/basic/cmd/api/basic.go 8 | 9 | go build -o ./run/cms-api ./app/cms/cmd/api/cms.go 10 | -------------------------------------------------------------------------------- /web/src/assets/svg/back.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/ReCropper/src/svg/arrow-up.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/import-no-cache.tpl: -------------------------------------------------------------------------------- 1 | import ( 2 | "context" 3 | "database/sql" 4 | "fmt" 5 | "strings" 6 | {{if .time}}"time"{{end}} 7 | 8 | "github.com/zeromicro/go-zero/core/stores/builder" 9 | "github.com/zeromicro/go-zero/core/stores/sqlc" 10 | "github.com/zeromicro/go-zero/core/stores/sqlx" 11 | "github.com/zeromicro/go-zero/core/stringx" 12 | ) 13 | -------------------------------------------------------------------------------- /server/service/business/index.go: -------------------------------------------------------------------------------- 1 | package business 2 | 3 | type ServiceGroup struct { 4 | // golang_coder Begin; DO NOT EDIT. 5 | SysApisService 6 | SysMenuService 7 | 8 | MemUserService 9 | MemLogsService 10 | MemDepartService 11 | MemUserSafeService 12 | BasicFileService 13 | BasicDictService 14 | BasicFileCatService 15 | // golang_coder End; DO NOT EDIT. 16 | } 17 | -------------------------------------------------------------------------------- /web/src/assets/svg/enter_outlined.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/ReCropper/src/svg/arrow-down.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/ReCropper/src/svg/arrow-left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/utils/progress/index.ts: -------------------------------------------------------------------------------- 1 | import NProgress from "nprogress"; 2 | import "nprogress/nprogress.css"; 3 | 4 | NProgress.configure({ 5 | // 动画方式 6 | easing: "ease", 7 | // 递增进度条的速度 8 | speed: 500, 9 | // 是否显示加载ico 10 | showSpinner: false, 11 | // 自动递增间隔 12 | trickleSpeed: 200, 13 | // 初始化时的最小百分比 14 | minimum: 0.3 15 | }); 16 | 17 | export default NProgress; 18 | -------------------------------------------------------------------------------- /web/src/components/ReCropper/src/svg/arrow-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/rpc/logic-func.tpl: -------------------------------------------------------------------------------- 1 | {{if .hasComment}}{{.comment}}{{end}} 2 | func (l *{{.logicName}}) {{.method}} ({{if .hasReq}}in {{.request}}{{if .stream}},stream {{.streamBody}}{{end}}{{else}}stream {{.streamBody}}{{end}}) ({{if .hasReply}}{{.response}},{{end}} error) { 3 | // todo: add your logic here and delete this line 4 | 5 | return {{if .hasReply}}&{{.responseType}}{},{{end}} nil 6 | } 7 | -------------------------------------------------------------------------------- /web/src/style/index.scss: -------------------------------------------------------------------------------- 1 | @import "./transition"; 2 | @import "./element-plus"; 3 | @import "./sidebar"; 4 | @import "./dark"; 5 | 6 | /* 自定义全局 CssVar */ 7 | :root { 8 | /* 左侧菜单展开、收起动画时长 */ 9 | --pure-transition-duration: 0.3s; 10 | } 11 | 12 | /* 灰色模式 */ 13 | .html-grey { 14 | filter: grayscale(100%); 15 | } 16 | 17 | /* 色弱模式 */ 18 | .html-weakness { 19 | filter: invert(80%); 20 | } 21 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/rpc/logic-func.tpl: -------------------------------------------------------------------------------- 1 | {{if .hasComment}}{{.comment}}{{end}} 2 | func (l *{{.logicName}}) {{.method}} ({{if .hasReq}}in {{.request}}{{if .stream}},stream {{.streamBody}}{{end}}{{else}}stream {{.streamBody}}{{end}}) ({{if .hasReply}}{{.response}},{{end}} error) { 3 | // todo: add your logic here and delete this line 4 | 5 | return {{if .hasReply}}&{{.responseType}}{},{{end}} nil 6 | } 7 | -------------------------------------------------------------------------------- /web/src/assets/svg/keyboard_esc.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/ReCountTo/index.ts: -------------------------------------------------------------------------------- 1 | import reNormalCountTo from "./src/normal"; 2 | import reboundCountTo from "./src/rebound"; 3 | import { withInstall } from "@pureadmin/utils"; 4 | 5 | /** 普通数字动画组件 */ 6 | const ReNormalCountTo = withInstall(reNormalCountTo); 7 | 8 | /** 回弹式数字动画组件 */ 9 | const ReboundCountTo = withInstall(reboundCountTo); 10 | 11 | export { ReNormalCountTo, ReboundCountTo }; 12 | -------------------------------------------------------------------------------- /web/.env.development: -------------------------------------------------------------------------------- 1 | # 平台本地运行端口号 2 | VITE_PORT = 8848 3 | 4 | # 开发环境读取配置文件路径 5 | VITE_PUBLIC_PATH = / 6 | 7 | # 开发环境路由历史模式(Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数") 8 | VITE_ROUTER_HISTORY = "hash" 9 | 10 | 11 | # 线上环境接口地址 12 | VITE_SERVER_PORT = 44088 13 | VITE_BASE_API = /api 14 | VITE_BASE_PATH = http://127.0.0.1 15 | VITE_WSS = ws://127.0.0.1:8888/ 16 | 17 | -------------------------------------------------------------------------------- /server/api/v1/index.go: -------------------------------------------------------------------------------- 1 | package v1 2 | 3 | import ( 4 | "go-cms/api/v1/business" 5 | "go-cms/api/v1/client" 6 | "go-cms/api/v1/common" 7 | "go-cms/api/v1/system" 8 | ) 9 | 10 | type ApiGroup struct { 11 | SystemApiGroup system.ApiGroup 12 | BusinessApiGroup business.ApiGroup 13 | CommonApiGroup common.ApiGroup 14 | ClientGroup client.ApiGroup 15 | } 16 | 17 | var ApiGroupApp = new(ApiGroup) 18 | -------------------------------------------------------------------------------- /server/router/index.go: -------------------------------------------------------------------------------- 1 | package router 2 | 3 | import ( 4 | "go-cms/router/business" 5 | "go-cms/router/client" 6 | common "go-cms/router/common" 7 | "go-cms/router/system" 8 | ) 9 | 10 | type RouterGroup struct { 11 | System system.RouterGroup 12 | Business business.RouterGroup 13 | Common common.RouterGroup 14 | Client client.RouterGroup 15 | } 16 | 17 | var RouterGroupApp = new(RouterGroup) 18 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/import.tpl: -------------------------------------------------------------------------------- 1 | import ( 2 | "context" 3 | "database/sql" 4 | "fmt" 5 | "strings" 6 | {{if .time}}"time"{{end}} 7 | 8 | "github.com/zeromicro/go-zero/core/stores/builder" 9 | "github.com/zeromicro/go-zero/core/stores/cache" 10 | "github.com/zeromicro/go-zero/core/stores/sqlc" 11 | "github.com/zeromicro/go-zero/core/stores/sqlx" 12 | "github.com/zeromicro/go-zero/core/stringx" 13 | ) 14 | -------------------------------------------------------------------------------- /server/config/redis.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type Redis struct { 4 | Open int `mapstructure:"open" json:"open" yaml:"open"` // 是否开启redis 5 | DB int `mapstructure:"db" json:"db" yaml:"db"` // redis的哪个数据库 6 | Addr string `mapstructure:"addr" json:"addr" yaml:"addr"` // 服务器地址:端口 7 | Password string `mapstructure:"password" json:"password" yaml:"password"` // 密码 8 | } 9 | -------------------------------------------------------------------------------- /server/service/index.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "go-cms/service/business" 5 | "go-cms/service/common" 6 | 7 | "go-cms/service/system" 8 | ) 9 | 10 | type ServiceGroup struct { 11 | SystemServiceGroup system.ServiceGroup 12 | BusinessServiceGroup business.ServiceGroup 13 | CommonServiceGroup common.ServiceGroup // add by ljd 新增通用 service 14 | } 15 | 16 | var ServiceGroupApp = new(ServiceGroup) 17 | -------------------------------------------------------------------------------- /web/src/components/ReFlowChart/src/DataDialog.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 18 | -------------------------------------------------------------------------------- /web/src/assets/svg/service.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/RePureTableBar/src/svg/drag.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/import-no-cache.tpl: -------------------------------------------------------------------------------- 1 | import ( 2 | "context" 3 | "database/sql" 4 | "fmt" 5 | "strings" 6 | {{if .time}}"time"{{end}} 7 | 8 | "go-cms/common/xerr" 9 | "go-cms/common/globalkey" 10 | 11 | "github.com/zeromicro/go-zero/core/stores/builder" 12 | "github.com/zeromicro/go-zero/core/stores/sqlc" 13 | "github.com/zeromicro/go-zero/core/stores/sqlx" 14 | "github.com/zeromicro/go-zero/core/stringx" 15 | ) 16 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/rpc/server.tpl: -------------------------------------------------------------------------------- 1 | {{.head}} 2 | 3 | package server 4 | 5 | import ( 6 | {{if .notStream}}"context"{{end}} 7 | 8 | {{.imports}} 9 | ) 10 | 11 | type {{.server}}Server struct { 12 | svcCtx *svc.ServiceContext 13 | {{.unimplementedServer}} 14 | } 15 | 16 | func New{{.server}}Server(svcCtx *svc.ServiceContext) *{{.server}}Server { 17 | return &{{.server}}Server{ 18 | svcCtx: svcCtx, 19 | } 20 | } 21 | 22 | {{.funcs}} 23 | -------------------------------------------------------------------------------- /gozero/common/tool/encryption.go: -------------------------------------------------------------------------------- 1 | package tool 2 | 3 | import ( 4 | "crypto/md5" 5 | "fmt" 6 | "io" 7 | ) 8 | 9 | /** 加密方式 **/ 10 | 11 | func Md5ByString(str string) string { 12 | m := md5.New() 13 | _, err := io.WriteString(m, str) 14 | if err != nil { 15 | panic(err) 16 | } 17 | arr := m.Sum(nil) 18 | return fmt.Sprintf("%x", arr) 19 | } 20 | 21 | func Md5ByBytes(b []byte) string { 22 | return fmt.Sprintf("%x", md5.Sum(b)) 23 | } 24 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/rpc/server.tpl: -------------------------------------------------------------------------------- 1 | {{.head}} 2 | 3 | package server 4 | 5 | import ( 6 | {{if .notStream}}"context"{{end}} 7 | 8 | {{.imports}} 9 | ) 10 | 11 | type {{.server}}Server struct { 12 | svcCtx *svc.ServiceContext 13 | {{.unimplementedServer}} 14 | } 15 | 16 | func New{{.server}}Server(svcCtx *svc.ServiceContext) *{{.server}}Server { 17 | return &{{.server}}Server{ 18 | svcCtx: svcCtx, 19 | } 20 | } 21 | 22 | {{.funcs}} 23 | -------------------------------------------------------------------------------- /server/mycache/cache_test.go: -------------------------------------------------------------------------------- 1 | package mycache 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func Test2(t *testing.T) { 9 | fmt.Println("Test2") 10 | //byteData := []byte("ssss112112qweqweqwe2") 11 | byteData := "ssss112112qweqweqwe2" 12 | GetCache().Set("ssss", byteData, "") 13 | entry, err := GetCache().Get("ssss") 14 | if err != nil { 15 | fmt.Println(err.Error()) 16 | } else { 17 | fmt.Print(entry.(string)) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /gozero/common/mycache/cache_test.go: -------------------------------------------------------------------------------- 1 | package mycache 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func Test2(t *testing.T) { 9 | fmt.Println("Test2") 10 | //byteData := []byte("ssss112112qweqweqwe2") 11 | byteData := "ssss112112qweqweqwe2" 12 | GetCache().Set("ssss", byteData, 0) 13 | entry, err := GetCache().Get("ssss") 14 | if err != nil { 15 | fmt.Println(err.Error()) 16 | } else { 17 | fmt.Print(entry.(string)) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/mongo/model_types.tpl: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "time" 5 | 6 | "go.mongodb.org/mongo-driver/bson/primitive" 7 | ) 8 | 9 | type {{.Type}} struct { 10 | ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` 11 | // TODO: Fill your own fields 12 | UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` 13 | CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` 14 | } 15 | -------------------------------------------------------------------------------- /web/src/components/ReCropper/src/svg/upload.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/ReCropper/src/svg/download.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/api/list.ts: -------------------------------------------------------------------------------- 1 | import { http } from "@/utils/http"; 2 | 3 | type Result = { 4 | success: boolean; 5 | data?: { 6 | /** 列表数据 */ 7 | list: Array; 8 | }; 9 | }; 10 | 11 | /** 卡片列表 */ 12 | export const getCardList = (data?: object) => { 13 | return http.request("post", "/get-card-list", { data }); 14 | }; 15 | 16 | /** 版本日志 */ 17 | export const getReleases = () => { 18 | return http.request("get", "/releases"); 19 | }; 20 | -------------------------------------------------------------------------------- /web/src/style/tailwind.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | @layer components { 6 | .flex-c { 7 | @apply flex justify-center items-center; 8 | } 9 | 10 | .flex-ac { 11 | @apply flex justify-around items-center; 12 | } 13 | 14 | .flex-bc { 15 | @apply flex justify-between items-center; 16 | } 17 | 18 | .navbar-bg-hover { 19 | @apply dark:text-white dark:hover:!bg-[#242424]; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /web/src/components/ReCountTo/src/rebound/props.ts: -------------------------------------------------------------------------------- 1 | import { PropType } from "vue"; 2 | import propTypes from "@/utils/propTypes"; 3 | export const reboundProps = { 4 | delay: propTypes.number.def(1), 5 | blur: propTypes.number.def(2), 6 | i: { 7 | type: Number as PropType, 8 | required: false, 9 | default: 0, 10 | validator(value: number) { 11 | return value < 10 && value >= 0 && Number.isInteger(value); 12 | } 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/rpc/call-func.tpl: -------------------------------------------------------------------------------- 1 | 2 | {{if .hasComment}}{{.comment}}{{end}} 3 | func (m *default{{.serviceName}}) {{.method}}(ctx context.Context{{if .hasReq}}, in *{{.pbRequest}}{{end}}, opts ...grpc.CallOption) ({{if .notStream}}*{{.pbResponse}}, {{else}}{{.streamBody}},{{end}} error) { 4 | client := {{if .isCallPkgSameToGrpcPkg}}{{else}}{{.package}}.{{end}}New{{.rpcServiceName}}Client(m.cli.Conn()) 5 | return client.{{.method}}(ctx{{if .hasReq}}, in{{end}}, opts...) 6 | } 7 | -------------------------------------------------------------------------------- /server/core/server_win.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | package core 5 | 6 | import ( 7 | "net/http" 8 | "time" 9 | 10 | "github.com/gin-gonic/gin" 11 | ) 12 | 13 | func initServer(address string, router *gin.Engine) server { 14 | return &http.Server{ 15 | Addr: address, 16 | Handler: router, 17 | ReadTimeout: 10 * time.Second, 18 | WriteTimeout: 10 * time.Second, 19 | MaxHeaderBytes: 1 << 20, 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/import.tpl: -------------------------------------------------------------------------------- 1 | import ( 2 | "context" 3 | "database/sql" 4 | "fmt" 5 | "strings" 6 | {{if .time}}"time"{{end}} 7 | 8 | "go-cms/common/xerr" 9 | "go-cms/common/globalkey" 10 | 11 | "github.com/zeromicro/go-zero/core/stores/builder" 12 | "github.com/zeromicro/go-zero/core/stores/cache" 13 | "github.com/zeromicro/go-zero/core/stores/sqlc" 14 | "github.com/zeromicro/go-zero/core/stores/sqlx" 15 | "github.com/zeromicro/go-zero/core/stringx" 16 | ) 17 | -------------------------------------------------------------------------------- /web/src/components/RePureTableBar/src/svg/collapse.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/middleware/need_init.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "go-cms/global" 5 | "go-cms/model/common/response" 6 | 7 | "github.com/gin-gonic/gin" 8 | ) 9 | 10 | // 处理跨域请求,支持options访问 11 | func NeedInit() gin.HandlerFunc { 12 | return func(c *gin.Context) { 13 | if global.DB == nil { 14 | response.OkWithDetailed(gin.H{ 15 | "needInit": true, 16 | }, "前往初始化数据库", c) 17 | c.Abort() 18 | } else { 19 | c.Next() 20 | } 21 | // 处理请求 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /gozero/common/uuid/flakeId.go: -------------------------------------------------------------------------------- 1 | package uuid 2 | 3 | import ( 4 | "github.com/sony/sonyflake" 5 | "github.com/zeromicro/go-zero/core/logx" 6 | ) 7 | 8 | var flake *sonyflake.Sonyflake 9 | 10 | func init() { 11 | flake = sonyflake.NewSonyflake(sonyflake.Settings{}) 12 | } 13 | 14 | func GenFlakeId() int64 { 15 | 16 | id, err := flake.NextID() 17 | if err != nil { 18 | logx.Severef("flake NextID failed with %s \n", err) 19 | panic(err) 20 | } 21 | 22 | return int64(id) 23 | } 24 | -------------------------------------------------------------------------------- /server/api/v1/client/cms.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | commSev "go-cms/service/common" 5 | "net/http" 6 | 7 | "github.com/gin-gonic/gin" 8 | ) 9 | 10 | type CmsApi struct { 11 | commSev.BaseApi 12 | } 13 | 14 | // 首页 15 | func (m *CmsApi) Index(c *gin.Context) { 16 | c.HTML(http.StatusOK, "index.html", gin.H{"title": "我是测试"}) 17 | } 18 | 19 | // 首页 20 | func (m *CmsApi) Login(c *gin.Context) { 21 | c.HTML(http.StatusOK, "login.html", gin.H{"title": "我是Login测试"}) 22 | } 23 | -------------------------------------------------------------------------------- /web/src/assets/svg/day.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gozero/app/usercenter/cmd/rpc/gateway/gw.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | 7 | "github.com/zeromicro/go-zero/core/conf" 8 | "github.com/zeromicro/go-zero/gateway" 9 | ) 10 | 11 | var configFile = flag.String("f", "config.yaml", "the config file") 12 | 13 | func main() { 14 | 15 | var c gateway.GatewayConf 16 | conf.MustLoad(*configFile, &c) 17 | gw := gateway.MustNewServer(c) 18 | defer gw.Stop() 19 | fmt.Printf("启动网关 gateway server at ") 20 | gw.Start() 21 | 22 | } 23 | -------------------------------------------------------------------------------- /gozero/common/tool/coinconvert.go: -------------------------------------------------------------------------------- 1 | package tool 2 | 3 | import "github.com/shopspring/decimal" 4 | 5 | var oneHundredDecimal decimal.Decimal = decimal.NewFromInt(100) 6 | 7 | //分转元 8 | func Fen2Yuan(fen int64) float64 { 9 | y, _ := decimal.NewFromInt(fen).Div(oneHundredDecimal).Truncate(2).Float64() 10 | return y 11 | } 12 | 13 | //元转分 14 | func Yuan2Fen(yuan float64) int64 { 15 | 16 | f, _ := decimal.NewFromFloat(yuan).Mul(oneHundredDecimal).Truncate(0).Float64() 17 | return int64(f) 18 | 19 | } 20 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/api/middleware.tpl: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import "net/http" 4 | 5 | type {{.name}} struct { 6 | } 7 | 8 | func New{{.name}}() *{{.name}} { 9 | return &{{.name}}{} 10 | } 11 | 12 | func (m *{{.name}})Handle(next http.HandlerFunc) http.HandlerFunc { 13 | return func(w http.ResponseWriter, r *http.Request) { 14 | // TODO generate middleware implement function, delete after code implementation 15 | 16 | // Passthrough to next handler if need 17 | next(w, r) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /server/initialize/validator.go: -------------------------------------------------------------------------------- 1 | package initialize 2 | 3 | import "go-cms/utils" 4 | 5 | func init() { 6 | _ = utils.RegisterRule("PageVerify", 7 | utils.Rules{ 8 | "Page": {utils.NotEmpty()}, 9 | "PageSize": {utils.NotEmpty()}, 10 | }, 11 | ) 12 | _ = utils.RegisterRule("IdVerify", 13 | utils.Rules{ 14 | "Id": {utils.NotEmpty()}, 15 | }, 16 | ) 17 | _ = utils.RegisterRule("AuthorityIdVerify", 18 | utils.Rules{ 19 | "AuthorityId": {utils.NotEmpty()}, 20 | }, 21 | ) 22 | } 23 | -------------------------------------------------------------------------------- /web/src/assets/svg/user_avatar.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/utils/mitt.ts: -------------------------------------------------------------------------------- 1 | import type { Emitter } from "mitt"; 2 | import mitt from "mitt"; 3 | 4 | /** 全局公共事件需要在此处添加类型 */ 5 | type Events = { 6 | openPanel: string; 7 | tagViewsChange: string; 8 | tagViewsShowModel: string; 9 | logoChange: boolean; 10 | changLayoutRoute: string; 11 | imageInfo: { 12 | img: HTMLImageElement; 13 | height: number; 14 | width: number; 15 | x: number; 16 | y: number; 17 | }; 18 | }; 19 | 20 | export const emitter: Emitter = mitt(); 21 | -------------------------------------------------------------------------------- /web/types/shims-vue.d.ts: -------------------------------------------------------------------------------- 1 | declare module "*.vue" { 2 | import { DefineComponent } from "vue"; 3 | const component: DefineComponent<{}, {}, any>; 4 | export default component; 5 | } 6 | 7 | declare module "*.scss" { 8 | const scss: Record; 9 | export default scss; 10 | } 11 | 12 | declare module "vue-virtual-scroller"; 13 | declare module "vuedraggable/src/vuedraggable"; 14 | declare module "element-plus/dist/locale/en.mjs"; 15 | declare module "element-plus/dist/locale/zh-cn.mjs"; 16 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/api/middleware.tpl: -------------------------------------------------------------------------------- 1 | 2 | package middleware 3 | 4 | import "net/http" 5 | 6 | type {{.name}} struct { 7 | } 8 | 9 | func New{{.name}}() *{{.name}} { 10 | return &{{.name}}{} 11 | } 12 | 13 | func (m *{{.name}})Handle(next http.HandlerFunc) http.HandlerFunc { 14 | return func(w http.ResponseWriter, r *http.Request) { 15 | // TODO generate middleware implement function, delete after code implementation 16 | 17 | // Passthrough to next handler if need 18 | next(w, r) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /gozero/app/cms/cmd/api/internal/handler/cms/catListHandler.go: -------------------------------------------------------------------------------- 1 | package cms 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go-cms/app/cms/cmd/api/internal/logic/cms" 7 | "go-cms/app/cms/cmd/api/internal/svc" 8 | "go-cms/common/result" 9 | ) 10 | 11 | func CatListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 12 | return func(w http.ResponseWriter, r *http.Request) { 13 | l := cms.NewCatListLogic(r.Context(), svcCtx) 14 | resp, err := l.CatList() 15 | result.HttpResult(r, w, resp, err, "") 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /web/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:16-alpine as build-stage 2 | 3 | WORKDIR /app 4 | RUN corepack enable 5 | RUN corepack prepare pnpm@7.32.1 --activate 6 | 7 | RUN npm config set registry https://registry.npmmirror.com 8 | 9 | COPY .npmrc package.json pnpm-lock.yaml ./ 10 | RUN pnpm install --frozen-lockfile 11 | 12 | COPY . . 13 | RUN pnpm build 14 | 15 | FROM nginx:stable-alpine as production-stage 16 | 17 | COPY --from=build-stage /app/dist /usr/share/nginx/html 18 | EXPOSE 80 19 | 20 | CMD ["nginx", "-g", "daemon off;"] -------------------------------------------------------------------------------- /gozero/app/usercenter/cmd/rpc/gateway/config.yaml: -------------------------------------------------------------------------------- 1 | Name: app-gateway 2 | Host: 127.0.0.1 3 | Port: 8888 4 | Upstreams: 5 | - Grpc: 6 | Endpoints: 7 | - 127.0.0.1:2001 8 | Mappings: 9 | - Method: post 10 | Path: /usercenter/login 11 | RpcPath: usercenter.usercenter/Login 12 | 13 | - Grpc: 14 | Endpoints: 15 | - 127.0.0.1:2001 16 | Mappings: 17 | - Method: get 18 | Path: /usercenter/Register 19 | RpcPath: usercenter.usercenter/Register -------------------------------------------------------------------------------- /web/src/directives/auth/index.ts: -------------------------------------------------------------------------------- 1 | import { hasAuth } from "@/router/utils"; 2 | import type { Directive, DirectiveBinding } from "vue"; 3 | 4 | export const auth: Directive = { 5 | mounted(el: HTMLElement, binding: DirectiveBinding) { 6 | const { value } = binding; 7 | if (value) { 8 | !hasAuth(value) && el.parentNode?.removeChild(el); 9 | } else { 10 | throw new Error( 11 | "[Directive: auth]: need auths! Like v-auth=\"['btn.add','btn.edit']\"" 12 | ); 13 | } 14 | } 15 | }; 16 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/rpc/logic.tpl: -------------------------------------------------------------------------------- 1 | package logic 2 | 3 | import ( 4 | "context" 5 | 6 | {{.imports}} 7 | 8 | "github.com/zeromicro/go-zero/core/logx" 9 | ) 10 | 11 | type {{.logicName}} struct { 12 | ctx context.Context 13 | svcCtx *svc.ServiceContext 14 | logx.Logger 15 | } 16 | 17 | func New{{.logicName}}(ctx context.Context,svcCtx *svc.ServiceContext) *{{.logicName}} { 18 | return &{{.logicName}}{ 19 | ctx: ctx, 20 | svcCtx: svcCtx, 21 | Logger: logx.WithContext(ctx), 22 | } 23 | } 24 | {{.functions}} 25 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/rpc/server-func.tpl: -------------------------------------------------------------------------------- 1 | 2 | {{if .hasComment}}{{.comment}}{{end}} 3 | func (s *{{.server}}Server) {{.method}} ({{if .notStream}}ctx context.Context,{{if .hasReq}} in {{.request}}{{end}}{{else}}{{if .hasReq}} in {{.request}},{{end}}stream {{.streamBody}}{{end}}) ({{if .notStream}}{{.response}},{{end}}error) { 4 | l := logic.New{{.logicName}}({{if .notStream}}ctx,{{else}}stream.Context(),{{end}}s.svcCtx) 5 | return l.{{.method}}({{if .hasReq}}in{{if .stream}} ,stream{{end}}{{else}}{{if .stream}}stream{{end}}{{end}}) 6 | } 7 | -------------------------------------------------------------------------------- /web/src/components/ReSelector/src/index.css: -------------------------------------------------------------------------------- 1 | .hs-rate__icon { 2 | font-size: 18px; 3 | transition: 0.3s; 4 | } 5 | 6 | .hs-item { 7 | width: 30px; 8 | height: 30px; 9 | box-sizing: border-box; 10 | line-height: 30px; 11 | } 12 | 13 | .hs-on { 14 | background-color: #409eff; 15 | border-radius: 50%; 16 | } 17 | 18 | .hs-range { 19 | background-color: #f2f6fc; 20 | } 21 | 22 | .both-left-sides { 23 | border-radius: 50% 0 0 50%; 24 | } 25 | 26 | .both-right-sides { 27 | border-radius: 0 50% 50% 0; 28 | } 29 | -------------------------------------------------------------------------------- /server/config/license.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type License struct { 4 | RsaPath string `mapstructure:"rsaPath" json:"rsaPath" yaml:"rsaPath"` 5 | AppId string `mapstructure:"appId" json:"appId" yaml:"appId"` 6 | MaxClient string `mapstructure:"maxClient" json:"maxClient" yaml:"maxClient"` 7 | EndTime string `mapstructure:"endTime" json:"endTime" yaml:"endTime"` 8 | RtcType string `mapstructure:"rtcType" json:"rtcType" yaml:rtcType"` 9 | License string `mapstructure:"license" json:"license" yaml:"license"` 10 | } 11 | -------------------------------------------------------------------------------- /web/src/components/ReAuth/src/auth.tsx: -------------------------------------------------------------------------------- 1 | import { defineComponent, Fragment } from "vue"; 2 | import { hasAuth } from "@/router/utils"; 3 | 4 | export default defineComponent({ 5 | name: "Auth", 6 | props: { 7 | value: { 8 | type: undefined, 9 | default: [] 10 | } 11 | }, 12 | setup(props, { slots }) { 13 | return () => { 14 | if (!slots) return null; 15 | return hasAuth(props.value) ? ( 16 | {slots.default?.()} 17 | ) : null; 18 | }; 19 | } 20 | }); 21 | -------------------------------------------------------------------------------- /web/src/layout/redirect.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 25 | -------------------------------------------------------------------------------- /server/myError/ettorType.go: -------------------------------------------------------------------------------- 1 | package myError 2 | 3 | type ErrorType int 4 | 5 | //在一个 const 声明块中,iota 的初始值为0,每声明一个变量,自增1。以上的代码可以简化成 6 | const ( 7 | //成功=0 8 | ErrOK ErrorType = iota 9 | //失败=1 10 | ErrFail 11 | //DB没有数据 12 | ErrDbNoRecord 13 | //DB更新失败 14 | ErrDbUpdate 15 | //DB新增失败 16 | ErrDbInsert 17 | //DB删除失败 18 | ErrDbDel 19 | 20 | //File删除失败 21 | ErrFileDel 22 | //File写入失败 23 | ErrFileWrite 24 | //File读取失败 25 | ErrFileRead 26 | 27 | //启动收集器错误 28 | ErrRunCollectErr 29 | //停止收集器错误 30 | ErrStopCollectErr 31 | ) 32 | -------------------------------------------------------------------------------- /web/src/components/ReSegmented/src/type.ts: -------------------------------------------------------------------------------- 1 | import type { VNode, Component } from "vue"; 2 | 3 | export interface OptionsType { 4 | /** 文字 */ 5 | label?: string | (() => VNode | Component); 6 | /** 7 | * @description 图标,采用平台内置的 `useRenderIcon` 函数渲染 8 | * @see {@link 用法参考 https://yiming_chang.gitee.io/pure-admin-doc/pages/icon/#%E9%80%9A%E7%94%A8%E5%9B%BE%E6%A0%87-userendericon-hooks } 9 | */ 10 | icon?: string | Component; 11 | /** 值 */ 12 | value?: string | number; 13 | /** 是否禁用 */ 14 | disabled?: boolean; 15 | } 16 | -------------------------------------------------------------------------------- /gozero/common/uuid/sn.go: -------------------------------------------------------------------------------- 1 | package uuid 2 | 3 | import ( 4 | "fmt" 5 | "go-cms/common/tool" 6 | "time" 7 | ) 8 | 9 | // 生成sn单号 10 | type SnPrefix string 11 | 12 | const ( 13 | SN_PREFIX_HOMESTAY_ORDER SnPrefix = "ACT" // 订单前缀 go-cms_order/homestay_order 14 | SN_PREFIX_THIRD_PAYMENT SnPrefix = "THR" //第三方支付流水记录前缀 go-cms_payment/third_payment 15 | ) 16 | 17 | // 生成单号 18 | func GenSn(snPrefix SnPrefix) string { 19 | return fmt.Sprintf("%s%s%s", snPrefix, time.Now().Format("20060102150405"), tool.Krand(8, tool.KC_RAND_KIND_NUM)) 20 | } 21 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/rpc/logic.tpl: -------------------------------------------------------------------------------- 1 | package {{.packageName}} 2 | 3 | import ( 4 | "context" 5 | 6 | {{.imports}} 7 | 8 | "github.com/zeromicro/go-zero/core/logx" 9 | ) 10 | 11 | type {{.logicName}} struct { 12 | ctx context.Context 13 | svcCtx *svc.ServiceContext 14 | logx.Logger 15 | } 16 | 17 | func New{{.logicName}}(ctx context.Context,svcCtx *svc.ServiceContext) *{{.logicName}} { 18 | return &{{.logicName}}{ 19 | ctx: ctx, 20 | svcCtx: svcCtx, 21 | Logger: logx.WithContext(ctx), 22 | } 23 | } 24 | {{.functions}} 25 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/rpc/server-func.tpl: -------------------------------------------------------------------------------- 1 | 2 | {{if .hasComment}}{{.comment}}{{end}} 3 | func (s *{{.server}}Server) {{.method}} ({{if .notStream}}ctx context.Context,{{if .hasReq}} in {{.request}}{{end}}{{else}}{{if .hasReq}} in {{.request}},{{end}}stream {{.streamBody}}{{end}}) ({{if .notStream}}{{.response}},{{end}}error) { 4 | l := {{.logicPkg}}.New{{.logicName}}({{if .notStream}}ctx,{{else}}stream.Context(),{{end}}s.svcCtx) 5 | return l.{{.method}}({{if .hasReq}}in{{if .stream}} ,stream{{end}}{{else}}{{if .stream}}stream{{end}}{{end}}) 6 | } 7 | -------------------------------------------------------------------------------- /web/src/layout/hooks/useBoolean.ts: -------------------------------------------------------------------------------- 1 | import { ref } from "vue"; 2 | 3 | export function useBoolean(initValue = false) { 4 | const bool = ref(initValue); 5 | 6 | function setBool(value: boolean) { 7 | bool.value = value; 8 | } 9 | function setTrue() { 10 | setBool(true); 11 | } 12 | function setFalse() { 13 | setBool(false); 14 | } 15 | function toggle() { 16 | setBool(!bool.value); 17 | } 18 | 19 | return { 20 | bool, 21 | setBool, 22 | setTrue, 23 | setFalse, 24 | toggle 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /web/src/router/modules/about.ts--: -------------------------------------------------------------------------------- 1 | import { $t } from "@/plugins/i18n"; 2 | import { about } from "@/router/enums"; 3 | 4 | export default { 5 | path: "/about", 6 | redirect: "/about/index", 7 | meta: { 8 | title: $t("menus.hsAbout"), 9 | rank: about 10 | }, 11 | children: [ 12 | { 13 | path: "/about/index", 14 | name: "About", 15 | component: () => import("@/views/about/index.vue"), 16 | meta: { 17 | title: $t("menus.hsAbout") 18 | } 19 | } 20 | ] 21 | } satisfies RouteConfigsTable; 22 | -------------------------------------------------------------------------------- /web/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | darkMode: "class", 4 | corePlugins: { 5 | preflight: false 6 | }, 7 | content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"], 8 | theme: { 9 | extend: { 10 | colors: { 11 | bg_color: "var(--el-bg-color)", 12 | primary: "var(--el-color-primary)", 13 | text_color_primary: "var(--el-text-color-primary)", 14 | text_color_regular: "var(--el-text-color-regular)" 15 | } 16 | } 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /server/core/server_other.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | // +build !windows 3 | 4 | package core 5 | 6 | import ( 7 | "github.com/fvbock/endless" 8 | "github.com/gin-gonic/gin" 9 | "time" 10 | ) 11 | 12 | func initServer(address string, router *gin.Engine) server { 13 | s := endless.NewServer(address, router) 14 | //* 不通过本地nginx代理,直接访问时,10ms会导致概率性请求失败 15 | //s.ReadHeaderTimeout = 10 * time.Millisecond Second 16 | s.ReadHeaderTimeout = 10 * time.Second 17 | s.WriteTimeout = 10 * time.Second 18 | s.MaxHeaderBytes = 1 << 20 19 | return s 20 | } 21 | -------------------------------------------------------------------------------- /web/src/layout/components/sidebar/extraIcon.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 21 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/rpc/internal/config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "github.com/zeromicro/go-queue/kq" 5 | "github.com/zeromicro/go-zero/core/stores/cache" 6 | "github.com/zeromicro/go-zero/zrpc" 7 | ) 8 | 9 | type Config struct { 10 | zrpc.RpcServerConf 11 | DB struct { 12 | DataSource string 13 | } 14 | Cache cache.CacheConf 15 | 16 | //Redis redis.RedisConf 17 | //邮件发送 Kq : pub sub 18 | SendEmailConf kq.KqConf 19 | //短信发送 Kq : pub sub 20 | SendSmsConf kq.KqConf 21 | //image zip 图片压缩 22 | ImageZipConf kq.KqConf 23 | } 24 | -------------------------------------------------------------------------------- /gozero/app/usercenter/cmd/api/internal/handler/user/tokenVerifyHandler.go: -------------------------------------------------------------------------------- 1 | package user 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go-cms/app/usercenter/cmd/api/internal/logic/user" 7 | "go-cms/app/usercenter/cmd/api/internal/svc" 8 | "go-cms/common/result" 9 | ) 10 | 11 | func TokenVerifyHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 12 | return func(w http.ResponseWriter, r *http.Request) { 13 | l := user.NewTokenVerifyLogic(r.Context(), svcCtx) 14 | resp, err := l.TokenVerify() 15 | result.HttpResult(r, w, resp, err, "") 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gozero/app/usercenter/cmd/rpc/internal/config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "github.com/zeromicro/go-zero/core/stores/cache" 5 | "github.com/zeromicro/go-zero/zrpc" 6 | ) 7 | 8 | type Config struct { 9 | zrpc.RpcServerConf 10 | JwtAuth struct { 11 | AccessSecret string 12 | AccessExpire int64 13 | } 14 | DB struct { 15 | DataSource string 16 | } 17 | Cache cache.CacheConf 18 | 19 | LocalRes struct { 20 | BaseUrl string 21 | BasePath string 22 | Path string 23 | PathUser string 24 | RtcModel int 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /server/model/common/response/common.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | type PageResult struct { 4 | List interface{} `json:"list"` 5 | Total int64 `json:"total"` 6 | Page int `json:"page"` 7 | PageSize int `json:"pageSize"` 8 | } 9 | 10 | // 文件简单类型 add by ljd 11 | type FileObj struct { 12 | Url string `json:"url"` 13 | Guid string `json:"Guid"` 14 | MediaType int `json:"mediaType"` 15 | Ext string `json:"ext"` 16 | } 17 | 18 | // 返回id 19 | type IdResp struct { 20 | Id int64 `json:"id" form:"id"` 21 | } 22 | -------------------------------------------------------------------------------- /web/src/api/common_file.ts: -------------------------------------------------------------------------------- 1 | import { httpUp } from "@/utils/httpupload"; 2 | import { http,resData } from "@/utils/http"; 3 | 4 | export const getFileByKey = (params) => { 5 | return http.request("get", "/commFile/getFileByKey", { params }); 6 | } 7 | 8 | 9 | export const uploadFile = (data) => { 10 | return httpUp.request("post", "/commFile/upload", { data }); 11 | } 12 | 13 | /** myUpload */ 14 | export const myUpload = (data?: object) => { 15 | return httpUp.request("post", "/commFile/upload", { data }); 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /web/src/components/ReIcon/src/types.ts: -------------------------------------------------------------------------------- 1 | export interface iconType { 2 | // iconify (https://docs.iconify.design/icon-components/vue/#properties) 3 | inline?: boolean; 4 | width?: string | number; 5 | height?: string | number; 6 | horizontalFlip?: boolean; 7 | verticalFlip?: boolean; 8 | flip?: string; 9 | rotate?: number | string; 10 | color?: string; 11 | horizontalAlign?: boolean; 12 | verticalAlign?: boolean; 13 | align?: string; 14 | onLoad?: Function; 15 | includes?: Function; 16 | 17 | // all icon 18 | style?: object; 19 | } 20 | -------------------------------------------------------------------------------- /web/types/shims-tsx.d.ts: -------------------------------------------------------------------------------- 1 | import Vue, { VNode } from "vue"; 2 | 3 | declare module "*.tsx" { 4 | import Vue from "compatible-vue"; 5 | export default Vue; 6 | } 7 | 8 | declare global { 9 | namespace JSX { 10 | interface Element extends VNode {} 11 | interface ElementClass extends Vue {} 12 | interface ElementAttributesProperty { 13 | $props: any; 14 | } 15 | interface IntrinsicElements { 16 | [elem: string]: any; 17 | } 18 | interface IntrinsicAttributes { 19 | [elem: string]: any; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /web/src/components/ReCropper/src/svg/search-minus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/ReFlowChart/index.ts: -------------------------------------------------------------------------------- 1 | import control from "./src/Control.vue"; 2 | import nodePanel from "./src/NodePanel.vue"; 3 | import dataDialog from "./src/DataDialog.vue"; 4 | import { withInstall } from "@pureadmin/utils"; 5 | 6 | /** LogicFlow流程图-控制面板 */ 7 | const Control = withInstall(control); 8 | 9 | /** LogicFlow流程图-拖拽面板 */ 10 | const NodePanel = withInstall(nodePanel); 11 | 12 | /** LogicFlow流程图-查看数据 */ 13 | const DataDialog = withInstall(dataDialog); 14 | 15 | export { Control, NodePanel, DataDialog }; 16 | 17 | // LogicFlow流程图文档:http://logic-flow.org/ 18 | -------------------------------------------------------------------------------- /web/.lintstagedrc: -------------------------------------------------------------------------------- 1 | { 2 | "*.{js,jsx,ts,tsx}": [ 3 | "prettier --cache --ignore-unknown --write", 4 | "eslint --cache --fix" 5 | ], 6 | "{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": [ 7 | "prettier --cache --write--parser json" 8 | ], 9 | "package.json": ["prettier --cache --write"], 10 | "*.vue": ["prettier --write", "eslint --cache --fix", "stylelint --fix"], 11 | "*.{css,scss,html}": [ 12 | "prettier --cache --ignore-unknown --write", 13 | "stylelint --fix" 14 | ], 15 | "*.md": ["prettier --cache --ignore-unknown --write"] 16 | } 17 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/rpc/internal/listen/listen.go: -------------------------------------------------------------------------------- 1 | package listen 2 | 3 | import ( 4 | "context" 5 | "go-cms/app/basic/cmd/rpc/internal/config" 6 | "go-cms/app/basic/cmd/rpc/internal/svc" 7 | 8 | "github.com/zeromicro/go-zero/core/service" 9 | ) 10 | 11 | // back to all consumers 12 | func Mqs(c config.Config) []service.Service { 13 | 14 | svcContext := svc.NewServiceContext(c) 15 | ctx := context.Background() 16 | 17 | var services []service.Service 18 | 19 | //kq :pub sub 20 | services = append(services, KqMqs(c, ctx, svcContext)...) 21 | 22 | return services 23 | } 24 | -------------------------------------------------------------------------------- /server/middleware/loadtls.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "fmt" 5 | "github.com/gin-gonic/gin" 6 | "github.com/unrolled/secure" 7 | ) 8 | 9 | // 用https把这个中间件在router里面use一下就好 10 | 11 | func LoadTls() gin.HandlerFunc { 12 | return func(c *gin.Context) { 13 | middleware := secure.New(secure.Options{ 14 | SSLRedirect: true, 15 | SSLHost: "localhost:443", 16 | }) 17 | err := middleware.Process(c.Writer, c.Request) 18 | if err != nil { 19 | // 如果出现错误,请不要继续 20 | fmt.Println(err) 21 | return 22 | } 23 | // 继续往下处理 24 | c.Next() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /web/src/components/ReIcon/index.ts: -------------------------------------------------------------------------------- 1 | import iconifyIconOffline from "./src/iconifyIconOffline"; 2 | import iconifyIconOnline from "./src/iconifyIconOnline"; 3 | import iconSelect from "./src/Select.vue"; 4 | import fontIcon from "./src/iconfont"; 5 | 6 | /** 本地图标组件 */ 7 | const IconifyIconOffline = iconifyIconOffline; 8 | /** 在线图标组件 */ 9 | const IconifyIconOnline = iconifyIconOnline; 10 | /** `IconSelect`图标选择器组件 */ 11 | const IconSelect = iconSelect; 12 | /** `iconfont`组件 */ 13 | const FontIcon = fontIcon; 14 | 15 | export { IconifyIconOffline, IconifyIconOnline, IconSelect, FontIcon }; 16 | -------------------------------------------------------------------------------- /gozero/common/result/responseBean.go: -------------------------------------------------------------------------------- 1 | package result 2 | 3 | type ResponseSuccessBean struct { 4 | Code uint32 `json:"code"` 5 | Msg string `json:"msg"` 6 | Data interface{} `json:"data"` 7 | } 8 | type NullJson struct{} 9 | 10 | func Success(data interface{}) *ResponseSuccessBean { 11 | return &ResponseSuccessBean{200, "成功", data} 12 | } 13 | 14 | type ResponseErrorBean struct { 15 | Code uint32 `json:"code"` 16 | Msg string `json:"msg"` 17 | } 18 | 19 | func Error(errCode uint32, errMsg string) *ResponseErrorBean { 20 | return &ResponseErrorBean{errCode, errMsg} 21 | } 22 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/api/main.tpl: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | 7 | {{.importPackages}} 8 | ) 9 | 10 | var configFile = flag.String("f", "etc/{{.serviceName}}.yaml", "the config file") 11 | 12 | func main() { 13 | flag.Parse() 14 | 15 | var c config.Config 16 | conf.MustLoad(*configFile, &c) 17 | 18 | server := rest.MustNewServer(c.RestConf) 19 | defer server.Stop() 20 | 21 | ctx := svc.NewServiceContext(c) 22 | handler.RegisterHandlers(server, ctx) 23 | 24 | fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port) 25 | server.Start() 26 | } 27 | -------------------------------------------------------------------------------- /server/router/business/index.go: -------------------------------------------------------------------------------- 1 | package business 2 | 3 | type RouterGroup struct { 4 | // golang_coder Begin; DO NOT EDIT. 5 | SysApisRouter 6 | SysMenuRouter 7 | SysLogsRouter 8 | SysRoleRouter 9 | MemUserRouter 10 | MemLogsRouter 11 | MemDepartRouter 12 | MemUserSafeRouter 13 | BasicFileRouter 14 | BasicDictRouter 15 | BasicFileCatRouter 16 | CmsDetailRouter 17 | CmsVisitorRouter 18 | CmsDiscussRouter 19 | CmsCatArtRouter 20 | CmsCatRouter 21 | CmsBlogRouter 22 | CmsGroupRouter 23 | CmsTagRouter 24 | CmsArtRouter 25 | // golang_coder End; DO NOT EDIT. 26 | 27 | } 28 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/find-one-by-field-extra-method.tpl: -------------------------------------------------------------------------------- 1 | 2 | func (m *default{{.upperStartCamelObject}}Model) formatPrimary(primary interface{}) string { 3 | return fmt.Sprintf("%s%v", {{.primaryKeyLeft}}, primary) 4 | } 5 | 6 | func (m *default{{.upperStartCamelObject}}Model) queryPrimary(ctx context.Context, conn sqlx.SqlConn, v, primary interface{}) error { 7 | query := fmt.Sprintf("select %s from %s where {{.originalPrimaryField}} = {{if .postgreSql}}$1{{else}}?{{end}} limit 1", {{.lowerStartCamelObject}}Rows, m.table ) 8 | return conn.QueryRowCtx(ctx, v, query, primary) 9 | } 10 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/api/logic.tpl: -------------------------------------------------------------------------------- 1 | package {{.pkgName}} 2 | 3 | import ( 4 | {{.imports}} 5 | ) 6 | 7 | type {{.logic}} struct { 8 | logx.Logger 9 | ctx context.Context 10 | svcCtx *svc.ServiceContext 11 | } 12 | 13 | func New{{.logic}}(ctx context.Context, svcCtx *svc.ServiceContext) {{.logic}} { 14 | return {{.logic}}{ 15 | Logger: logx.WithContext(ctx), 16 | ctx: ctx, 17 | svcCtx: svcCtx, 18 | } 19 | } 20 | 21 | func (l *{{.logic}}) {{.function}}({{.request}}) {{.responseType}} { 22 | // todo: add your logic here and delete this line 23 | 24 | {{.returnString}} 25 | } 26 | -------------------------------------------------------------------------------- /web/src/components/ReSplitPane/iconfont/iconfont.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "3268330", 3 | "name": "split", 4 | "font_family": "iconfont", 5 | "css_prefix_text": "icon-", 6 | "description": "", 7 | "glyphs": [ 8 | { 9 | "icon_id": "22378774", 10 | "name": "拖拽", 11 | "font_class": "tuozhuai1", 12 | "unicode": "e647", 13 | "unicode_decimal": 58951 14 | }, 15 | { 16 | "icon_id": "23570521", 17 | "name": "拖拽", 18 | "font_class": "tuozhuai1-copy", 19 | "unicode": "eda3", 20 | "unicode_decimal": 60835 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /gozero/app/cms/cmd/api/internal/config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "go-cms/common" 5 | 6 | "github.com/zeromicro/go-zero/core/logc" 7 | "github.com/zeromicro/go-zero/core/stores/redis" 8 | "github.com/zeromicro/go-zero/rest" 9 | ) 10 | 11 | type Config struct { 12 | rest.RestConf 13 | JwtAuth struct { 14 | AccessSecret string 15 | AccessExpire int64 16 | } 17 | DB common.DbConf 18 | 19 | Redis redis.RedisConf 20 | LocalRes struct { 21 | BaseUrl string 22 | BasePath string 23 | Path string 24 | PathUser string 25 | } 26 | LogConf logc.LogConf 27 | } 28 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/api/logic.tpl: -------------------------------------------------------------------------------- 1 | package {{.pkgName}} 2 | 3 | import ( 4 | {{.imports}} 5 | ) 6 | 7 | type {{.logic}} struct { 8 | logx.Logger 9 | ctx context.Context 10 | svcCtx *svc.ServiceContext 11 | } 12 | 13 | func New{{.logic}}(ctx context.Context, svcCtx *svc.ServiceContext) *{{.logic}} { 14 | return &{{.logic}}{ 15 | Logger: logx.WithContext(ctx), 16 | ctx: ctx, 17 | svcCtx: svcCtx, 18 | } 19 | } 20 | 21 | func (l *{{.logic}}) {{.function}}({{.request}}) {{.responseType}} { 22 | // todo: add your logic here and delete this line 23 | 24 | {{.returnString}} 25 | } 26 | -------------------------------------------------------------------------------- /web/src/assets/svg/back_top.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/router/system/baseMenu.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | v1 "go-cms/api/v1" 5 | "go-cms/middleware" 6 | 7 | "github.com/gin-gonic/gin" 8 | ) 9 | 10 | type MenuRouter struct { 11 | } 12 | 13 | func (s *MenuRouter) InitMenuRouter(Router *gin.RouterGroup) (R gin.IRoutes) { 14 | menuRouter := Router.Group("base").Use(middleware.OperationRecord()) 15 | menuRouterWithoutRecord := Router.Group("base") 16 | var baseMenuApi = v1.ApiGroupApp.SystemApiGroup.BaseMenuApi 17 | { 18 | menuRouterWithoutRecord.GET("getMenu", baseMenuApi.GetMenu) // 获取菜单树 19 | 20 | } 21 | return menuRouter 22 | } 23 | -------------------------------------------------------------------------------- /web/.env.staging: -------------------------------------------------------------------------------- 1 | # 预发布也需要生产环境的行为 2 | # https://cn.vitejs.dev/guide/env-and-mode.html#modes 3 | # NODE_ENV = development 4 | 5 | VITE_PUBLIC_PATH = / 6 | 7 | # 预发布环境路由历史模式(Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数") 8 | VITE_ROUTER_HISTORY = "hash" 9 | 10 | # 是否在打包时使用cdn替换本地库 替换 true 不替换 false 11 | VITE_CDN = true 12 | 13 | # 是否启用gzip压缩或brotli压缩(分两种情况,删除原始文件和不删除原始文件) 14 | # 压缩时不删除原始文件的配置:gzip、brotli、both(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认) 15 | # 压缩时删除原始文件的配置:gzip-clear、brotli-clear、both-clear(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认) 16 | VITE_COMPRESSION = "none" 17 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/find-one-by-field-extra-method.tpl: -------------------------------------------------------------------------------- 1 | func (m *default{{.upperStartCamelObject}}Model) formatPrimary(primary interface{}) string { 2 | return fmt.Sprintf("%s%v", {{.primaryKeyLeft}}, primary) 3 | } 4 | func (m *default{{.upperStartCamelObject}}Model) queryPrimary(ctx context.Context, conn sqlx.SqlConn, v, primary interface{}) error { 5 | query := fmt.Sprintf("select %s from %s where {{.originalPrimaryField}} = {{if .postgreSql}}$1{{else}}?{{end}} and del_state = ? limit 1", {{.lowerStartCamelObject}}Rows, m.table ) 6 | return conn.QueryRowCtx(ctx, v, query, primary,globalkey.DelStateNo) 7 | } 8 | -------------------------------------------------------------------------------- /web/src/components/ReSplitPane/resizer.tsx: -------------------------------------------------------------------------------- 1 | import { computed, unref, defineComponent } from "vue"; 2 | import "./resizer.css"; 3 | 4 | export default defineComponent({ 5 | name: "Resizer", 6 | props: { 7 | split: { 8 | type: String, 9 | required: true 10 | }, 11 | className: { 12 | type: String, 13 | default: "" 14 | } 15 | }, 16 | setup(props) { 17 | const classes = computed(() => { 18 | return ["splitter-pane-resizer", props.split, props.className].join(" "); 19 | }); 20 | 21 | return () =>
; 22 | } 23 | }); 24 | -------------------------------------------------------------------------------- /web/src/layout/components/notice/noticeList.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 24 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/api/main.tpl: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | 7 | {{.importPackages}} 8 | "go-cms/common/middleware" 9 | ) 10 | 11 | var configFile = flag.String("f", "etc/{{.serviceName}}.yaml", "the config file") 12 | 13 | func main() { 14 | flag.Parse() 15 | 16 | var c config.Config 17 | conf.MustLoad(*configFile, &c) 18 | 19 | ctx := svc.NewServiceContext(c) 20 | server := rest.MustNewServer(c.RestConf) 21 | defer server.Stop() 22 | 23 | handler.RegisterHandlers(server, ctx) 24 | 25 | fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port) 26 | server.Start() 27 | } 28 | -------------------------------------------------------------------------------- /web/src/layout/components/search/index.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 21 | -------------------------------------------------------------------------------- /gozero/app/usercenter/cmd/api/internal/handler/user/detailHandler.go: -------------------------------------------------------------------------------- 1 | package user 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go-cms/app/usercenter/cmd/api/internal/logic/user" 7 | "go-cms/app/usercenter/cmd/api/internal/svc" 8 | "go-cms/common/ctxdata" 9 | "go-cms/common/result" 10 | ) 11 | 12 | func DetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 13 | return func(w http.ResponseWriter, r *http.Request) { 14 | l := user.NewDetailLogic(r.Context(), svcCtx) 15 | userId := ctxdata.GetUidFromCtx(r.Context()) 16 | resp, err := l.Detail(userId) 17 | result.HttpResult(r, w, resp, err, userId) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /server/initialize/timer.go: -------------------------------------------------------------------------------- 1 | package initialize 2 | 3 | import ( 4 | "fmt" 5 | 6 | "go-cms/config" 7 | "go-cms/global" 8 | "go-cms/utils" 9 | ) 10 | 11 | func Timer() { 12 | if global.CONFIG.Timer.Start { 13 | for i := range global.CONFIG.Timer.Detail { 14 | go func(detail config.Detail) { 15 | global.Timer.AddTaskByFunc("ClearDB", global.CONFIG.Timer.Spec, func() { 16 | err := utils.ClearTable(global.DB, detail.TableName, detail.CompareField, detail.Interval) 17 | if err != nil { 18 | fmt.Println("timer error:", err) 19 | } 20 | }) 21 | }(global.CONFIG.Timer.Detail[i]) 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /gozero/common/uuid/nanoid.go: -------------------------------------------------------------------------------- 1 | package uuid 2 | 3 | import ( 4 | "github.com/jaevor/go-nanoid" 5 | "github.com/zeromicro/go-zero/core/logx" 6 | ) 7 | 8 | // len 长度 , 大于10 保障 1000万不重复 9 | func Nanoid(len int) string { 10 | str := "0123456789abcdefghijklmnopqrstuvwsyzABCDEFGHIJKLMNOPQRSTUVWXYZ" 11 | nid, err := nanoid.CustomASCII(str, len) 12 | if err != nil { 13 | logx.Errorf("nanoid错误,%s", err.Error()) 14 | } 15 | return nid() 16 | } 17 | 18 | // nanoid 默认21位 19 | func NanoidDef() string { 20 | nid, err := nanoid.Standard(21) 21 | if err != nil { 22 | logx.Errorf("nanoid错误 %s", err.Error()) 23 | } 24 | return nid() 25 | } 26 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/rpc/call.tpl: -------------------------------------------------------------------------------- 1 | {{.head}} 2 | 3 | package {{.filePackage}} 4 | 5 | import ( 6 | "context" 7 | 8 | {{.pbPackage}} 9 | {{if ne .pbPackage .protoGoPackage}}{{.protoGoPackage}}{{end}} 10 | 11 | "github.com/zeromicro/go-zero/zrpc" 12 | "google.golang.org/grpc" 13 | ) 14 | 15 | type ( 16 | {{.alias}} 17 | 18 | {{.serviceName}} interface { 19 | {{.interface}} 20 | } 21 | 22 | default{{.serviceName}} struct { 23 | cli zrpc.Client 24 | } 25 | ) 26 | 27 | func New{{.serviceName}}(cli zrpc.Client) {{.serviceName}} { 28 | return &default{{.serviceName}}{ 29 | cli: cli, 30 | } 31 | } 32 | 33 | {{.functions}} 34 | -------------------------------------------------------------------------------- /server/api/v1/business/index.go: -------------------------------------------------------------------------------- 1 | package business 2 | 3 | import commSev "go-cms/service/common" 4 | 5 | type ApiGroup struct { 6 | commSev.BaseApi 7 | // golang_coder Begin; DO NOT EDIT. 8 | BasicFileCatApi 9 | BasicDictApi 10 | BasicFileApi 11 | 12 | MemUserApi 13 | MemDepartApi 14 | MemLogsApi 15 | MemUserSafeApi 16 | SysMenuApi 17 | SysApisApi 18 | SysRoleApi 19 | SysRoleMenuApi 20 | SysLogsApi 21 | 22 | CmsDetailApi 23 | CmsVisitorApi 24 | CmsDiscussApi 25 | CmsCatArtApi 26 | CmsCatApi 27 | CmsBlogApi 28 | CmsGroupApi 29 | CmsTagApi 30 | CmsArtApi 31 | // golang_coder End; DO NOT EDIT. 32 | // 新增 33 | 34 | } 35 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/rpc/call.tpl: -------------------------------------------------------------------------------- 1 | {{.head}} 2 | 3 | package {{.filePackage}} 4 | 5 | import ( 6 | "context" 7 | 8 | {{.pbPackage}} 9 | {{if ne .pbPackage .protoGoPackage}}{{.protoGoPackage}}{{end}} 10 | 11 | "github.com/zeromicro/go-zero/zrpc" 12 | "google.golang.org/grpc" 13 | ) 14 | 15 | type ( 16 | {{.alias}} 17 | 18 | {{.serviceName}} interface { 19 | {{.interface}} 20 | } 21 | 22 | default{{.serviceName}} struct { 23 | cli zrpc.Client 24 | } 25 | ) 26 | 27 | func New{{.serviceName}}(cli zrpc.Client) {{.serviceName}} { 28 | return &default{{.serviceName}}{ 29 | cli: cli, 30 | } 31 | } 32 | 33 | {{.functions}} 34 | -------------------------------------------------------------------------------- /server/router/client/user.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | v1 "go-cms/api/v1" 5 | 6 | "github.com/gin-gonic/gin" 7 | ) 8 | 9 | type userRouter struct { 10 | } 11 | 12 | // InitCommDbRouter 初始化 QuickEdit 路由信息 13 | func (s *userRouter) InitUserRouter(Router *gin.RouterGroup) { 14 | var dbApi = v1.ApiGroupApp.CommonApiGroup.CommonDbApi 15 | userRouter := Router.Group("user") 16 | //commDbRouterWithoutRecord := Router.Group("commDb") 17 | { 18 | userRouter.POST("quickEdit", dbApi.QuickEdit) // 更新 QuickEdit 19 | //userRouter.GET("test_db_get", dbApi.Test_db_get) 20 | //userRouter.GET("test_db", dbApi.Test_db) 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /web/src/views/welcome/components/Github.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 31 | -------------------------------------------------------------------------------- /server/config/timer.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type Timer struct { 4 | Start bool `mapstructure:"start" json:"start" yaml:"start"` // 是否启用 5 | Spec string `mapstructure:"spec" json:"spec" yaml:"spec"` // CRON表达式 6 | Detail []Detail `mapstructure:"detail" json:"detail" yaml:"detail"` 7 | } 8 | 9 | type Detail struct { 10 | TableName string `mapstructure:"tableName" json:"tableName" yaml:"tableName"` // 需要清理的表名 11 | CompareField string `mapstructure:"compareField" json:"compareField" yaml:"compareField"` // 需要比较时间的字段 12 | Interval string `mapstructure:"interval" json:"interval" yaml:"interval"` // 时间间隔 13 | } 14 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/api/template.tpl: -------------------------------------------------------------------------------- 1 | syntax = "v1" 2 | 3 | info ( 4 | title: // TODO: add title 5 | desc: // TODO: add description 6 | author: "{{.gitUser}}" 7 | email: "{{.gitEmail}}" 8 | ) 9 | 10 | type request { 11 | // TODO: add members here and delete this comment 12 | } 13 | 14 | type response { 15 | // TODO: add members here and delete this comment 16 | } 17 | 18 | service {{.serviceName}} { 19 | @handler GetUser // TODO: set handler name and delete this comment 20 | get /users/id/:userId(request) returns(response) 21 | 22 | @handler CreateUser // TODO: set handler name and delete this comment 23 | post /users/create(request) 24 | } 25 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/api/template.tpl: -------------------------------------------------------------------------------- 1 | 2 | syntax = "v1" 3 | 4 | info ( 5 | title: // TODO: add title 6 | desc: // TODO: add description 7 | author: "{{.gitUser}}" 8 | email: "{{.gitEmail}}" 9 | ) 10 | 11 | type request { 12 | // TODO: add members here and delete this comment 13 | } 14 | 15 | type response { 16 | // TODO: add members here and delete this comment 17 | } 18 | 19 | service {{.serviceName}} { 20 | @handler GetUser // TODO: set handler name and delete this comment 21 | get /users/id/:userId(request) returns(response) 22 | 23 | @handler CreateUser // TODO: set handler name and delete this comment 24 | post /users/create(request) 25 | } 26 | -------------------------------------------------------------------------------- /web/src/components/ReCropper/src/svg/search-plus.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/ReCropper/src/svg/rotate-left.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/ReCol/index.ts: -------------------------------------------------------------------------------- 1 | import { ElCol } from "element-plus"; 2 | import { h, defineComponent } from "vue"; 3 | 4 | // 封装element-plus的el-col组件 5 | export default defineComponent({ 6 | name: "ReCol", 7 | props: { 8 | value: { 9 | type: Number, 10 | default: 24 11 | } 12 | }, 13 | render() { 14 | const attrs = this.$attrs; 15 | const val = this.value; 16 | return h( 17 | ElCol, 18 | { 19 | xs: val, 20 | sm: val, 21 | md: val, 22 | lg: val, 23 | xl: val, 24 | ...attrs 25 | }, 26 | { default: () => this.$slots.default() } 27 | ); 28 | } 29 | }); 30 | -------------------------------------------------------------------------------- /web/src/components/ReCropper/src/svg/rotate-right.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/ReSplitPane/iconfont/iconfont.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "iconfont"; /* Project id 3268330 */ 3 | src: 4 | url("iconfont.woff2?t=1647939915215") format("woff2"), 5 | url("iconfont.woff?t=1647939915215") format("woff"), 6 | url("iconfont.ttf?t=1647939915215") format("truetype"); 7 | } 8 | 9 | .iconfont { 10 | font-family: "iconfont" !important; 11 | font-size: 16px; 12 | font-style: normal; 13 | -webkit-font-smoothing: antialiased; 14 | -moz-osx-font-smoothing: grayscale; 15 | } 16 | 17 | .icon-tuozhuai1:before { 18 | content: "\e647"; 19 | } 20 | 21 | .icon-tuozhuai1-copy:before { 22 | content: "\eda3"; 23 | } 24 | -------------------------------------------------------------------------------- /gozero/common/xerr/errCode.go: -------------------------------------------------------------------------------- 1 | package xerr 2 | 3 | //成功返回 4 | const OK uint32 = 200 5 | const Fail uint32 = 400 6 | 7 | /**(前3位代表业务,后三位代表具体功能)**/ 8 | 9 | //全局错误码 10 | //const SERVER_COMMON_ERROR uint32 = 400101 11 | const SERVER_COMMON_ERROR uint32 = 400 12 | const REUQEST_PARAM_ERROR uint32 = 400102 13 | const TOKEN_EXPIRE_ERROR uint32 = 400103 14 | const TOKEN_GENERATE_ERROR uint32 = 400104 15 | const DB_ERROR uint32 = 400200 16 | const DB_RecordNotFound uint32 = 400201 17 | const DB_InsertErr uint32 = 400202 18 | const DB_UpdateErr uint32 = 400203 19 | const DB_UPDATE_AFFECTED_ZERO_ERROR uint32 = 400204 20 | 21 | const VerifyCode_ERROR uint32 = 400300 22 | 23 | //用户模块 24 | -------------------------------------------------------------------------------- /server/model/system/request/jwt.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "github.com/dgrijalva/jwt-go" 5 | ) 6 | 7 | // Custom claims structure 8 | type CustomClaims struct { 9 | UserId int64 `json:"userId" form:"userId" ` 10 | CuId int64 `json:"cuId" form:"cuId" ` 11 | CuGuid string `json:"cuGuid" form:"cuGuid" ` 12 | Guid string `json:"guid" form:"guid" ` 13 | Username string `json:"username" form:"username" ` 14 | //RoleList string `json:"roleList" form:"roleList" ` 15 | //Role int64 `json:"role" form:"role" ` 16 | UserType int `json:"userType" form:"userType" ` 17 | BufferTime int64 // 刷新时间 18 | jwt.StandardClaims 19 | } 20 | -------------------------------------------------------------------------------- /web/.env.production: -------------------------------------------------------------------------------- 1 | # 线上环境平台打包路径 2 | VITE_PUBLIC_PATH = / 3 | 4 | # 线上环境路由历史模式(Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数") 5 | VITE_ROUTER_HISTORY = "hash" 6 | 7 | # 是否在打包时使用cdn替换本地库 替换 true 不替换 false 8 | VITE_CDN = true 9 | 10 | # 是否启用gzip压缩或brotli压缩(分两种情况,删除原始文件和不删除原始文件) 11 | # 压缩时不删除原始文件的配置:gzip、brotli、both(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认) 12 | # 压缩时删除原始文件的配置:gzip-clear、brotli-clear、both-clear(同时开启 gzip 与 brotli 压缩)、none(不开启压缩,默认) 13 | VITE_COMPRESSION = "none" 14 | 15 | # 线上环境接口地址 16 | VITE_SERVER_PORT = 44088 17 | VITE_BASE_API = /api 18 | VITE_BASE_PATH = https://im.gocms.com 19 | 20 | VITE_WSS = wss://im.gocms.com/wss/ 21 | -------------------------------------------------------------------------------- /web/src/views/login/utils/enums.ts: -------------------------------------------------------------------------------- 1 | import { $t } from "@/plugins/i18n"; 2 | 3 | const operates = [ 4 | { 5 | title: $t("login.phoneLogin") 6 | }, 7 | { 8 | title: $t("login.qRCodeLogin") 9 | }, 10 | { 11 | title: $t("login.register") 12 | } 13 | ]; 14 | 15 | const thirdParty = [ 16 | { 17 | title: $t("login.weChatLogin"), 18 | icon: "wechat" 19 | }, 20 | { 21 | title: $t("login.alipayLogin"), 22 | icon: "alipay" 23 | }, 24 | { 25 | title: $t("login.qqLogin"), 26 | icon: "qq" 27 | }, 28 | { 29 | title: $t("login.weiboLogin"), 30 | icon: "weibo" 31 | } 32 | ]; 33 | 34 | export { operates, thirdParty }; 35 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/api/internal/config/config.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "go-cms/common" 5 | 6 | "github.com/zeromicro/go-zero/core/logc" 7 | "github.com/zeromicro/go-zero/core/stores/redis" 8 | "github.com/zeromicro/go-zero/rest" 9 | ) 10 | 11 | type Config struct { 12 | rest.RestConf 13 | DB common.DbConf 14 | 15 | Redis redis.RedisConf 16 | 17 | JwtAuth struct { 18 | AccessSecret string 19 | AccessExpire int64 20 | } 21 | LocalRes struct { 22 | BaseUrl string 23 | BasePath string 24 | Path string 25 | PathUser string 26 | } 27 | LogConf logc.LogConf 28 | //Cache cache.CacheConf 29 | //BasicRpcConf zrpc.RpcClientConf 30 | } 31 | -------------------------------------------------------------------------------- /gozero/common/genuid/sn.go: -------------------------------------------------------------------------------- 1 | package genuid 2 | 3 | import ( 4 | "fmt" 5 | "go-cms/common/tool" 6 | "time" 7 | ) 8 | 9 | // 生成sn单号 10 | type SnPrefix string 11 | 12 | const ( 13 | SN_PREFIX_ACT SnPrefix = "ACT" // ACT 订单前缀 14 | SN_PREFIX_SELL SnPrefix = "SEL" //Sell 推广 15 | SN_PREFIX_PAY SnPrefix = "PAY" //第三方支付流水记录前缀 16 | ) 17 | 18 | // 生成单号 3 + 14 +8 = 25 19 | func GenSn(snPrefix SnPrefix) string { 20 | return fmt.Sprintf("%s%s%s%s", snPrefix, time.Now().Format("20060102150405"), tool.Krand(2, tool.KC_RAND_KIND_UPPER), tool.Krand(6, tool.KC_RAND_KIND_ALL)) 21 | //return fmt.Sprintf("%s%s%s", snPrefix, time.Now().Format("20060102150405"), tool.GetRandomStr(8)) 22 | } 23 | -------------------------------------------------------------------------------- /server/config/email.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type Email struct { 4 | To string `mapstructure:"to" json:"to" yaml:"to"` // 收件人:多个以英文逗号分隔 5 | Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 6 | From string `mapstructure:"from" json:"from" yaml:"from"` // 收件人 7 | Host string `mapstructure:"host" json:"host" yaml:"host"` // 服务器地址 8 | IsSSL bool `mapstructure:"is-ssl" json:"isSSL" yaml:"is-ssl"` // 是否SSL 9 | Secret string `mapstructure:"secret" json:"secret" yaml:"secret"` // 密钥 10 | Nickname string `mapstructure:"nickname" json:"nickname" yaml:"nickname"` // 昵称 11 | } 12 | -------------------------------------------------------------------------------- /web/src/layout/components/footer/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 19 | 20 | 30 | -------------------------------------------------------------------------------- /server/global/global.go: -------------------------------------------------------------------------------- 1 | package global 2 | 3 | import ( 4 | "go-cms/utils/timer" 5 | 6 | "golang.org/x/sync/singleflight" 7 | 8 | "go.uber.org/zap" 9 | 10 | "go-cms/config" 11 | 12 | "github.com/go-redis/redis/v8" 13 | "github.com/songzhibin97/gkit/cache/local_cache" 14 | "github.com/spf13/viper" 15 | "gorm.io/gorm" 16 | ) 17 | 18 | var ( 19 | DB *gorm.DB 20 | REDIS *redis.Client 21 | CONFIG config.Server 22 | VP *viper.Viper 23 | //GO_LOG *oplogging.Logger 24 | LOG *zap.Logger 25 | Timer timer.Timer = timer.NewTimerTask() 26 | Concurrency_Control = &singleflight.Group{} 27 | BlackCache local_cache.Cache 28 | ) 29 | -------------------------------------------------------------------------------- /web/src/assets/login/avatar.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/assets/iconfont/iconfont.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "iconfont"; /* Project id 2208059 */ 3 | src: 4 | url("iconfont.woff2?t=1671895108120") format("woff2"), 5 | url("iconfont.woff?t=1671895108120") format("woff"), 6 | url("iconfont.ttf?t=1671895108120") format("truetype"); 7 | } 8 | 9 | .iconfont { 10 | font-family: "iconfont" !important; 11 | font-size: 16px; 12 | font-style: normal; 13 | -webkit-font-smoothing: antialiased; 14 | -moz-osx-font-smoothing: grayscale; 15 | } 16 | 17 | .pure-iconfont-tabs:before { 18 | content: "\e63e"; 19 | } 20 | 21 | .pure-iconfont-logo:before { 22 | content: "\e620"; 23 | } 24 | 25 | .pure-iconfont-new:before { 26 | content: "\e615"; 27 | } 28 | -------------------------------------------------------------------------------- /server/initialize/redis.go: -------------------------------------------------------------------------------- 1 | package initialize 2 | 3 | import ( 4 | "context" 5 | "os" 6 | 7 | "go-cms/global" 8 | 9 | "github.com/go-redis/redis/v8" 10 | "go.uber.org/zap" 11 | ) 12 | 13 | func Redis() { 14 | redisCfg := global.CONFIG.Redis 15 | client := redis.NewClient(&redis.Options{ 16 | Addr: redisCfg.Addr, 17 | Password: redisCfg.Password, // no password set 18 | DB: redisCfg.DB, // use default DB 19 | }) 20 | pong, err := client.Ping(context.Background()).Result() 21 | if err != nil { 22 | global.LOG.Error("redis启动失败, err:", zap.Any("err", err)) 23 | os.Exit(0) 24 | } else { 25 | global.LOG.Info("redis connect ping response:", zap.String("pong", pong)) 26 | global.REDIS = client 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/insert.tpl: -------------------------------------------------------------------------------- 1 | 2 | func (m *default{{.upperStartCamelObject}}Model) Insert(ctx context.Context, data *{{.upperStartCamelObject}}) (sql.Result,error) { 3 | {{if .withCache}}{{.keys}} 4 | ret, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { 5 | query := fmt.Sprintf("insert into %s (%s) values ({{.expression}})", m.table, {{.lowerStartCamelObject}}RowsExpectAutoSet) 6 | return conn.ExecCtx(ctx, query, {{.expressionValues}}) 7 | }, {{.keyValues}}){{else}}query := fmt.Sprintf("insert into %s (%s) values ({{.expression}})", m.table, {{.lowerStartCamelObject}}RowsExpectAutoSet) 8 | ret,err:=m.conn.ExecCtx(ctx, query, {{.expressionValues}}){{end}} 9 | return ret,err 10 | } 11 | -------------------------------------------------------------------------------- /gozero/common/tool/krand.go: -------------------------------------------------------------------------------- 1 | package tool 2 | 3 | import ( 4 | "math/rand" 5 | "time" 6 | ) 7 | 8 | const ( 9 | KC_RAND_KIND_NUM = 0 // 纯数字 10 | KC_RAND_KIND_LOWER = 1 // 小写字母 11 | KC_RAND_KIND_UPPER = 2 // 大写字母 12 | KC_RAND_KIND_ALL = 3 // 数字、大小写字母 13 | ) 14 | 15 | // 随机字符串 16 | func Krand(size int, kind int) string { 17 | ikind, kinds, result := kind, [][]int{[]int{10, 48}, []int{26, 97}, []int{26, 65}}, make([]byte, size) 18 | is_all := kind > 2 || kind < 0 19 | rand.Seed(time.Now().UnixNano()) 20 | for i := 0; i < size; i++ { 21 | if is_all { // random ikind 22 | ikind = rand.Intn(3) 23 | } 24 | scope, base := kinds[ikind][0], kinds[ikind][1] 25 | result[i] = uint8(base + rand.Intn(scope)) 26 | } 27 | return string(result) 28 | } 29 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/api/handler.tpl: -------------------------------------------------------------------------------- 1 | package {{.PkgName}} 2 | 3 | import ( 4 | "net/http" 5 | "go-cms/common/result" 6 | "github.com/zeromicro/go-zero/rest/httpx" 7 | {{.ImportPackages}} 8 | ) 9 | 10 | func {{.HandlerName}}(svcCtx *svc.ServiceContext) http.HandlerFunc { 11 | return func(w http.ResponseWriter, r *http.Request) { 12 | {{if .HasRequest}}var req types.{{.RequestType}} 13 | if err := httpx.Parse(r, &req); err != nil { 14 | result.ParamErrorResult(r,w,err) 15 | return 16 | } 17 | 18 | {{end}}l := {{.LogicName}}.New{{.LogicType}}(r.Context(), svcCtx) 19 | {{if .HasResp}}resp, {{end}}err := l.{{.Call}}({{if .HasRequest}}&req{{end}}) 20 | result.HttpResult(r, w, {{if .HasResp}}resp{{else}}nil{{end}}, err) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /server/router/client/cms.go: -------------------------------------------------------------------------------- 1 | package client 2 | 3 | import ( 4 | v1 "go-cms/api/v1" 5 | 6 | "github.com/gin-gonic/gin" 7 | ) 8 | 9 | type cmsRouter struct { 10 | } 11 | 12 | // InitCommDbRouter 初始化 QuickEdit 路由信息 13 | func (s *cmsRouter) InitCmsRouter(Router *gin.RouterGroup) { 14 | var cmsApi = v1.ApiGroupApp.ClientGroup.CmsApi 15 | cmsRouter := Router.Group("") 16 | //commDbRouterWithoutRecord := Router.Group("commDb") 17 | { 18 | 19 | cmsRouter.GET("/", cmsApi.Index) // 更新 QuickEdit 20 | cmsRouter.GET("/index.html", cmsApi.Index) // 更新 QuickEdit 21 | cmsRouter.GET("login.html", cmsApi.Login) // 更新 QuickEdit 22 | //userRouter.GET("test_db_get", dbApi.Test_db_get) 23 | //userRouter.GET("test_db", dbApi.Test_db) 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /gozero/app/cms/cmd/api/internal/handler/cms/artListHandler.go: -------------------------------------------------------------------------------- 1 | package cms 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/zeromicro/go-zero/rest/httpx" 7 | "go-cms/app/cms/cmd/api/internal/logic/cms" 8 | "go-cms/app/cms/cmd/api/internal/svc" 9 | "go-cms/app/cms/cmd/api/internal/types" 10 | "go-cms/common/result" 11 | ) 12 | 13 | func ArtListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 14 | return func(w http.ResponseWriter, r *http.Request) { 15 | var req types.PageInfoReq 16 | if err := httpx.Parse(r, &req); err != nil { 17 | result.ParamErrorResult(r, w, err) 18 | return 19 | } 20 | 21 | l := cms.NewArtListLogic(r.Context(), svcCtx) 22 | resp, err := l.ArtList(&req) 23 | result.HttpResult(r, w, resp, err, req) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /gozero/app/cms/cmd/api/internal/handler/cms/discussHandler.go: -------------------------------------------------------------------------------- 1 | package cms 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/zeromicro/go-zero/rest/httpx" 7 | "go-cms/app/cms/cmd/api/internal/logic/cms" 8 | "go-cms/app/cms/cmd/api/internal/svc" 9 | "go-cms/app/cms/cmd/api/internal/types" 10 | "go-cms/common/result" 11 | ) 12 | 13 | func DiscussHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 14 | return func(w http.ResponseWriter, r *http.Request) { 15 | var req types.DiscussReq 16 | if err := httpx.Parse(r, &req); err != nil { 17 | result.ParamErrorResult(r, w, err) 18 | return 19 | } 20 | 21 | l := cms.NewDiscussLogic(r.Context(), svcCtx) 22 | resp, err := l.Discuss(&req) 23 | result.HttpResult(r, w, resp, err, req) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /gozero/app/cms/cmd/api/internal/logic/cms/discussLogic.go: -------------------------------------------------------------------------------- 1 | package cms 2 | 3 | import ( 4 | "context" 5 | 6 | "go-cms/app/cms/cmd/api/internal/svc" 7 | "go-cms/app/cms/cmd/api/internal/types" 8 | 9 | "github.com/zeromicro/go-zero/core/logx" 10 | ) 11 | 12 | type DiscussLogic struct { 13 | logx.Logger 14 | ctx context.Context 15 | svcCtx *svc.ServiceContext 16 | } 17 | 18 | func NewDiscussLogic(ctx context.Context, svcCtx *svc.ServiceContext) DiscussLogic { 19 | return DiscussLogic{ 20 | Logger: logx.WithContext(ctx), 21 | ctx: ctx, 22 | svcCtx: svcCtx, 23 | } 24 | } 25 | 26 | func (l *DiscussLogic) Discuss(req *types.DiscussReq) (resp *types.OkResp, err error) { 27 | // todo: add your logic here and delete this line 28 | 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /gozero/app/cms/cmd/api/internal/handler/cms/artDetailHandler.go: -------------------------------------------------------------------------------- 1 | package cms 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/zeromicro/go-zero/rest/httpx" 7 | "go-cms/app/cms/cmd/api/internal/logic/cms" 8 | "go-cms/app/cms/cmd/api/internal/svc" 9 | "go-cms/app/cms/cmd/api/internal/types" 10 | "go-cms/common/result" 11 | ) 12 | 13 | func ArtDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 14 | return func(w http.ResponseWriter, r *http.Request) { 15 | var req types.IdReq 16 | if err := httpx.Parse(r, &req); err != nil { 17 | result.ParamErrorResult(r, w, err) 18 | return 19 | } 20 | 21 | l := cms.NewArtDetailLogic(r.Context(), svcCtx) 22 | resp, err := l.ArtDetail(&req) 23 | result.HttpResult(r, w, resp, err, req) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /gozero/app/cms/cmd/api/internal/handler/cms/delDiscussHandler.go: -------------------------------------------------------------------------------- 1 | package cms 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/zeromicro/go-zero/rest/httpx" 7 | "go-cms/app/cms/cmd/api/internal/logic/cms" 8 | "go-cms/app/cms/cmd/api/internal/svc" 9 | "go-cms/app/cms/cmd/api/internal/types" 10 | "go-cms/common/result" 11 | ) 12 | 13 | func DelDiscussHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 14 | return func(w http.ResponseWriter, r *http.Request) { 15 | var req types.IdReq 16 | if err := httpx.Parse(r, &req); err != nil { 17 | result.ParamErrorResult(r, w, err) 18 | return 19 | } 20 | 21 | l := cms.NewDelDiscussLogic(r.Context(), svcCtx) 22 | resp, err := l.DelDiscuss(&req) 23 | result.HttpResult(r, w, resp, err, req) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /gozero/app/cms/cmd/api/cms.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | 7 | "go-cms/app/cms/cmd/api/internal/config" 8 | "go-cms/app/cms/cmd/api/internal/handler" 9 | 10 | "go-cms/app/cms/cmd/api/internal/svc" 11 | 12 | "github.com/zeromicro/go-zero/core/conf" 13 | "github.com/zeromicro/go-zero/rest" 14 | ) 15 | 16 | var configFile = flag.String("f", "etc/cms.yaml", "the config file") 17 | 18 | func main() { 19 | flag.Parse() 20 | 21 | var c config.Config 22 | conf.MustLoad(*configFile, &c) 23 | 24 | ctx := svc.NewServiceContext(c) 25 | server := rest.MustNewServer(c.RestConf) 26 | defer server.Stop() 27 | 28 | handler.RegisterHandlers(server, ctx) 29 | 30 | fmt.Printf("启动 cms server at %s:%d...\n", c.Host, c.Port) 31 | server.Start() 32 | } 33 | -------------------------------------------------------------------------------- /gozero/app/cms/cmd/api/internal/logic/cms/delDiscussLogic.go: -------------------------------------------------------------------------------- 1 | package cms 2 | 3 | import ( 4 | "context" 5 | 6 | "go-cms/app/cms/cmd/api/internal/svc" 7 | "go-cms/app/cms/cmd/api/internal/types" 8 | 9 | "github.com/zeromicro/go-zero/core/logx" 10 | ) 11 | 12 | type DelDiscussLogic struct { 13 | logx.Logger 14 | ctx context.Context 15 | svcCtx *svc.ServiceContext 16 | } 17 | 18 | func NewDelDiscussLogic(ctx context.Context, svcCtx *svc.ServiceContext) DelDiscussLogic { 19 | return DelDiscussLogic{ 20 | Logger: logx.WithContext(ctx), 21 | ctx: ctx, 22 | svcCtx: svcCtx, 23 | } 24 | } 25 | 26 | func (l *DelDiscussLogic) DelDiscuss(req *types.IdReq) (resp *types.OkResp, err error) { 27 | // todo: add your logic here and delete this line 28 | 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /web/src/assets/iconfont/iconfont.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "2208059", 3 | "name": "pure-admin", 4 | "font_family": "iconfont", 5 | "css_prefix_text": "pure-iconfont-", 6 | "description": "pure-admin-iconfont", 7 | "glyphs": [ 8 | { 9 | "icon_id": "20594647", 10 | "name": "Tabs", 11 | "font_class": "tabs", 12 | "unicode": "e63e", 13 | "unicode_decimal": 58942 14 | }, 15 | { 16 | "icon_id": "22129506", 17 | "name": "PureLogo", 18 | "font_class": "logo", 19 | "unicode": "e620", 20 | "unicode_decimal": 58912 21 | }, 22 | { 23 | "icon_id": "7795615", 24 | "name": "New", 25 | "font_class": "new", 26 | "unicode": "e615", 27 | "unicode_decimal": 58901 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /gozero/app/cms/cmd/api/internal/handler/cms/discussListHandler.go: -------------------------------------------------------------------------------- 1 | package cms 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/zeromicro/go-zero/rest/httpx" 7 | "go-cms/app/cms/cmd/api/internal/logic/cms" 8 | "go-cms/app/cms/cmd/api/internal/svc" 9 | "go-cms/app/cms/cmd/api/internal/types" 10 | "go-cms/common/result" 11 | ) 12 | 13 | func DiscussListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 14 | return func(w http.ResponseWriter, r *http.Request) { 15 | var req types.PageInfoReq 16 | if err := httpx.Parse(r, &req); err != nil { 17 | result.ParamErrorResult(r, w, err) 18 | return 19 | } 20 | 21 | l := cms.NewDiscussListLogic(r.Context(), svcCtx) 22 | resp, err := l.DiscussList(&req) 23 | result.HttpResult(r, w, resp, err, req) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /web/src/components/ReIcon/src/iconifyIconOnline.ts: -------------------------------------------------------------------------------- 1 | import { h, defineComponent } from "vue"; 2 | import { Icon as IconifyIcon } from "@iconify/vue"; 3 | 4 | // Iconify Icon在Vue里在线使用(用于外网环境) 5 | export default defineComponent({ 6 | name: "IconifyIconOnline", 7 | components: { IconifyIcon }, 8 | props: { 9 | icon: { 10 | type: String, 11 | default: "" 12 | } 13 | }, 14 | render() { 15 | const attrs = this.$attrs; 16 | return h( 17 | IconifyIcon, 18 | { 19 | icon: `${this.icon}`, 20 | style: attrs?.style 21 | ? Object.assign(attrs.style, { outline: "none" }) 22 | : { outline: "none" }, 23 | ...attrs 24 | }, 25 | { 26 | default: () => [] 27 | } 28 | ); 29 | } 30 | }); 31 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/api/basic.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | "go-cms/app/basic/cmd/api/internal/config" 7 | "go-cms/app/basic/cmd/api/internal/handler" 8 | 9 | "go-cms/app/basic/cmd/api/internal/svc" 10 | 11 | "github.com/zeromicro/go-zero/core/conf" 12 | "github.com/zeromicro/go-zero/rest" 13 | ) 14 | 15 | var configFile = flag.String("f", "etc/basic.yaml", "the config file") 16 | 17 | func main() { 18 | flag.Parse() 19 | 20 | var c config.Config 21 | conf.MustLoad(*configFile, &c) 22 | 23 | ctx := svc.NewServiceContext(c) 24 | server := rest.MustNewServer(c.RestConf) 25 | defer server.Stop() 26 | 27 | handler.RegisterHandlers(server, ctx) 28 | 29 | fmt.Printf("启动 basic api server at %s:%d...\n", c.Host, c.Port) 30 | server.Start() 31 | } 32 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/api/internal/handler/basic/captchaHandler.go: -------------------------------------------------------------------------------- 1 | package basic 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go-cms/common/result" 7 | 8 | "go-cms/app/basic/cmd/api/internal/logic/basic" 9 | "go-cms/app/basic/cmd/api/internal/svc" 10 | "go-cms/app/basic/cmd/api/internal/types" 11 | 12 | "github.com/zeromicro/go-zero/rest/httpx" 13 | ) 14 | 15 | func CaptchaHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 16 | return func(w http.ResponseWriter, r *http.Request) { 17 | var req types.CaptchaReq 18 | if err := httpx.Parse(r, &req); err != nil { 19 | result.ParamErrorResult(r, w, err) 20 | return 21 | } 22 | l := basic.NewCaptchaLogic(r.Context(), svcCtx) 23 | resp, err := l.Captcha(&req) 24 | result.HttpResult(r, w, resp, err, req) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/api/internal/logic/basic/sendCodeLogic.go: -------------------------------------------------------------------------------- 1 | package basic 2 | 3 | import ( 4 | "context" 5 | 6 | "go-cms/app/basic/cmd/api/internal/svc" 7 | "go-cms/app/basic/cmd/api/internal/types" 8 | 9 | "github.com/zeromicro/go-zero/core/logx" 10 | ) 11 | 12 | type SendCodeLogic struct { 13 | logx.Logger 14 | ctx context.Context 15 | svcCtx *svc.ServiceContext 16 | } 17 | 18 | func NewSendCodeLogic(ctx context.Context, svcCtx *svc.ServiceContext) SendCodeLogic { 19 | return SendCodeLogic{ 20 | Logger: logx.WithContext(ctx), 21 | ctx: ctx, 22 | svcCtx: svcCtx, 23 | } 24 | } 25 | 26 | func (l *SendCodeLogic) SendCode(req *types.SendCodeReq) (resp *types.SendCodeResp, err error) { 27 | // todo: add your logic here and delete this line 28 | 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/api/handler.tpl: -------------------------------------------------------------------------------- 1 | package {{.PkgName}} 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go-cms/common/result" 7 | 8 | {{if .After1_1_10}}"github.com/zeromicro/go-zero/rest/httpx"{{end}} 9 | {{.ImportPackages}} 10 | ) 11 | 12 | func {{.HandlerName}}(svcCtx *svc.ServiceContext) http.HandlerFunc { 13 | return func(w http.ResponseWriter, r *http.Request) { 14 | {{if .HasRequest}}var req types.{{.RequestType}} 15 | if err := httpx.Parse(r, &req); err != nil { 16 | result.ParamErrorResult(r,w,err) 17 | return 18 | } 19 | 20 | {{end}}l := {{.LogicName}}.New{{.LogicType}}(r.Context(), svcCtx) 21 | {{if .HasResp}}resp, {{end}}err := l.{{.Call}}({{if .HasRequest}}&req{{end}}) 22 | result.HttpResult(r, w, {{if .HasResp}}resp{{else}}nil{{end}}, err) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/api/internal/handler/basic/myFileListHandler.go: -------------------------------------------------------------------------------- 1 | package basic 2 | 3 | import ( 4 | "go-cms/app/basic/cmd/api/internal/logic/basic" 5 | "go-cms/app/basic/cmd/api/internal/svc" 6 | "go-cms/app/basic/cmd/api/internal/types" 7 | "go-cms/common/result" 8 | "net/http" 9 | 10 | "github.com/zeromicro/go-zero/rest/httpx" 11 | ) 12 | 13 | func MyFileListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 14 | return func(w http.ResponseWriter, r *http.Request) { 15 | var req types.PageInfoReq 16 | if err := httpx.Parse(r, &req); err != nil { 17 | result.ParamErrorResult(r, w, err) 18 | return 19 | } 20 | 21 | l := basic.NewMyFileListLogic(r.Context(), svcCtx) 22 | resp, err := l.MyFileList(&req) 23 | result.HttpResult(r, w, resp, err, req) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/rpc/internal/logic/addFileLogic.go: -------------------------------------------------------------------------------- 1 | package logic 2 | 3 | import ( 4 | "context" 5 | 6 | "go-cms/app/basic/cmd/rpc/internal/svc" 7 | "go-cms/app/basic/cmd/rpc/pb" 8 | 9 | "github.com/zeromicro/go-zero/core/logx" 10 | ) 11 | 12 | type AddFileLogic struct { 13 | ctx context.Context 14 | svcCtx *svc.ServiceContext 15 | logx.Logger 16 | } 17 | 18 | func NewAddFileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AddFileLogic { 19 | return &AddFileLogic{ 20 | ctx: ctx, 21 | svcCtx: svcCtx, 22 | Logger: logx.WithContext(ctx), 23 | } 24 | } 25 | 26 | // addFile 新增文件 27 | func (l *AddFileLogic) AddFile(in *pb.AddFileReq) (*pb.AddFileResp, error) { 28 | // todo: add your logic here and delete this line 29 | 30 | return &pb.AddFileResp{}, nil 31 | } 32 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/rpc/internal/logic/sendCodeLogic.go: -------------------------------------------------------------------------------- 1 | package logic 2 | 3 | import ( 4 | "context" 5 | 6 | "go-cms/app/basic/cmd/rpc/internal/svc" 7 | "go-cms/app/basic/cmd/rpc/pb" 8 | 9 | "github.com/zeromicro/go-zero/core/logx" 10 | ) 11 | 12 | type SendCodeLogic struct { 13 | ctx context.Context 14 | svcCtx *svc.ServiceContext 15 | logx.Logger 16 | } 17 | 18 | func NewSendCodeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SendCodeLogic { 19 | return &SendCodeLogic{ 20 | ctx: ctx, 21 | svcCtx: svcCtx, 22 | Logger: logx.WithContext(ctx), 23 | } 24 | } 25 | 26 | // 验证码 27 | func (l *SendCodeLogic) SendCode(in *pb.SendCodeReq) (*pb.SendCodeResp, error) { 28 | // todo: add your logic here and delete this line 29 | 30 | return &pb.SendCodeResp{}, nil 31 | } 32 | -------------------------------------------------------------------------------- /gozero/app/usercenter/cmd/api/internal/handler/user/loginHandler.go: -------------------------------------------------------------------------------- 1 | package user 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go-cms/common/result" 7 | 8 | "go-cms/app/usercenter/cmd/api/internal/logic/user" 9 | "go-cms/app/usercenter/cmd/api/internal/svc" 10 | "go-cms/app/usercenter/cmd/api/internal/types" 11 | 12 | "github.com/zeromicro/go-zero/rest/httpx" 13 | ) 14 | 15 | func LoginHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 16 | return func(w http.ResponseWriter, r *http.Request) { 17 | var req types.LoginReq 18 | if err := httpx.Parse(r, &req); err != nil { 19 | result.ParamErrorResult(r, w, err) 20 | return 21 | } 22 | l := user.NewLoginLogic(r.Context(), svcCtx) 23 | resp, err := l.Login(&req) 24 | result.HttpResult(r, w, resp, err, req) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /gozero/app/usercenter/cmd/api/internal/logic/user/tokenVerifyLogic.go: -------------------------------------------------------------------------------- 1 | package user 2 | 3 | import ( 4 | "context" 5 | 6 | "go-cms/app/usercenter/cmd/api/internal/svc" 7 | "go-cms/app/usercenter/cmd/api/internal/types" 8 | 9 | "github.com/zeromicro/go-zero/core/logx" 10 | ) 11 | 12 | type TokenVerifyLogic struct { 13 | logx.Logger 14 | ctx context.Context 15 | svcCtx *svc.ServiceContext 16 | } 17 | 18 | func NewTokenVerifyLogic(ctx context.Context, svcCtx *svc.ServiceContext) TokenVerifyLogic { 19 | return TokenVerifyLogic{ 20 | Logger: logx.WithContext(ctx), 21 | ctx: ctx, 22 | svcCtx: svcCtx, 23 | } 24 | } 25 | 26 | func (l *TokenVerifyLogic) TokenVerify() (resp *types.OkResp, err error) { 27 | // todo: add your logic here and delete this line 28 | 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /web/src/views/login/components/qrCode.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 26 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/api/internal/handler/basic/fileDetailHandler.go: -------------------------------------------------------------------------------- 1 | package basic 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go-cms/common/result" 7 | 8 | "go-cms/app/basic/cmd/api/internal/logic/basic" 9 | "go-cms/app/basic/cmd/api/internal/svc" 10 | "go-cms/app/basic/cmd/api/internal/types" 11 | 12 | "github.com/zeromicro/go-zero/rest/httpx" 13 | ) 14 | 15 | func FileDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 16 | return func(w http.ResponseWriter, r *http.Request) { 17 | var req types.ValReq 18 | if err := httpx.Parse(r, &req); err != nil { 19 | result.ParamErrorResult(r, w, err) 20 | return 21 | } 22 | 23 | l := basic.NewFileDetailLogic(r.Context(), svcCtx) 24 | resp, err := l.FileDetail(&req) 25 | result.HttpResult(r, w, resp, err, req) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/api/internal/handler/basic/fileListHandler.go: -------------------------------------------------------------------------------- 1 | package basic 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go-cms/app/basic/cmd/api/internal/logic/basic" 7 | "go-cms/app/basic/cmd/api/internal/svc" 8 | "go-cms/app/basic/cmd/api/internal/types" 9 | "go-cms/common/result" 10 | 11 | "github.com/zeromicro/go-zero/rest/httpx" 12 | ) 13 | 14 | func FileListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 15 | return func(w http.ResponseWriter, r *http.Request) { 16 | 17 | var req types.PageInfoReq 18 | if err := httpx.Parse(r, &req); err != nil { 19 | result.ParamErrorResult(r, w, err) 20 | return 21 | } 22 | 23 | l := basic.NewFileListLogic(r.Context(), svcCtx) 24 | resp, err := l.FileList(&req) 25 | result.HttpResult(r, w, resp, err, req) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/api/internal/handler/basic/delFileListHandler.go: -------------------------------------------------------------------------------- 1 | package basic 2 | 3 | import ( 4 | "go-cms/app/basic/cmd/api/internal/logic/basic" 5 | "go-cms/app/basic/cmd/api/internal/svc" 6 | "go-cms/app/basic/cmd/api/internal/types" 7 | "go-cms/common/result" 8 | "net/http" 9 | 10 | "github.com/zeromicro/go-zero/rest/httpx" 11 | ) 12 | 13 | func DelFileListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 14 | return func(w http.ResponseWriter, r *http.Request) { 15 | var req types.GuidListReq 16 | if err := httpx.Parse(r, &req); err != nil { 17 | result.ParamErrorResult(r, w, err) 18 | return 19 | } 20 | 21 | l := basic.NewDelFileListLogic(r.Context(), svcCtx) 22 | resp, err := l.DelFileList(&req) 23 | 24 | result.HttpResult(r, w, resp, err, req) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/api/internal/handler/basic/getFileByKeyHandler.go: -------------------------------------------------------------------------------- 1 | package basic 2 | 3 | import ( 4 | "go-cms/app/basic/cmd/api/internal/logic/basic" 5 | "go-cms/app/basic/cmd/api/internal/svc" 6 | "go-cms/app/basic/cmd/api/internal/types" 7 | "go-cms/common/result" 8 | "net/http" 9 | 10 | "github.com/zeromicro/go-zero/rest/httpx" 11 | ) 12 | 13 | func GetFileByKeyHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 14 | return func(w http.ResponseWriter, r *http.Request) { 15 | var req types.ValReq 16 | if err := httpx.Parse(r, &req); err != nil { 17 | result.ParamErrorResult(r, w, err) 18 | return 19 | } 20 | 21 | l := basic.NewGetFileByKeyLogic(r.Context(), svcCtx) 22 | resp, err := l.GetFileByKey(&req) 23 | result.HttpResult(r, w, resp, err, req) 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/api/internal/handler/basic/sendCodeHandler.go: -------------------------------------------------------------------------------- 1 | package basic 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go-cms/common/result" 7 | 8 | "go-cms/app/basic/cmd/api/internal/logic/basic" 9 | "go-cms/app/basic/cmd/api/internal/svc" 10 | "go-cms/app/basic/cmd/api/internal/types" 11 | 12 | "github.com/zeromicro/go-zero/rest/httpx" 13 | ) 14 | 15 | func SendCodeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 16 | return func(w http.ResponseWriter, r *http.Request) { 17 | var req types.SendCodeReq 18 | if err := httpx.Parse(r, &req); err != nil { 19 | result.ParamErrorResult(r, w, err) 20 | return 21 | } 22 | 23 | l := basic.NewSendCodeLogic(r.Context(), svcCtx) 24 | resp, err := l.SendCode(&req) 25 | 26 | result.HttpResult(r, w, resp, err, req) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /gozero/app/cms/cmd/api/internal/logic/cms/discussListLogic.go: -------------------------------------------------------------------------------- 1 | package cms 2 | 3 | import ( 4 | "context" 5 | 6 | "go-cms/app/cms/cmd/api/internal/svc" 7 | "go-cms/app/cms/cmd/api/internal/types" 8 | 9 | "github.com/zeromicro/go-zero/core/logx" 10 | ) 11 | 12 | type DiscussListLogic struct { 13 | logx.Logger 14 | ctx context.Context 15 | svcCtx *svc.ServiceContext 16 | } 17 | 18 | func NewDiscussListLogic(ctx context.Context, svcCtx *svc.ServiceContext) DiscussListLogic { 19 | return DiscussListLogic{ 20 | Logger: logx.WithContext(ctx), 21 | ctx: ctx, 22 | svcCtx: svcCtx, 23 | } 24 | } 25 | 26 | func (l *DiscussListLogic) DiscussList(req *types.PageInfoReq) (resp *types.DiscussListResp, err error) { 27 | // todo: add your logic here and delete this line 28 | 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /gozero/app/usercenter/cmd/api/internal/handler/user/registerHandler.go: -------------------------------------------------------------------------------- 1 | package user 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go-cms/common/result" 7 | 8 | "go-cms/app/usercenter/cmd/api/internal/logic/user" 9 | "go-cms/app/usercenter/cmd/api/internal/svc" 10 | "go-cms/app/usercenter/cmd/api/internal/types" 11 | 12 | "github.com/zeromicro/go-zero/rest/httpx" 13 | ) 14 | 15 | func RegisterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 16 | return func(w http.ResponseWriter, r *http.Request) { 17 | var req types.LoginReq 18 | if err := httpx.Parse(r, &req); err != nil { 19 | result.ParamErrorResult(r, w, err) 20 | return 21 | } 22 | l := user.NewRegisterLogic(r.Context(), svcCtx) 23 | resp, err := l.Register(&req) 24 | result.HttpResult(r, w, resp, err, req) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /web/commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | ignores: [commit => commit.includes("init")], 3 | extends: ["@commitlint/config-conventional"], 4 | rules: { 5 | "body-leading-blank": [2, "always"], 6 | "footer-leading-blank": [1, "always"], 7 | "header-max-length": [2, "always", 108], 8 | "subject-empty": [2, "never"], 9 | "type-empty": [2, "never"], 10 | "type-enum": [ 11 | 2, 12 | "always", 13 | [ 14 | "feat", 15 | "fix", 16 | "perf", 17 | "style", 18 | "docs", 19 | "test", 20 | "refactor", 21 | "build", 22 | "ci", 23 | "chore", 24 | "revert", 25 | "wip", 26 | "workflow", 27 | "types", 28 | "release" 29 | ] 30 | ] 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /gozero/modd.conf: -------------------------------------------------------------------------------- 1 | 2 | #usercenter 3 | # app/usercenter/cmd/rpc/**/*.go { 4 | # daemon +sigkill: go run ./app/usercenter/cmd/rpc/usercenter.go -f app/usercenter/cmd/rpc/etc/usercenter.yaml 5 | # } 6 | 7 | app/usercenter/cmd/api/**/*.go { 8 | daemon +sigkill: go run ./app/usercenter/cmd/api/usercenter.go -f app/usercenter/cmd/api/etc/usercenter.yaml 9 | } 10 | 11 | 12 | #basic 13 | # app/basic/cmd/rpc/**/*.go { 14 | # daemon +sigkill: go run ./app/basic/cmd/rpc/basic.go -f app/basic/cmd/rpc/etc/basic.yaml 15 | # } 16 | 17 | app/basic/cmd/api/**/*.go { 18 | daemon +sigkill: go run ./app/basic/cmd/api/basic.go -f app/basic/cmd/api/etc/basic.yaml 19 | } 20 | 21 | app/cms/**/*.go { 22 | daemon +sigkill: go run ./app/cms/cmd/api/cms.go -f app/cms/cmd/api/etc/cms.yaml 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /gozero/app/usercenter/cmd/api/internal/handler/user/loginScanHandler.go: -------------------------------------------------------------------------------- 1 | package user 2 | 3 | import ( 4 | "net/http" 5 | 6 | "go-cms/app/usercenter/cmd/api/internal/logic/user" 7 | "go-cms/app/usercenter/cmd/api/internal/svc" 8 | "go-cms/app/usercenter/cmd/api/internal/types" 9 | "go-cms/common/result" 10 | 11 | "github.com/zeromicro/go-zero/rest/httpx" 12 | ) 13 | 14 | func LoginScanHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { 15 | return func(w http.ResponseWriter, r *http.Request) { 16 | var req types.LoginScanReq 17 | if err := httpx.Parse(r, &req); err != nil { 18 | result.ParamErrorResult(r, w, err) 19 | return 20 | } 21 | 22 | l := user.NewLoginScanLogic(r.Context(), svcCtx) 23 | resp, err := l.LoginScan(&req) 24 | result.HttpResult(r, w, resp, err, req) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /gozero/app/usercenter/cmd/api/usercenter.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | "go-cms/app/usercenter/cmd/api/internal/config" 7 | "go-cms/app/usercenter/cmd/api/internal/handler" 8 | "go-cms/app/usercenter/cmd/api/internal/svc" 9 | 10 | "github.com/zeromicro/go-zero/core/conf" 11 | "github.com/zeromicro/go-zero/rest" 12 | ) 13 | 14 | var configFile = flag.String("f", "./etc/usercenter.yaml", "the config file") 15 | 16 | func main() { 17 | flag.Parse() 18 | var c config.Config 19 | conf.MustLoad(*configFile, &c, conf.UseEnv()) 20 | 21 | ctx := svc.NewServiceContext(c) 22 | server := rest.MustNewServer(c.RestConf) 23 | defer server.Stop() 24 | 25 | handler.RegisterHandlers(server, ctx) 26 | 27 | fmt.Printf("启动 usercenter server at %s:%d...\n", c.Host, c.Port) 28 | server.Start() 29 | } 30 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/rpc/internal/logic/fileDetailLogic.go: -------------------------------------------------------------------------------- 1 | package logic 2 | 3 | import ( 4 | "context" 5 | 6 | "go-cms/app/basic/cmd/rpc/internal/svc" 7 | "go-cms/app/basic/cmd/rpc/pb" 8 | 9 | "github.com/zeromicro/go-zero/core/logx" 10 | ) 11 | 12 | type FileDetailLogic struct { 13 | ctx context.Context 14 | svcCtx *svc.ServiceContext 15 | logx.Logger 16 | } 17 | 18 | func NewFileDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FileDetailLogic { 19 | return &FileDetailLogic{ 20 | ctx: ctx, 21 | svcCtx: svcCtx, 22 | Logger: logx.WithContext(ctx), 23 | } 24 | } 25 | 26 | // FileDetail //文件详情 27 | func (l *FileDetailLogic) FileDetail(in *pb.FileDetailReq) (*pb.FileDetailResp, error) { 28 | // todo: add your logic here and delete this line 29 | 30 | return &pb.FileDetailResp{}, nil 31 | } 32 | -------------------------------------------------------------------------------- /server/utils/db_automation.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "time" 7 | 8 | "gorm.io/gorm" 9 | ) 10 | 11 | //@author: 10512203@qq.com 12 | //@function: ClearTable 13 | //@description: 清理数据库表数据 14 | //@param: db(数据库对象) *gorm.DB, tableName(表名) string, compareField(比较字段) string, interval(间隔) string 15 | //@return: error 16 | 17 | func ClearTable(db *gorm.DB, tableName string, compareField string, interval string) error { 18 | if db == nil { 19 | return errors.New("db Cannot be empty") 20 | } 21 | duration, err := time.ParseDuration(interval) 22 | if err != nil { 23 | return err 24 | } 25 | if duration < 0 { 26 | return errors.New("parse duration < 0") 27 | } 28 | return db.Debug().Exec(fmt.Sprintf("DELETE FROM %s WHERE %s < ?", tableName, compareField), time.Now().Add(-duration)).Error 29 | } 30 | -------------------------------------------------------------------------------- /web/src/assets/svg/globalization.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/rpc/internal/listen/kqMqs.go: -------------------------------------------------------------------------------- 1 | package listen 2 | 3 | import ( 4 | "context" 5 | "go-cms/app/basic/cmd/rpc/internal/config" 6 | kqMq "go-cms/app/basic/cmd/rpc/internal/mqs/kq" 7 | "go-cms/app/basic/cmd/rpc/internal/svc" 8 | 9 | "github.com/zeromicro/go-queue/kq" 10 | "github.com/zeromicro/go-zero/core/service" 11 | ) 12 | 13 | //发布/订阅 pub sub use kq (kafka) 14 | func KqMqs(c config.Config, ctx context.Context, svcContext *svc.ServiceContext) []service.Service { 15 | 16 | return []service.Service{ 17 | //Listening for changes in consumption flow status 18 | kq.MustNewQueue(c.ImageZipConf, kqMq.NewImageZipMq(ctx, svcContext)), 19 | kq.MustNewQueue(c.SendEmailConf, kqMq.NewSendEmailMq(ctx, svcContext)), 20 | kq.MustNewQueue(c.SendSmsConf, kqMq.NewSendSmsMq(ctx, svcContext)), 21 | //..... 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /gozero/common/utils/md5.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "crypto/md5" 5 | "encoding/hex" 6 | 7 | uuid "github.com/gofrs/uuid" 8 | ) 9 | 10 | //@author: [88act](https://github.com/88act) 11 | //@function: MD5V 12 | //@description: md5加密 13 | //@param: str []byte 14 | //@return: string 15 | 16 | func MD5V(str []byte, b ...byte) string { 17 | h := md5.New() 18 | h.Write(str) 19 | return hex.EncodeToString(h.Sum(b)) 20 | } 21 | 22 | func GUID() string { 23 | u2, err := uuid.NewV4() 24 | if err != nil { 25 | //log.Fatalf("failed to generate UUID: %v", err) 26 | } 27 | var s = hex.EncodeToString(u2.Bytes()) 28 | return s 29 | } 30 | func UUID() string { 31 | u2, err := uuid.NewV4() 32 | if err != nil { 33 | //log.Fatalf("failed to generate UUID: %v", err) 34 | } 35 | var s = hex.EncodeToString(u2.Bytes()) 36 | return s 37 | 38 | } 39 | -------------------------------------------------------------------------------- /web/src/components/ReFlicker/index.css: -------------------------------------------------------------------------------- 1 | .point { 2 | width: var(--point-width); 3 | height: var(--point-height); 4 | background: var(--point-background); 5 | position: relative; 6 | border-radius: var(--point-border-radius); 7 | } 8 | 9 | .point-flicker:after { 10 | background: var(--point-background); 11 | } 12 | 13 | .point-flicker:before, 14 | .point-flicker:after { 15 | content: ""; 16 | width: 100%; 17 | height: 100%; 18 | top: 0; 19 | left: 0; 20 | position: absolute; 21 | border-radius: var(--point-border-radius); 22 | animation: flicker 1.2s ease-out infinite; 23 | } 24 | 25 | @keyframes flicker { 26 | 0% { 27 | transform: scale(0.5); 28 | opacity: 1; 29 | } 30 | 31 | 30% { 32 | opacity: 1; 33 | } 34 | 35 | 100% { 36 | transform: scale(var(--point-scale)); 37 | opacity: 0; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /web/src/router/enums.ts: -------------------------------------------------------------------------------- 1 | // 完整版菜单比较多,将 rank 抽离出来,在此方便维护 2 | 3 | const home = 0, // 平台规定只有 home 路由的 rank 才能为 0 ,所以后端在返回 rank 的时候需要从 1 开始哦 4 | doc = 1, 5 | utils = 2, 6 | table = 3, 7 | components = 4, 8 | able = 5, 9 | frame = 6, 10 | nested = 7, 11 | result = 8, 12 | error = 9, 13 | list = 10, 14 | permission = 11, 15 | system = 12, 16 | tabs = 13, 17 | formdesign = 14, 18 | flowchart = 15, 19 | ppt = 16, 20 | editor = 17, 21 | guide = 18, 22 | menuoverflow = 19, 23 | about = 20; 24 | 25 | export { 26 | home, 27 | doc, 28 | utils, 29 | table, 30 | components, 31 | able, 32 | frame, 33 | nested, 34 | result, 35 | error, 36 | list, 37 | permission, 38 | system, 39 | tabs, 40 | formdesign, 41 | flowchart, 42 | ppt, 43 | editor, 44 | guide, 45 | menuoverflow, 46 | about 47 | }; 48 | -------------------------------------------------------------------------------- /web/src/components/ReIcon/src/iconifyIconOffline.ts: -------------------------------------------------------------------------------- 1 | import { h, defineComponent } from "vue"; 2 | import { Icon as IconifyIcon, addIcon } from "@iconify/vue/dist/offline"; 3 | 4 | // Iconify Icon在Vue里本地使用(用于内网环境) 5 | export default defineComponent({ 6 | name: "IconifyIconOffline", 7 | components: { IconifyIcon }, 8 | props: { 9 | icon: { 10 | default: null 11 | } 12 | }, 13 | render() { 14 | if (typeof this.icon === "object") addIcon(this.icon, this.icon); 15 | const attrs = this.$attrs; 16 | return h( 17 | IconifyIcon, 18 | { 19 | icon: this.icon, 20 | style: attrs?.style 21 | ? Object.assign(attrs.style, { outline: "none" }) 22 | : { outline: "none" }, 23 | ...attrs 24 | }, 25 | { 26 | default: () => [] 27 | } 28 | ); 29 | } 30 | }); 31 | -------------------------------------------------------------------------------- /server/utils/rotatelogs.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "os" 5 | 6 | "go-cms/global" 7 | 8 | "github.com/natefinch/lumberjack" 9 | "go.uber.org/zap/zapcore" 10 | ) 11 | 12 | //@author: 10512203@qq.com 13 | //@function: GetWriteSyncer 14 | //@description: zap logger中加入file-rotatelogs 15 | //@return: zapcore.WriteSyncer, error 16 | 17 | func GetWriteSyncer(file string) zapcore.WriteSyncer { 18 | lumberJackLogger := &lumberjack.Logger{ 19 | Filename: file, //日志文件的位置 20 | MaxSize: 10, //在进行切割之前,日志文件的最大大小(以MB为单位) 21 | MaxBackups: 200, //保留旧文件的最大个数 22 | MaxAge: 30, //保留旧文件的最大天数 23 | Compress: true, //是否压缩/归档旧文件 24 | } 25 | 26 | if global.CONFIG.Zap.LogInConsole { 27 | return zapcore.NewMultiWriteSyncer(zapcore.AddSync(os.Stdout), zapcore.AddSync(lumberJackLogger)) 28 | } 29 | return zapcore.AddSync(lumberJackLogger) 30 | } 31 | -------------------------------------------------------------------------------- /server/model/business/cmsDetail.go: -------------------------------------------------------------------------------- 1 | // 模板CmsDetail 2 | // Author 10512203@qq.com 3 | package business 4 | 5 | import ( 6 | "go-cms/global" 7 | "go-cms/model/common/request" 8 | ) 9 | 10 | // 表格字段 11 | const Field_CmsDetail_mini = "" // "id,created_at,updated_at,art_id,detail, 12 | 13 | // CmsDetail 结构体 14 | type CmsDetail struct { 15 | global.BaseModel 16 | //ArtId int64 `json:"artId" form:"artId" cn:"文章id" gorm:"column:art_id;comment:文章id;type:bigint"` 17 | Detail string `json:"detail" form:"detail" cn:"详细" gorm:"column:detail;comment:详细;type:text;"` 18 | } 19 | 20 | // TableName CmsDetail 表名 21 | func (CmsDetail) TableName() string { 22 | return "cms_detail" 23 | } 24 | 25 | type CmsDetailSearch struct { 26 | request.PageInfo 27 | global.BaseModel 28 | //ArtId *int64 `json:"artId" form:"artId" ` 29 | Detail string `json:"detail" form:"detail" ` 30 | } 31 | -------------------------------------------------------------------------------- /web/src/components/ReCropper/src/svg/reload.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/layout/components/sidebar/topCollapse.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 34 | -------------------------------------------------------------------------------- /gozero/common/kqueue/message.go: -------------------------------------------------------------------------------- 1 | //KqMessage 2 | package kqueue 3 | 4 | //第三方支付回调更改支付状态通知 5 | type ThirdPaymentUpdatePayStatusNotifyMessage struct { 6 | PayStatus int32 `json:"payStatus"` 7 | OrderSn string `json:"orderSn"` 8 | } 9 | 10 | //短信kf消息 11 | type SmsMessage struct { 12 | Mobile string `json:"mobile"` // 电话 13 | TmpId string `json:"tmpId"` // 模板id 14 | Title string `json:"title"` // 标题 15 | BodyJson string `json:"bodyJson"` // 详细json 16 | } 17 | 18 | //邮件kf消息 19 | type EmailMessage struct { 20 | Email string `json:"mobile"` // 邮件 21 | TmpId string `json:"tmpId"` // 模板id 22 | Title string `json:"title"` // 标题 23 | Content string `json:"content"` // 内容 24 | BodyJson string `json:"bodyJson"` // 详细json 25 | } 26 | 27 | // 消息 28 | type ImageZipMessage struct { 29 | Path string `json:"path"` // 路径 30 | Size string `json:"size"` // 尺寸 31 | } 32 | -------------------------------------------------------------------------------- /gozero/app/usercenter/cmd/rpc/internal/logic/getUserAuthByUserIdLogic.go: -------------------------------------------------------------------------------- 1 | package logic 2 | 3 | import ( 4 | "context" 5 | 6 | "go-cms/app/usercenter/cmd/rpc/internal/svc" 7 | "go-cms/app/usercenter/cmd/rpc/pb" 8 | 9 | "github.com/zeromicro/go-zero/core/logx" 10 | ) 11 | 12 | type GetUserAuthByUserIdLogic struct { 13 | ctx context.Context 14 | svcCtx *svc.ServiceContext 15 | logx.Logger 16 | } 17 | 18 | func NewGetUserAuthByUserIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserAuthByUserIdLogic { 19 | return &GetUserAuthByUserIdLogic{ 20 | ctx: ctx, 21 | svcCtx: svcCtx, 22 | Logger: logx.WithContext(ctx), 23 | } 24 | } 25 | 26 | func (l *GetUserAuthByUserIdLogic) GetUserAuthByUserId(in *pb.GetUserAuthByUserIdReq) (*pb.GetUserAuthyUserIdResp, error) { 27 | // todo: add your logic here and delete this line 28 | 29 | return &pb.GetUserAuthyUserIdResp{}, nil 30 | } 31 | -------------------------------------------------------------------------------- /gozero/common/xerr/errors.go: -------------------------------------------------------------------------------- 1 | package xerr 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | /** 8 | 常用通用固定错误 9 | */ 10 | 11 | type CodeError struct { 12 | errCode uint32 13 | errMsg string 14 | } 15 | 16 | //返回给前端的错误码 17 | func (e *CodeError) GetErrCode() uint32 { 18 | return e.errCode 19 | } 20 | 21 | //返回给前端显示端错误信息 22 | func (e *CodeError) GetErrMsg() string { 23 | return e.errMsg 24 | } 25 | 26 | func (e *CodeError) Error() string { 27 | return fmt.Sprintf("ErrCode:%d,ErrMsg:%s", e.errCode, e.errMsg) 28 | } 29 | 30 | func NewErrCodeMsg(errCode uint32, errMsg string) *CodeError { 31 | return &CodeError{errCode: errCode, errMsg: errMsg} 32 | } 33 | func NewErrCode(errCode uint32) *CodeError { 34 | return &CodeError{errCode: errCode, errMsg: MapErrMsg(errCode)} 35 | } 36 | 37 | func NewErrMsg(errMsg string) *CodeError { 38 | return &CodeError{errCode: SERVER_COMMON_ERROR, errMsg: errMsg} 39 | } 40 | -------------------------------------------------------------------------------- /server/utils/test/playerData.go2: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | import ( 4 | "fmt" 5 | "server/msg" 6 | ) 7 | 8 | type PlayerData struct { 9 | PlayerID uint `gorm:"primary_key"` 10 | UserName string `gorm:"not null"` 11 | role msg.RoleData 12 | } 13 | 14 | func (playerData *PlayerData) getValue(PlayerID uint) error { 15 | // mysql := mysql.MysqlDB() 16 | 17 | // err := mysql.Where("PlayerID = ?", playerID).Limit(1).Find(&playerInfo).Error 18 | // if nil != err { 19 | // fmt.Println(err) 20 | // return fmt.Errorf("get PlayerBaseInfo id error: %v", err) 21 | // } 22 | 23 | return nil 24 | } 25 | 26 | func (playerData *PlayerData) saveValue() error { 27 | fmt.Println(" playerData saveValue ===3= === ", playerData.role.RoleName) 28 | return nil 29 | } 30 | func addValue(playerData PlayerData) error { 31 | return nil 32 | } 33 | func setStatus(status int) error { 34 | return nil 35 | } 36 | -------------------------------------------------------------------------------- /server/router/common/common_file.go: -------------------------------------------------------------------------------- 1 | package commom 2 | 3 | import ( 4 | v1 "go-cms/api/v1" 5 | 6 | "github.com/gin-gonic/gin" 7 | ) 8 | 9 | type CommonFileRouter struct { 10 | } 11 | 12 | // InitCommonFileRouter 初始化 路由信息 13 | func (s *CommonFileRouter) InitCommonFileRouter(Router *gin.RouterGroup) { 14 | 15 | } 16 | 17 | // 私有路由 18 | func (s *CommonDbRouter) InitCommonFileRouterPrv(Router *gin.RouterGroup) { 19 | commonFileRouterWithoutRecord := Router.Group("commFile") 20 | var basicFileApi = v1.ApiGroupApp.BusinessApiGroup.BasicFileApi 21 | 22 | var fileApi = v1.ApiGroupApp.CommonApiGroup.CommonFileApi 23 | { 24 | commonFileRouterWithoutRecord.GET("get", basicFileApi.FindBasicFile) // 根据ID获取BasicFile 25 | commonFileRouterWithoutRecord.POST("upload", fileApi.UploadFile) 26 | commonFileRouterWithoutRecord.GET("getFileByKey", fileApi.GetFileByKey) // 根据sha1 key 获取BasicFile 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /gozero/app/usercenter/cmd/rpc/internal/logic/getUserAuthByAuthKeyLogic.go: -------------------------------------------------------------------------------- 1 | package logic 2 | 3 | import ( 4 | "context" 5 | 6 | "go-cms/app/usercenter/cmd/rpc/internal/svc" 7 | "go-cms/app/usercenter/cmd/rpc/pb" 8 | 9 | "github.com/zeromicro/go-zero/core/logx" 10 | ) 11 | 12 | type GetUserAuthByAuthKeyLogic struct { 13 | ctx context.Context 14 | svcCtx *svc.ServiceContext 15 | logx.Logger 16 | } 17 | 18 | func NewGetUserAuthByAuthKeyLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserAuthByAuthKeyLogic { 19 | return &GetUserAuthByAuthKeyLogic{ 20 | ctx: ctx, 21 | svcCtx: svcCtx, 22 | Logger: logx.WithContext(ctx), 23 | } 24 | } 25 | 26 | func (l *GetUserAuthByAuthKeyLogic) GetUserAuthByAuthKey(in *pb.GetUserAuthByAuthKeyReq) (*pb.GetUserAuthByAuthKeyResp, error) { 27 | // todo: add your logic here and delete this line 28 | 29 | return &pb.GetUserAuthByAuthKeyResp{}, nil 30 | } 31 | -------------------------------------------------------------------------------- /server/middleware/cors.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "github.com/gin-gonic/gin" 5 | "net/http" 6 | ) 7 | 8 | // 处理跨域请求,支持options访问 9 | func Cors() gin.HandlerFunc { 10 | return func(c *gin.Context) { 11 | method := c.Request.Method 12 | origin := c.Request.Header.Get("Origin") 13 | c.Header("Access-Control-Allow-Origin", origin) 14 | c.Header("Access-Control-Allow-Headers", "Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id") 15 | c.Header("Access-Control-Allow-Methods", "POST, GET, OPTIONS,DELETE,PUT") 16 | c.Header("Access-Control-Expose-Headers", "Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type") 17 | c.Header("Access-Control-Allow-Credentials", "true") 18 | 19 | // 放行所有OPTIONS方法 20 | if method == "OPTIONS" { 21 | c.AbortWithStatus(http.StatusNoContent) 22 | } 23 | // 处理请求 24 | c.Next() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /web/public/platform-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "Plat": "gocms", 3 | "Version": "1.0.0", 4 | "Title": "管理系统", 5 | "FixedHeader": true, 6 | "HiddenSideBar": false, 7 | "MultiTagsCache": false, 8 | "KeepAlive": false, 9 | "Locale": "zh", 10 | "Layout": "vertical", 11 | "Theme": "default", 12 | "DarkMode": false, 13 | "Grey": false, 14 | "Weak": false, 15 | "HideTabs": true, 16 | "HideFooter": true, 17 | "SidebarStatus": true, 18 | "EpThemeColor": "#409EFF", 19 | "ShowLogo": true, 20 | "ShowModel": "smart", 21 | "MenuArrowIconNoTransition": true, 22 | "CachingAsyncRoutes": false, 23 | "TooltipEffect": "light", 24 | "ResponsiveStorageNameSpace": "responsive-", 25 | "MapConfigure": { 26 | "amapKey": "97b3248d1553172e81f168cf94ea667e", 27 | "options": { 28 | "resizeEnable": true, 29 | "center": [113.6401, 34.72468], 30 | "zoom": 12 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /server/config/zap.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type Zap struct { 4 | Level string `mapstructure:"level" json:"level" yaml:"level"` // 级别 5 | Format string `mapstructure:"format" json:"format" yaml:"format"` // 输出 6 | Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` // 日志前缀 7 | Director string `mapstructure:"director" json:"director" yaml:"director"` // 日志文件夹 8 | ShowLine bool `mapstructure:"show-line" json:"showLine" yaml:"showLine"` // 显示行 9 | EncodeLevel string `mapstructure:"encode-level" json:"encodeLevel" yaml:"encode-level"` // 编码级 10 | StacktraceKey string `mapstructure:"stacktrace-key" json:"stacktraceKey" yaml:"stacktrace-key"` // 栈名 11 | LogInConsole bool `mapstructure:"log-in-console" json:"logInConsole" yaml:"log-in-console"` // 输出控制台 12 | } 13 | -------------------------------------------------------------------------------- /server/utils/upload/upload.go: -------------------------------------------------------------------------------- 1 | package upload 2 | 3 | import ( 4 | "mime/multipart" 5 | 6 | "go-cms/global" 7 | ) 8 | 9 | //@author: 10512203@qq.com 10 | //@author: 10512203@qq.com 11 | //@interface_name: OSS 12 | //@description: OSS接口 13 | 14 | type OSS interface { 15 | // module 模块, userType ,1管理用户 2普通用户 16 | UploadFile(file *multipart.FileHeader, module int, userType int) (string, string, error) 17 | DeleteFile(key string) error 18 | } 19 | 20 | //@author: 10512203@qq.com 21 | //@author: 10512203@qq.com 22 | //@function: NewOss 23 | //@description: OSS接口 24 | //@description: OSS的实例化方法 25 | //@return: OSS 26 | 27 | func NewOss() OSS { 28 | switch global.CONFIG.System.OssType { 29 | case "local": 30 | return &Local{} 31 | case "qiniu": 32 | return &Qiniu{} 33 | case "tencent-cos": 34 | return &TencentCOS{} 35 | case "aliyun-oss": 36 | return &AliyunOSS{} 37 | default: 38 | return &Local{} 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/delete.tpl: -------------------------------------------------------------------------------- 1 | 2 | func (m *default{{.upperStartCamelObject}}Model) Delete(ctx context.Context, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) error { 3 | {{if .withCache}}{{if .containsIndexCache}}data, err:=m.FindOne(ctx, {{.lowerStartCamelPrimaryKey}}) 4 | if err!=nil{ 5 | return err 6 | } 7 | 8 | {{end}} {{.keys}} 9 | _, err {{if .containsIndexCache}}={{else}}:={{end}} m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { 10 | query := fmt.Sprintf("delete from %s where {{.originalPrimaryKey}} = {{if .postgreSql}}$1{{else}}?{{end}}", m.table) 11 | return conn.ExecCtx(ctx, query, {{.lowerStartCamelPrimaryKey}}) 12 | }, {{.keyValues}}){{else}}query := fmt.Sprintf("delete from %s where {{.originalPrimaryKey}} = {{if .postgreSql}}$1{{else}}?{{end}}", m.table) 13 | _,err:=m.conn.ExecCtx(ctx, query, {{.lowerStartCamelPrimaryKey}}){{end}} 14 | return err 15 | } 16 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/rpc/internal/logic/verifyCodeLogic.go: -------------------------------------------------------------------------------- 1 | package logic 2 | 3 | import ( 4 | "context" 5 | 6 | "go-cms/app/basic/cmd/rpc/internal/svc" 7 | "go-cms/app/basic/cmd/rpc/pb" 8 | "go-cms/common/mycache" 9 | 10 | "github.com/zeromicro/go-zero/core/logx" 11 | ) 12 | 13 | type VerifyCodeLogic struct { 14 | ctx context.Context 15 | svcCtx *svc.ServiceContext 16 | logx.Logger 17 | } 18 | 19 | func NewVerifyCodeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *VerifyCodeLogic { 20 | return &VerifyCodeLogic{ 21 | ctx: ctx, 22 | svcCtx: svcCtx, 23 | Logger: logx.WithContext(ctx), 24 | } 25 | } 26 | 27 | // 图形码 28 | func (l *VerifyCodeLogic) VerifyCode(in *pb.VerifyCodeReq) (*pb.VerifyCodeResp, error) { 29 | code, _ := mycache.GetCache().Get(in.Key) 30 | if code.(string) == in.Code { 31 | return &pb.VerifyCodeResp{Status: 1}, nil 32 | } else { 33 | return &pb.VerifyCodeResp{Status: 0}, nil 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /web/build/index.ts: -------------------------------------------------------------------------------- 1 | /** 处理环境变量 */ 2 | const warpperEnv = (envConf: Recordable): ViteEnv => { 3 | /** 此处为默认值 */ 4 | const ret: ViteEnv = { 5 | VITE_PORT: 8848, 6 | VITE_PUBLIC_PATH: "", 7 | VITE_ROUTER_HISTORY: "", 8 | VITE_CDN: false, 9 | VITE_HIDE_HOME: "false", 10 | VITE_COMPRESSION: "none" 11 | }; 12 | 13 | for (const envName of Object.keys(envConf)) { 14 | let realName = envConf[envName].replace(/\\n/g, "\n"); 15 | realName = 16 | realName === "true" ? true : realName === "false" ? false : realName; 17 | 18 | if (envName === "VITE_PORT") { 19 | realName = Number(realName); 20 | } 21 | ret[envName] = realName; 22 | if (typeof realName === "string") { 23 | process.env[envName] = realName; 24 | } else if (typeof realName === "object") { 25 | process.env[envName] = JSON.stringify(realName); 26 | } 27 | } 28 | return ret; 29 | }; 30 | 31 | export { warpperEnv }; 32 | -------------------------------------------------------------------------------- /gozero/common/middleware/commonJwtAuthMiddleware.go: -------------------------------------------------------------------------------- 1 | package middleware 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/zeromicro/go-zero/rest/handler" 7 | ) 8 | 9 | // CommonJwtAuthMiddleware : with jwt on the verification, no jwt on the verification 10 | type CommonJwtAuthMiddleware struct { 11 | secret string 12 | } 13 | 14 | func NewCommonJwtAuthMiddleware(secret string) *CommonJwtAuthMiddleware { 15 | return &CommonJwtAuthMiddleware{ 16 | secret: secret, 17 | } 18 | } 19 | 20 | func (m *CommonJwtAuthMiddleware) Handle(next http.HandlerFunc) http.HandlerFunc { 21 | return func(w http.ResponseWriter, r *http.Request) { 22 | //if len(r.Header.Get("x-token")) > 0 { 23 | if len(r.Header.Get("Authorization")) > 0 { 24 | //has jwt Authorization 25 | authHandler := handler.Authorize(m.secret) 26 | authHandler(next).ServeHTTP(w, r) 27 | return 28 | } else { 29 | //no jwt Authorization 30 | next(w, r) 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /web/src/views/login/utils/motion.ts: -------------------------------------------------------------------------------- 1 | import { h, defineComponent, withDirectives, resolveDirective } from "vue"; 2 | 3 | /** 封装@vueuse/motion动画库中的自定义指令v-motion */ 4 | export default defineComponent({ 5 | name: "Motion", 6 | props: { 7 | delay: { 8 | type: Number, 9 | default: 50 10 | } 11 | }, 12 | render() { 13 | const { delay } = this; 14 | const motion = resolveDirective("motion"); 15 | return withDirectives( 16 | h( 17 | "div", 18 | {}, 19 | { 20 | default: () => [this.$slots.default()] 21 | } 22 | ), 23 | [ 24 | [ 25 | motion, 26 | { 27 | initial: { opacity: 0, y: 100 }, 28 | enter: { 29 | opacity: 1, 30 | y: 0, 31 | transition: { 32 | delay 33 | } 34 | } 35 | } 36 | ] 37 | ] 38 | ); 39 | } 40 | }); 41 | -------------------------------------------------------------------------------- /gozero/common/xerr/errMsg.go: -------------------------------------------------------------------------------- 1 | package xerr 2 | 3 | var message map[uint32]string 4 | 5 | func init() { 6 | message = make(map[uint32]string) 7 | message[OK] = "成功" 8 | message[SERVER_COMMON_ERROR] = "服务器开小差啦,稍后再来试一试" 9 | message[REUQEST_PARAM_ERROR] = "参数错误" 10 | message[TOKEN_EXPIRE_ERROR] = "token失效,请重新登陆" 11 | message[TOKEN_GENERATE_ERROR] = "生成token失败" 12 | message[DB_ERROR] = "数据库繁忙,请稍后再试" 13 | message[DB_UPDATE_AFFECTED_ZERO_ERROR] = "更新数据影响行数为0" 14 | message[DB_RecordNotFound] = "数据不存在" 15 | message[DB_InsertErr] = "新增数据失败" 16 | message[DB_UpdateErr] = "更新数据失败" 17 | message[VerifyCode_ERROR] = "验证码错误" 18 | } 19 | 20 | func MapErrMsg(errcode uint32) string { 21 | if msg, ok := message[errcode]; ok { 22 | return msg 23 | } else { 24 | return "服务器开小差啦,稍后再来试一试" 25 | } 26 | } 27 | 28 | func IsCodeErr(errcode uint32) bool { 29 | //eturn false 30 | if _, ok := message[errcode]; ok { 31 | return true 32 | } else { 33 | return false 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /gozero/deploy/goctl/model/insert.tpl: -------------------------------------------------------------------------------- 1 | 2 | func (m *default{{.upperStartCamelObject}}Model) Insert(ctx context.Context,session sqlx.Session, data *{{.upperStartCamelObject}}) (sql.Result,error) { 3 | data.DeletedAt = time.Unix(0,0) 4 | {{if .withCache}}{{.keys}} 5 | return m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { 6 | query := fmt.Sprintf("insert into %s (%s) values ({{.expression}})", m.table, {{.lowerStartCamelObject}}RowsExpectAutoSet) 7 | if session != nil{ 8 | return session.ExecCtx(ctx,query,{{.expressionValues}}) 9 | } 10 | return conn.ExecCtx(ctx, query, {{.expressionValues}}) 11 | }, {{.keyValues}}){{else}} 12 | query := fmt.Sprintf("insert into %s (%s) values ({{.expression}})", m.table, {{.lowerStartCamelObject}}RowsExpectAutoSet) 13 | if session != nil{ 14 | return session.ExecCtx(ctx,query,{{.expressionValues}}) 15 | } 16 | return m.conn.ExecCtx(ctx, query, {{.expressionValues}}){{end}} 17 | } 18 | -------------------------------------------------------------------------------- /web/src/api/common_db.ts: -------------------------------------------------------------------------------- 1 | import { http,resData } from "@/utils/http"; 2 | 3 | 4 | export const pidData = (data?: object) => { 5 | return http.request("post", "/commDb/pidData", { data }); 6 | }; 7 | 8 | 9 | export const pidTreeData = (data?: object) => { 10 | return http.request("post", "/commDb/pidTreeData", { data }); 11 | }; 12 | 13 | 14 | export const getDictData = (data?: object) => { 15 | return http.request("post", "/commDb/getDict", { data }); 16 | }; 17 | 18 | 19 | 20 | export const getDictData2 = (data?: object) => { 21 | return http.request("post", "/commDb/getDict2", { data }); 22 | }; 23 | 24 | 25 | 26 | 27 | export const getDictTreeData = (data?: object) => { 28 | return http.request("post", "/commDb/getDictTree", { data }); 29 | }; 30 | 31 | 32 | export const updatePidSort = (data?: object) => { 33 | return http.request("post", "/commDb/updatePidSort", { data }); 34 | }; 35 | -------------------------------------------------------------------------------- /gozero/app/cms/cmd/api/internal/logic/cms/artDetailLogic.go: -------------------------------------------------------------------------------- 1 | package cms 2 | 3 | import ( 4 | "context" 5 | 6 | "go-cms/app/cms/cmd/api/internal/svc" 7 | "go-cms/app/cms/cmd/api/internal/types" 8 | 9 | "github.com/jinzhu/copier" 10 | "github.com/zeromicro/go-zero/core/logx" 11 | ) 12 | 13 | type ArtDetailLogic struct { 14 | logx.Logger 15 | ctx context.Context 16 | svcCtx *svc.ServiceContext 17 | } 18 | 19 | func NewArtDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) ArtDetailLogic { 20 | return ArtDetailLogic{ 21 | Logger: logx.WithContext(ctx), 22 | ctx: ctx, 23 | svcCtx: svcCtx, 24 | } 25 | } 26 | 27 | func (l *ArtDetailLogic) ArtDetail(req *types.IdReq) (resp *types.ArtDetailResp, err error) { 28 | art, err := l.svcCtx.CmsArtSev.Get(l.ctx, req.Id, "") 29 | if err != nil { 30 | return nil, err 31 | } 32 | var obj types.ArtDetailResp 33 | _ = copier.Copy(&obj, art) 34 | obj.CreatedAt = art.CreatedAt.Unix() 35 | return &obj, nil 36 | } 37 | -------------------------------------------------------------------------------- /web/src/components/ReBarcode/src/index.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | 43 | -------------------------------------------------------------------------------- /web/src/components/ReImageVerify/src/index.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 47 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/api/internal/logic/basic/fileListLogic.go: -------------------------------------------------------------------------------- 1 | package basic 2 | 3 | import ( 4 | "context" 5 | 6 | "go-cms/app/basic/cmd/api/internal/svc" 7 | "go-cms/app/basic/cmd/api/internal/types" 8 | 9 | "github.com/zeromicro/go-zero/core/logx" 10 | ) 11 | 12 | type FileListLogic struct { 13 | logx.Logger 14 | ctx context.Context 15 | svcCtx *svc.ServiceContext 16 | } 17 | 18 | func NewFileListLogic(ctx context.Context, svcCtx *svc.ServiceContext) FileListLogic { 19 | return FileListLogic{ 20 | Logger: logx.WithContext(ctx), 21 | ctx: ctx, 22 | svcCtx: svcCtx, 23 | } 24 | } 25 | 26 | func (l *FileListLogic) FileList(req *types.PageInfoReq) (out *types.FileListResp, err error) { 27 | 28 | // fileListResp, err := l.svcCtx.BasicRpc.FileList(l.ctx, &basic.FileListReq{Ids: req.Ids}) 29 | // if err != nil { 30 | // return nil, err 31 | // } 32 | 33 | // var resp types.FileListResp 34 | // _ = copier.Copy(&resp, fileListResp) 35 | 36 | return out, nil 37 | } 38 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/api/desc/sms/sms.api: -------------------------------------------------------------------------------- 1 | syntax = "v1" 2 | 3 | info( 4 | title: "基础服务" 5 | desc: "基础服务" 6 | author: "go-cms" 7 | email: "10512203@qq.com" 8 | version: "v1" 9 | ) 10 | // 获取图形码 11 | type ( 12 | CaptchaReq { 13 | } 14 | CaptchaResp { 15 | Image string `json:"image"` //base64的字符串图形 16 | Key string `json:"key"` //下一步用到的 key 17 | ExpireTime int32 `json:"expireTime"` 18 | Length int32 `json:"length"` //长度 19 | } 20 | ) 21 | 22 | //发送 短信/email 验证码 23 | type ( 24 | SendCodeReq { 25 | SendType int32 `json:"sendType"` // 1 短信 2 邮件 26 | Phone string `json:"phone"` // 短信或邮箱 27 | VerilyType int32 `json:"verilyType"` // 验证码类型 1注册,2密码登录,3手机登录,4修改密码 28 | Key string `json:"key"` // 获得的 key 29 | Code string `json:"code"` // 看见的验证码code 30 | } 31 | SendCodeResp { 32 | Key string `json:"key"` //下一步用到的 key 33 | ExpireTime int32 `json:"expireTime"` 34 | } 35 | ) 36 | -------------------------------------------------------------------------------- /gozero/app/usercenter/model/memContactsGroup.go: -------------------------------------------------------------------------------- 1 | // 自动生成模板MemContactsGroup 2 | package model 3 | 4 | import ( 5 | . "go-cms/common/baseModel" 6 | ) 7 | 8 | // MemContactsGroup 结构体 9 | type MemContactsGroup struct { 10 | BaseModel 11 | UserId int64 `db:"user_id" json:"userId" gorm:"column:user_id"` //用户id 12 | Name string `db:"name" json:"name" gorm:"column:name"` //名称 13 | Star int `db:"star" json:"star" gorm:"column:star"` //标星 14 | Status int `db:"status" json:"status" gorm:"column:status"` //状态 15 | 16 | } 17 | 18 | // TableName MemContactsGroup 表名 19 | func (MemContactsGroup) TableName() string { 20 | return "mem_contacts_group" 21 | } 22 | 23 | // MemContactsGroupSearch 查询 24 | type MemContactsGroupSearch struct { 25 | BaseModel 26 | PageInfo 27 | UserId *int64 `json:"userId" form:"userId" ` 28 | Name string `json:"name" form:"name" ` 29 | Star *int `json:"star" form:"star" ` 30 | Status *int `json:"status" form:"status" ` 31 | } 32 | -------------------------------------------------------------------------------- /server/myError/myError.go: -------------------------------------------------------------------------------- 1 | package myError 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | //自定义异常结构体 8 | type MyError struct { 9 | Type ErrorType //异常操作 10 | Msg string //异常信息 11 | //ErrorTime string //异常时间 12 | } 13 | 14 | func (e MyError) Error() string { 15 | errInfo := fmt.Sprintf(" msg:%s ", e.Msg) 16 | return errInfo 17 | } 18 | 19 | func New(errorType ErrorType, msg string) MyError { 20 | //now := time.Now() 21 | //myErr := MyError{errorType, msg, now.Format("2006-01-02 15:04:05")} 22 | myErr := MyError{errorType, msg} 23 | return myErr 24 | } 25 | func NewP(errorType ErrorType, msg string) *MyError { 26 | //now := time.Now() 27 | myErr := MyError{errorType, msg} 28 | return &myErr 29 | } 30 | 31 | // func (myError *MyError) New(errorType ErrorType, msg string) error { 32 | // myErr := new(MyError) 33 | // myErr.Type = errorType 34 | // myErr.Msg = msg 35 | // now := time.Now() 36 | // myErr.ErrorTime = now.Format("2006-01-02 15:04:05") 37 | // return myErr 38 | // } 39 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/model/var.tpl: -------------------------------------------------------------------------------- 1 | var ( 2 | {{.lowerStartCamelObject}}FieldNames = builder.RawFieldNames(&{{.upperStartCamelObject}}{}{{if .postgreSql}}, true{{end}}) 3 | {{.lowerStartCamelObject}}Rows = strings.Join({{.lowerStartCamelObject}}FieldNames, ",") 4 | {{.lowerStartCamelObject}}RowsExpectAutoSet = {{if .postgreSql}}strings.Join(stringx.Remove({{.lowerStartCamelObject}}FieldNames, {{if .autoIncrement}}"{{.originalPrimaryKey}}", {{end}} {{.ignoreColumns}}), ","){{else}}strings.Join(stringx.Remove({{.lowerStartCamelObject}}FieldNames, {{if .autoIncrement}}"{{.originalPrimaryKey}}", {{end}} {{.ignoreColumns}}), ","){{end}} 5 | {{.lowerStartCamelObject}}RowsWithPlaceHolder = {{if .postgreSql}}builder.PostgreSqlJoin(stringx.Remove({{.lowerStartCamelObject}}FieldNames, "{{.originalPrimaryKey}}", {{.ignoreColumns}})){{else}}strings.Join(stringx.Remove({{.lowerStartCamelObject}}FieldNames, "{{.originalPrimaryKey}}", {{.ignoreColumns}}), "=?,") + "=?"{{end}} 6 | 7 | {{if .withCache}}{{.cacheKeys}}{{end}} 8 | ) 9 | -------------------------------------------------------------------------------- /web/src/assets/svg/hot.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/components/ReSplitPane/index.css: -------------------------------------------------------------------------------- 1 | .clearfix::after { 2 | visibility: hidden; 3 | display: block; 4 | font-size: 0; 5 | content: " "; 6 | clear: both; 7 | height: 0; 8 | } 9 | 10 | .vue-splitter-container { 11 | height: 100%; 12 | position: relative; 13 | } 14 | 15 | .vue-splitter-container-mask { 16 | z-index: 9999; 17 | width: 100%; 18 | height: 100%; 19 | position: absolute; 20 | top: 0; 21 | left: 0; 22 | } 23 | 24 | .splitter-pane.vertical.splitter-paneL { 25 | position: absolute; 26 | left: 0; 27 | height: 100%; 28 | padding-right: 3px; 29 | } 30 | 31 | .splitter-pane.vertical.splitter-paneR { 32 | position: absolute; 33 | right: 0; 34 | height: 100%; 35 | padding-left: 3px; 36 | } 37 | 38 | .splitter-pane.horizontal.splitter-paneL { 39 | position: absolute; 40 | top: 0; 41 | width: 100%; 42 | } 43 | 44 | .splitter-pane.horizontal.splitter-paneR { 45 | position: absolute; 46 | bottom: 0; 47 | width: 100%; 48 | padding-top: 3px; 49 | } 50 | -------------------------------------------------------------------------------- /gozero/deploy/goctl-tpl/rpc/main.tpl: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "fmt" 6 | 7 | {{.imports}} 8 | 9 | "github.com/zeromicro/go-zero/core/conf" 10 | "github.com/zeromicro/go-zero/core/service" 11 | "github.com/zeromicro/go-zero/zrpc" 12 | "google.golang.org/grpc" 13 | "google.golang.org/grpc/reflection" 14 | ) 15 | 16 | var configFile = flag.String("f", "etc/{{.serviceName}}.yaml", "the config file") 17 | 18 | func main() { 19 | flag.Parse() 20 | 21 | var c config.Config 22 | conf.MustLoad(*configFile, &c) 23 | ctx := svc.NewServiceContext(c) 24 | 25 | s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { 26 | {{range .serviceNames}} {{.Pkg}}.Register{{.Service}}Server(grpcServer, {{.ServerPkg}}.New{{.Service}}Server(ctx)) 27 | {{end}} 28 | if c.Mode == service.DevMode || c.Mode == service.TestMode { 29 | reflection.Register(grpcServer) 30 | } 31 | }) 32 | defer s.Stop() 33 | 34 | fmt.Printf("Starting rpc server at %s...\n", c.ListenOn) 35 | s.Start() 36 | } 37 | -------------------------------------------------------------------------------- /web/src/components/ReTypeit/index.ts: -------------------------------------------------------------------------------- 1 | import { h, defineComponent } from "vue"; 2 | import TypeIt from "typeit"; 3 | 4 | // 打字机效果组件(只是简单的封装下,更多配置项参考 https://www.typeitjs.com/docs/vanilla/usage#options) 5 | export default defineComponent({ 6 | name: "TypeIt", 7 | props: { 8 | /** 打字速度,以每一步之间的毫秒数为单位,默认`200` */ 9 | speed: { 10 | type: Number, 11 | default: 200 12 | }, 13 | values: { 14 | type: Array, 15 | defalut: [] 16 | }, 17 | className: { 18 | type: String, 19 | default: "type-it" 20 | }, 21 | cursor: { 22 | type: Boolean, 23 | default: true 24 | } 25 | }, 26 | render() { 27 | return h( 28 | "span", 29 | { 30 | class: this.className 31 | }, 32 | { 33 | default: () => [] 34 | } 35 | ); 36 | }, 37 | mounted() { 38 | new TypeIt(`.${this.className}`, { 39 | strings: this.values, 40 | speed: this.speed, 41 | cursor: this.cursor 42 | }).go(); 43 | } 44 | }); 45 | -------------------------------------------------------------------------------- /gozero/app/basic/cmd/rpc/internal/logic/fileListLogic.go: -------------------------------------------------------------------------------- 1 | package logic 2 | 3 | import ( 4 | "context" 5 | 6 | "go-cms/app/basic/cmd/rpc/internal/svc" 7 | "go-cms/app/basic/cmd/rpc/pb" 8 | "go-cms/common/utils" 9 | 10 | "github.com/zeromicro/go-zero/core/logx" 11 | ) 12 | 13 | type FileListLogic struct { 14 | ctx context.Context 15 | svcCtx *svc.ServiceContext 16 | logx.Logger 17 | } 18 | 19 | func NewFileListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FileListLogic { 20 | return &FileListLogic{ 21 | ctx: ctx, 22 | svcCtx: svcCtx, 23 | Logger: logx.WithContext(ctx), 24 | } 25 | } 26 | 27 | // FileList 文件列表 28 | func (l *FileListLogic) FileList(in *pb.FileListReq) (*pb.FileListResp, error) { 29 | 30 | resp := pb.FileListResp{} 31 | for _, v := range in.Ids { 32 | fileInfo := pb.FileInfo{Guid: v} 33 | if !utils.IsEmpty(v) { 34 | fileInfo.Path, _ = l.svcCtx.BasicFileSev.GetPathByGuid(l.ctx, v) 35 | } 36 | resp.List = append(resp.List, &fileInfo) 37 | } 38 | return &resp, nil 39 | } 40 | -------------------------------------------------------------------------------- /web/src/components/RePureTableBar/src/svg/settings.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /web/src/store/modules/settings.ts: -------------------------------------------------------------------------------- 1 | import { defineStore } from "pinia"; 2 | import { store } from "@/store"; 3 | import { setType } from "./types"; 4 | import { getConfig } from "@/config"; 5 | 6 | export const useSettingStore = defineStore({ 7 | id: "pure-setting", 8 | state: (): setType => ({ 9 | title: getConfig().Title, 10 | fixedHeader: getConfig().FixedHeader, 11 | hiddenSideBar: getConfig().HiddenSideBar 12 | }), 13 | getters: { 14 | getTitle(state) { 15 | return state.title; 16 | }, 17 | getFixedHeader(state) { 18 | return state.fixedHeader; 19 | }, 20 | getHiddenSideBar(state) { 21 | return state.hiddenSideBar; 22 | } 23 | }, 24 | actions: { 25 | CHANGE_SETTING({ key, value }) { 26 | if (Reflect.has(this, key)) { 27 | this[key] = value; 28 | } 29 | }, 30 | changeSetting(data) { 31 | this.CHANGE_SETTING(data); 32 | } 33 | } 34 | }); 35 | 36 | export function useSettingStoreHook() { 37 | return useSettingStore(store); 38 | } 39 | --------------------------------------------------------------------------------