├── web ├── .dockerignore ├── .eslintignore ├── .gitignore ├── favicon.ico ├── src │ ├── assets │ │ ├── qm.png │ │ ├── docs.png │ │ ├── github.png │ │ ├── kefu.png │ │ ├── logo.jpg │ │ ├── logo.png │ │ ├── noBody.png │ │ ├── video.png │ │ ├── nav_logo.png │ │ ├── notFound.png │ │ ├── dashboard.png │ │ ├── logo_login.png │ │ ├── flipped-aurora.png │ │ ├── login_background.jpg │ │ └── login_right_banner.jpg │ ├── utils │ │ ├── doc.js │ │ ├── bus.js │ │ ├── closeThisPage.js │ │ ├── btnAuth.js │ │ ├── page.js │ │ ├── fmtRouterTitle.js │ │ ├── dictionary.js │ │ ├── stringFun.js │ │ ├── downloadImg.js │ │ ├── format.js │ │ ├── asyncRouter.js │ │ ├── positionToCode.js │ │ └── date.js │ ├── pinia │ │ ├── index.js │ │ └── modules │ │ │ └── dictionary.js │ ├── view │ │ ├── error │ │ │ ├── reload.vue │ │ │ └── index.vue │ │ ├── systemTools │ │ │ ├── formCreate │ │ │ │ └── index.vue │ │ │ ├── index.vue │ │ │ ├── pubPlug │ │ │ │ └── pubPlug.vue │ │ │ └── installPlugin │ │ │ │ └── index.vue │ │ ├── example │ │ │ └── index.vue │ │ ├── superAdmin │ │ │ └── index.vue │ │ ├── routerHolder.vue │ │ ├── dashboard │ │ │ └── weather.js │ │ └── layout │ │ │ ├── bottomInfo │ │ │ └── bottomInfo.vue │ │ │ ├── screenfull │ │ │ └── index.vue │ │ │ ├── aside │ │ │ └── asideComponent │ │ │ │ └── index.vue │ │ │ └── search │ │ │ └── search.vue │ ├── core │ │ ├── global.js │ │ ├── gin-vue-admin.js │ │ └── config.js │ ├── api │ │ ├── email.js │ │ ├── github.js │ │ ├── jwt.js │ │ ├── authorityBtn.js │ │ ├── chatgpt.js │ │ ├── initdb.js │ │ ├── casbin.js │ │ ├── breakpoint.js │ │ ├── system.js │ │ └── fileUploadAndDownload.js │ ├── style │ │ ├── element │ │ │ └── index.scss │ │ └── element_visiable.scss │ ├── router │ │ └── index.js │ ├── App.vue │ ├── components │ │ ├── warningBar │ │ │ └── warningBar.vue │ │ ├── richtext │ │ │ └── rich-view.vue │ │ ├── selectFile │ │ │ └── selectFile.vue │ │ └── upload │ │ │ └── common.vue │ ├── plugin │ │ └── email │ │ │ ├── api │ │ │ └── email.js │ │ │ └── view │ │ │ └── index.vue │ ├── main.js │ └── directive │ │ └── auth.js ├── babel.config.js ├── postcss.config.js ├── .env.production ├── jsconfig.json ├── .env.development ├── tailwind.config.js ├── Dockerfile ├── openDocument.js ├── index.html ├── .docker-compose │ └── nginx │ │ └── conf.d │ │ ├── my.conf │ │ └── nginx.conf ├── vitePlugin │ ├── fullImport │ │ └── fullImport.js │ ├── gvaPosition │ │ └── index.js │ └── codeServer │ │ └── index.js └── limit.js ├── .gitattributes ├── docs └── gin-vue-admin.png ├── server ├── packfile │ ├── notUsePackFile.go │ └── usePackFile.go ├── model │ ├── system │ │ ├── response │ │ │ ├── sys_chatgpt.go │ │ │ ├── sys_authority_btn.go │ │ │ ├── sys_system.go │ │ │ ├── sys_casbin.go │ │ │ ├── sys_captcha.go │ │ │ ├── sys_api.go │ │ │ ├── sys_menu.go │ │ │ ├── sys_user.go │ │ │ ├── sys_authority.go │ │ │ ├── sys_auto_code.go │ │ │ └── sys_auto_code_history.go │ │ ├── request │ │ │ ├── sys_authority_btn.go │ │ │ ├── sys_chatgpt.go │ │ │ ├── sys_dictionary.go │ │ │ ├── sys_operation_record.go │ │ │ ├── sys_dictionary_detail.go │ │ │ ├── sys_auto_history.go │ │ │ ├── sys_api.go │ │ │ ├── jwt.go │ │ │ ├── sys_menu.go │ │ │ └── sys_casbin.go │ │ ├── sys_system.go │ │ ├── sys_jwt_blacklist.go │ │ ├── sys_authority_btn.go │ │ ├── sys_menu_btn.go │ │ ├── sys_user_authority.go │ │ ├── sys_chatgpt.go │ │ ├── sys_api.go │ │ ├── sys_authority_menu.go │ │ ├── sys_dictionary.go │ │ ├── sys_dictionary_detail.go │ │ ├── sys_authority.go │ │ ├── sys_autocode_history.go │ │ └── sys_operation_record.go │ ├── example │ │ ├── response │ │ │ ├── exa_customer.go │ │ │ ├── exa_file_upload_download.go │ │ │ └── exa_breakpoint_continue.go │ │ ├── exa_file_upload_download.go │ │ ├── exa_breakpoint_continue.go │ │ └── exa_customer.go │ └── common │ │ ├── response │ │ ├── common.go │ │ └── response.go │ │ └── request │ │ └── common.go ├── utils │ ├── getPointer.go │ ├── ast │ │ ├── ast_auto_enter_test.go │ │ ├── ast_rollback_test.go │ │ ├── ast_router_test.go │ │ ├── ast_gorm_test.go │ │ ├── ast.go │ │ └── ast_auto_enter.go │ ├── plugin │ │ └── plugin.go │ ├── reload.go │ ├── md5.go │ ├── hash.go │ ├── strings.go │ ├── human_duration.go │ ├── db_automation.go │ ├── upload │ │ └── upload.go │ ├── validator_test.go │ ├── fmt_plus.go │ ├── human_duration_test.go │ ├── directory.go │ ├── timer │ │ └── timed_task_test.go │ ├── zip.go │ ├── verify.go │ ├── captcha │ │ └── redis.go │ └── zipfiles.go ├── resource │ ├── autocode_template │ │ ├── subcontract │ │ │ ├── api_enter.go.tpl │ │ │ ├── router_enter.go.tpl │ │ │ ├── service_enter.go.tpl │ │ │ └── data.go │ │ ├── readme.txt.tpl │ │ └── server │ │ │ ├── request.go.tpl │ │ │ └── router.go.tpl │ ├── page │ │ ├── fonts │ │ │ ├── element-icons.535877f5.woff │ │ │ └── element-icons.732389de.ttf │ │ └── index.html │ └── plug_template │ │ ├── api │ │ ├── enter.go.tpl │ │ └── api.go.tpl │ │ ├── router │ │ ├── enter.go.tpl │ │ └── router.go.tpl │ │ ├── service │ │ ├── enter.go.tpl │ │ └── service.go.tpl │ │ ├── global │ │ └── global.go.tpl │ │ ├── config │ │ └── config.go.tpl │ │ ├── model │ │ └── model.go.tpl │ │ └── main.go.tpl ├── config │ ├── excel.go │ ├── oss_local.go │ ├── redis.go │ ├── gorm_sqlite.go │ ├── gorm_mysql.go │ ├── gorm_oracle.go │ ├── gorm_mssql.go │ ├── jwt.go │ ├── oss_huawei.go │ ├── oss_tencent.go │ ├── oss_aliyun.go │ ├── email.go │ ├── gorm_pgsql.go │ ├── captcha.go │ ├── cors.go │ ├── timer.go │ ├── oss_qiniu.go │ ├── oss_aws.go │ ├── system.go │ ├── auto_code.go │ └── config.go ├── plugin │ ├── email │ │ ├── api │ │ │ └── enter.go │ │ ├── router │ │ │ ├── enter.go │ │ │ └── sys_email.go │ │ ├── service │ │ │ ├── enter.go │ │ │ └── sys_email.go │ │ ├── global │ │ │ └── gloabl.go │ │ ├── model │ │ │ └── response │ │ │ │ └── email.go │ │ ├── config │ │ │ └── email.go │ │ └── main.go │ └── plugin-tool │ │ └── utils │ │ └── check.go ├── router │ ├── example │ │ ├── enter.go │ │ ├── exa_customer.go │ │ └── exa_file_upload_and_download.go │ ├── enter.go │ └── system │ │ ├── enter.go │ │ ├── sys_jwt.go │ │ ├── sys_initdb.go │ │ ├── sys_base.go │ │ ├── sys_chatgpt.go │ │ ├── sys_casbin.go │ │ ├── sys_system.go │ │ ├── sys_auto_code_history.go │ │ ├── sys_authority_btn.go │ │ ├── sys_authority.go │ │ ├── sys_operation_record.go │ │ ├── sys_dictionary.go │ │ ├── sys_auto_code.go │ │ ├── sys_api.go │ │ ├── sys_user.go │ │ ├── sys_dictionary_detail.go │ │ └── sys_menu.go ├── service │ ├── example │ │ └── enter.go │ ├── enter.go │ └── system │ │ ├── enter.go │ │ └── sys_auto_code_interface.go ├── core │ ├── internal │ │ ├── constant.go │ │ └── file_rotatelogs.go │ ├── server_other.go │ ├── server_win.go │ ├── zap.go │ └── server.go ├── initialize │ ├── register_init.go │ ├── validator.go │ ├── other.go │ ├── redis.go │ ├── internal │ │ ├── logger.go │ │ └── gorm.go │ ├── timer.go │ ├── db_list.go │ ├── gorm_sqlite.go │ ├── plugin.go │ ├── gorm_pgsql.go │ ├── gorm.go │ └── gorm_oracle.go ├── global │ ├── model.go │ └── global.go ├── api │ └── v1 │ │ ├── enter.go │ │ ├── example │ │ └── enter.go │ │ └── system │ │ └── sys_jwt_blacklist.go ├── middleware │ ├── need_init.go │ ├── loadtls.go │ └── casbin_rbac.go ├── Dockerfile └── main.go ├── SECURITY.md ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── feature_request.yaml │ └── bug_report.yaml └── FUNDING.yml ├── deploy ├── kubernetes │ ├── web │ │ ├── gva-web-ingress.yaml │ │ ├── gva-web-service.yaml │ │ ├── gva-web-configmap.yaml │ │ └── gva-web-deploymemt.yaml │ └── server │ │ └── gva-server-service.yaml └── docker │ ├── entrypoint.sh │ └── Dockerfile ├── .gitignore ├── CONTRIBUTING.md └── gin-vue-admin.code-workspace /web/.dockerignore: -------------------------------------------------------------------------------- 1 | node_modules/ -------------------------------------------------------------------------------- /web/.eslintignore: -------------------------------------------------------------------------------- 1 | build/*.js 2 | src/assets 3 | public 4 | dist 5 | -------------------------------------------------------------------------------- /web/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/* 2 | package-lock.json 3 | yarn.lock -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sql linguist-language=GO 2 | *.html linguist-language=GO 3 | -------------------------------------------------------------------------------- /web/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/favicon.ico -------------------------------------------------------------------------------- /docs/gin-vue-admin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/docs/gin-vue-admin.png -------------------------------------------------------------------------------- /web/src/assets/qm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/src/assets/qm.png -------------------------------------------------------------------------------- /web/src/utils/doc.js: -------------------------------------------------------------------------------- 1 | export const toDoc = (url)=>{ 2 | window.open(url, '_blank') 3 | } 4 | -------------------------------------------------------------------------------- /server/packfile/notUsePackFile.go: -------------------------------------------------------------------------------- 1 | //go:build !packfile 2 | // +build !packfile 3 | 4 | package packfile 5 | -------------------------------------------------------------------------------- /web/src/assets/docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/src/assets/docs.png -------------------------------------------------------------------------------- /web/src/assets/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/src/assets/github.png -------------------------------------------------------------------------------- /web/src/assets/kefu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/src/assets/kefu.png -------------------------------------------------------------------------------- /web/src/assets/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/src/assets/logo.jpg -------------------------------------------------------------------------------- /web/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/src/assets/logo.png -------------------------------------------------------------------------------- /web/src/assets/noBody.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/src/assets/noBody.png -------------------------------------------------------------------------------- /web/src/assets/video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/src/assets/video.png -------------------------------------------------------------------------------- /server/model/system/response/sys_chatgpt.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | type ChatGptResponse struct { 4 | } 5 | -------------------------------------------------------------------------------- /server/utils/getPointer.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | func Pointer[T any](in T) (out *T) { 4 | return &in 5 | } 6 | -------------------------------------------------------------------------------- /web/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | 4 | ], 5 | 'plugins': [ 6 | 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /web/src/assets/nav_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/src/assets/nav_logo.png -------------------------------------------------------------------------------- /web/src/assets/notFound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/src/assets/notFound.png -------------------------------------------------------------------------------- /web/src/assets/dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/src/assets/dashboard.png -------------------------------------------------------------------------------- /web/src/assets/logo_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/src/assets/logo_login.png -------------------------------------------------------------------------------- /web/src/utils/bus.js: -------------------------------------------------------------------------------- 1 | 2 | // using ES6 modules 3 | import mitt from 'mitt' 4 | 5 | export const emitter = mitt() 6 | 7 | -------------------------------------------------------------------------------- /web/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | tailwindcss: {}, 4 | autoprefixer: {}, 5 | }, 6 | } 7 | -------------------------------------------------------------------------------- /web/src/assets/flipped-aurora.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/src/assets/flipped-aurora.png -------------------------------------------------------------------------------- /web/src/assets/login_background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/src/assets/login_background.jpg -------------------------------------------------------------------------------- /server/resource/autocode_template/subcontract/api_enter.go.tpl: -------------------------------------------------------------------------------- 1 | package {{ .PackageName }} 2 | 3 | type ApiGroup struct { 4 | } 5 | -------------------------------------------------------------------------------- /web/src/assets/login_right_banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/web/src/assets/login_right_banner.jpg -------------------------------------------------------------------------------- /server/config/excel.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type Excel struct { 4 | Dir string `mapstructure:"dir" json:"dir" yaml:"dir"` 5 | } 6 | -------------------------------------------------------------------------------- /server/resource/autocode_template/subcontract/router_enter.go.tpl: -------------------------------------------------------------------------------- 1 | package {{ .PackageName }} 2 | 3 | type RouterGroup struct { 4 | } 5 | -------------------------------------------------------------------------------- /web/src/pinia/index.js: -------------------------------------------------------------------------------- 1 | import { createPinia } from 'pinia' 2 | 3 | const store = createPinia() 4 | 5 | export { 6 | store 7 | } 8 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | Please report security issues to qimiaojiangjizhao@gmail.com 6 | -------------------------------------------------------------------------------- /server/plugin/email/api/enter.go: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | type ApiGroup struct { 4 | EmailApi 5 | } 6 | 7 | var ApiGroupApp = new(ApiGroup) 8 | -------------------------------------------------------------------------------- /server/router/example/enter.go: -------------------------------------------------------------------------------- 1 | package example 2 | 3 | type RouterGroup struct { 4 | CustomerRouter 5 | FileUploadAndDownloadRouter 6 | } 7 | -------------------------------------------------------------------------------- /server/service/example/enter.go: -------------------------------------------------------------------------------- 1 | package example 2 | 3 | type ServiceGroup struct { 4 | CustomerService 5 | FileUploadAndDownloadService 6 | } 7 | -------------------------------------------------------------------------------- /server/resource/autocode_template/subcontract/service_enter.go.tpl: -------------------------------------------------------------------------------- 1 | package {{ .PackageName }} 2 | 3 | 4 | type ServiceGroup struct { 5 | } 6 | 7 | -------------------------------------------------------------------------------- /server/model/system/response/sys_authority_btn.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | type SysAuthorityBtnRes struct { 4 | Selected []uint `json:"selected"` 5 | } 6 | -------------------------------------------------------------------------------- /server/plugin/email/router/enter.go: -------------------------------------------------------------------------------- 1 | package router 2 | 3 | type RouterGroup struct { 4 | EmailRouter 5 | } 6 | 7 | var RouterGroupApp = new(RouterGroup) 8 | -------------------------------------------------------------------------------- /web/src/utils/closeThisPage.js: -------------------------------------------------------------------------------- 1 | import { emitter } from '@/utils/bus.js' 2 | 3 | export const closeThisPage = () => { 4 | emitter.emit('closeThisPage') 5 | } 6 | -------------------------------------------------------------------------------- /server/plugin/email/service/enter.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | type ServiceGroup struct { 4 | EmailService 5 | } 6 | 7 | var ServiceGroupApp = new(ServiceGroup) 8 | -------------------------------------------------------------------------------- /server/resource/page/fonts/element-icons.535877f5.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/server/resource/page/fonts/element-icons.535877f5.woff -------------------------------------------------------------------------------- /server/resource/page/fonts/element-icons.732389de.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Rockyzsu/gin-vue-admin/main/server/resource/page/fonts/element-icons.732389de.ttf -------------------------------------------------------------------------------- /server/resource/plug_template/api/enter.go.tpl: -------------------------------------------------------------------------------- 1 | package api 2 | 3 | type ApiGroup struct { 4 | {{ .PlugName}}Api 5 | } 6 | 7 | var ApiGroupApp = new(ApiGroup) 8 | -------------------------------------------------------------------------------- /server/resource/plug_template/router/enter.go.tpl: -------------------------------------------------------------------------------- 1 | package router 2 | 3 | type RouterGroup struct { 4 | {{ .PlugName}}Router 5 | } 6 | 7 | var RouterGroupApp = new(RouterGroup) 8 | -------------------------------------------------------------------------------- /server/plugin/email/global/gloabl.go: -------------------------------------------------------------------------------- 1 | package global 2 | 3 | import "github.com/flipped-aurora/gin-vue-admin/server/plugin/email/config" 4 | 5 | var GlobalConfig = new(config.Email) 6 | -------------------------------------------------------------------------------- /server/resource/plug_template/service/enter.go.tpl: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | type ServiceGroup struct { 4 | {{ .PlugName}}Service 5 | } 6 | 7 | var ServiceGroupApp = new(ServiceGroup) 8 | -------------------------------------------------------------------------------- /web/.env.production: -------------------------------------------------------------------------------- 1 | ENV = 'production' 2 | 3 | VITE_CLI_PORT = 8080 4 | VITE_SERVER_PORT = 8888 5 | VITE_BASE_API = /api 6 | VITE_FILE_API = /api 7 | #下方修改为你的线上ip 8 | VITE_BASE_PATH = https://demo.gin-vue-admin.com 9 | -------------------------------------------------------------------------------- /web/src/utils/btnAuth.js: -------------------------------------------------------------------------------- 1 | import { useRoute } from 'vue-router' 2 | import { reactive } from 'vue' 3 | export const useBtnAuth = () => { 4 | const route = useRoute() 5 | return route.meta.btns || reactive({}) 6 | } 7 | -------------------------------------------------------------------------------- /server/model/system/response/sys_system.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | import "github.com/flipped-aurora/gin-vue-admin/server/config" 4 | 5 | type SysConfigResponse struct { 6 | Config config.Server `json:"config"` 7 | } 8 | -------------------------------------------------------------------------------- /server/plugin/email/model/response/email.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | type Email struct { 4 | To string `json:"to"` // 邮件发送给谁 5 | Subject string `json:"subject"` // 邮件标题 6 | Body string `json:"body"` // 邮件内容 7 | } 8 | -------------------------------------------------------------------------------- /server/utils/ast/ast_auto_enter_test.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import "testing" 4 | 5 | func TestImportForAutoEnter(t *testing.T) { 6 | ImportForAutoEnter("D:\\gin-vue-admin\\server\\api\\v1\\test\\enter.go", "ApiGroup", "test") 7 | } 8 | -------------------------------------------------------------------------------- /server/model/system/request/sys_authority_btn.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | type SysAuthorityBtnReq struct { 4 | MenuID uint `json:"menuID"` 5 | AuthorityId uint `json:"authorityId"` 6 | Selected []uint `json:"selected"` 7 | } 8 | -------------------------------------------------------------------------------- /server/model/system/sys_system.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "github.com/flipped-aurora/gin-vue-admin/server/config" 5 | ) 6 | 7 | // 配置文件结构体 8 | type System struct { 9 | Config config.Server `json:"config"` 10 | } 11 | -------------------------------------------------------------------------------- /web/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "./", 4 | "paths": { 5 | "@/*": ["src/*"], 6 | } 7 | }, 8 | "exclude": ["node_modules", "dist"], 9 | "include": ["src/**/*"] 10 | } -------------------------------------------------------------------------------- /server/model/example/response/exa_customer.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | import "github.com/flipped-aurora/gin-vue-admin/server/model/example" 4 | 5 | type ExaCustomerResponse struct { 6 | Customer example.ExaCustomer `json:"customer"` 7 | } 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Document 4 | url: https://www.gin-vue-admin.com 5 | about: If you have any questions about the use, you can check our official documents first 6 | -------------------------------------------------------------------------------- /server/resource/plug_template/global/global.go.tpl: -------------------------------------------------------------------------------- 1 | package global 2 | 3 | {{- if .HasGlobal }} 4 | 5 | import "github.com/flipped-aurora/gin-vue-admin/server/plugin/{{ .Snake}}/config" 6 | 7 | var GlobalConfig = new(config.{{ .PlugName}}) 8 | {{ end -}} -------------------------------------------------------------------------------- /server/model/example/response/exa_file_upload_download.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | import "github.com/flipped-aurora/gin-vue-admin/server/model/example" 4 | 5 | type ExaFileResponse struct { 6 | File example.ExaFileUploadAndDownload `json:"file"` 7 | } 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /server/model/system/response/sys_casbin.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | import ( 4 | "github.com/flipped-aurora/gin-vue-admin/server/model/system/request" 5 | ) 6 | 7 | type PolicyPathResponse struct { 8 | Paths []request.CasbinInfo `json:"paths"` 9 | } 10 | -------------------------------------------------------------------------------- /server/model/system/sys_jwt_blacklist.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "github.com/flipped-aurora/gin-vue-admin/server/global" 5 | ) 6 | 7 | type JwtBlacklist struct { 8 | global.GVA_MODEL 9 | Jwt string `gorm:"type:text;comment:jwt"` 10 | } 11 | -------------------------------------------------------------------------------- /server/utils/ast/ast_rollback_test.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import "testing" 4 | 5 | func TestRollRouterBack(t *testing.T) { 6 | RollRouterBack("ttt", "Testttt") 7 | } 8 | 9 | func TestRollGormBack(t *testing.T) { 10 | RollGormBack("ttt", "Testttt") 11 | } 12 | -------------------------------------------------------------------------------- /server/utils/ast/ast_router_test.go: -------------------------------------------------------------------------------- 1 | package ast 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestAddRouterCode(t *testing.T) { 8 | AddRouterCode("D:\\gin-vue-admin\\server\\utils\\ast\\ast_router_test.go", "Routers", "testRouter", "GVAStruct") 9 | } 10 | -------------------------------------------------------------------------------- /server/config/oss_local.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type Local struct { 4 | Path string `mapstructure:"path" json:"path" yaml:"path"` // 本地文件访问路径 5 | StorePath string `mapstructure:"store-path" json:"store-path" yaml:"store-path"` // 本地文件存储路径 6 | } 7 | -------------------------------------------------------------------------------- /server/resource/plug_template/config/config.go.tpl: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | {{- if .HasGlobal }} 4 | type {{ .PlugName }} struct { 5 | {{- range .Global }} 6 | {{ .Key }} {{ .Type }} {{- if ne .Desc "" }} // {{ .Desc }} {{ end -}} 7 | {{- end }} 8 | } 9 | {{ end -}} -------------------------------------------------------------------------------- /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 | CaptchaLength int `json:"captchaLength"` 7 | OpenCaptcha bool `json:"openCaptcha"` 8 | } 9 | -------------------------------------------------------------------------------- /web/src/view/error/reload.vue: -------------------------------------------------------------------------------- 1 | 4 | 10 | 11 | 15 | -------------------------------------------------------------------------------- /server/core/internal/constant.go: -------------------------------------------------------------------------------- 1 | package internal 2 | 3 | const ( 4 | ConfigEnv = "GVA_CONFIG" 5 | ConfigDefaultFile = "config.yaml" 6 | ConfigTestFile = "config.test.yaml" 7 | ConfigDebugFile = "config.debug.yaml" 8 | ConfigReleaseFile = "config.release.yaml" 9 | ) 10 | -------------------------------------------------------------------------------- /server/resource/autocode_template/readme.txt.tpl: -------------------------------------------------------------------------------- 1 | 代码解压后把fe的api文件内容粘贴进前端api文件夹下并修改为自己想要的名字即可 2 | 3 | 后端代码解压后同理,放到自己想要的 mvc对应路径 并且到 initRouter中注册自动生成的路由 到registerTable中注册自动生成的model 4 | 5 | 项目github:"https://github.com/piexlmax/github.com/flipped-aurora/gin-vue-admin/server" 6 | 7 | 希望大家给个star多多鼓励 8 | -------------------------------------------------------------------------------- /server/resource/autocode_template/subcontract/data.go: -------------------------------------------------------------------------------- 1 | package subcontract 2 | 3 | import ( 4 | _ "embed" 5 | ) 6 | 7 | //go:embed api_enter.go.tpl 8 | var API []byte 9 | 10 | //go:embed router_enter.go.tpl 11 | var Router []byte 12 | 13 | //go:embed service_enter.go.tpl 14 | var Server []byte 15 | -------------------------------------------------------------------------------- /server/model/system/response/sys_api.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | import "github.com/flipped-aurora/gin-vue-admin/server/model/system" 4 | 5 | type SysAPIResponse struct { 6 | Api system.SysApi `json:"api"` 7 | } 8 | 9 | type SysAPIListResponse struct { 10 | Apis []system.SysApi `json:"apis"` 11 | } 12 | -------------------------------------------------------------------------------- /server/model/system/request/sys_chatgpt.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "github.com/flipped-aurora/gin-vue-admin/server/model/common/request" 5 | "github.com/flipped-aurora/gin-vue-admin/server/model/system" 6 | ) 7 | 8 | type ChatGptRequest struct { 9 | system.ChatGpt 10 | request.PageInfo 11 | } 12 | -------------------------------------------------------------------------------- /server/model/example/response/exa_breakpoint_continue.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | import "github.com/flipped-aurora/gin-vue-admin/server/model/example" 4 | 5 | type FilePathResponse struct { 6 | FilePath string `json:"filePath"` 7 | } 8 | 9 | type FileResponse struct { 10 | File example.ExaFile `json:"file"` 11 | } 12 | -------------------------------------------------------------------------------- /server/initialize/register_init.go: -------------------------------------------------------------------------------- 1 | package initialize 2 | 3 | import ( 4 | _ "github.com/flipped-aurora/gin-vue-admin/server/source/example" 5 | _ "github.com/flipped-aurora/gin-vue-admin/server/source/system" 6 | ) 7 | 8 | func init() { 9 | // do nothing,only import source package so that inits can be registered 10 | } 11 | -------------------------------------------------------------------------------- /server/model/system/request/sys_dictionary.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "github.com/flipped-aurora/gin-vue-admin/server/model/common/request" 5 | "github.com/flipped-aurora/gin-vue-admin/server/model/system" 6 | ) 7 | 8 | type SysDictionarySearch struct { 9 | system.SysDictionary 10 | request.PageInfo 11 | } 12 | -------------------------------------------------------------------------------- /server/model/system/sys_authority_btn.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | type SysAuthorityBtn struct { 4 | AuthorityId uint `gorm:"comment:角色ID"` 5 | SysMenuID uint `gorm:"comment:菜单ID"` 6 | SysBaseMenuBtnID uint `gorm:"comment:菜单按钮ID"` 7 | SysBaseMenuBtn SysBaseMenuBtn ` gorm:"comment:按钮详情"` 8 | } 9 | -------------------------------------------------------------------------------- /server/config/redis.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type Redis struct { 4 | DB int `mapstructure:"db" json:"db" yaml:"db"` // redis的哪个数据库 5 | Addr string `mapstructure:"addr" json:"addr" yaml:"addr"` // 服务器地址:端口 6 | Password string `mapstructure:"password" json:"password" yaml:"password"` // 密码 7 | } 8 | -------------------------------------------------------------------------------- /server/global/model.go: -------------------------------------------------------------------------------- 1 | package global 2 | 3 | import ( 4 | "time" 5 | 6 | "gorm.io/gorm" 7 | ) 8 | 9 | type GVA_MODEL struct { 10 | ID uint `gorm:"primarykey"` // 主键ID 11 | CreatedAt time.Time // 创建时间 12 | UpdatedAt time.Time // 更新时间 13 | DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` // 删除时间 14 | } 15 | -------------------------------------------------------------------------------- /web/src/utils/page.js: -------------------------------------------------------------------------------- 1 | import { fmtTitle } from '@/utils/fmtRouterTitle' 2 | import config from '@/core/config' 3 | export default function getPageTitle(pageTitle, route) { 4 | if (pageTitle) { 5 | const title = fmtTitle(pageTitle, route) 6 | return `${title} - ${config.appName}` 7 | } 8 | return `${config.appName}` 9 | } 10 | -------------------------------------------------------------------------------- /server/model/system/request/sys_operation_record.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "github.com/flipped-aurora/gin-vue-admin/server/model/common/request" 5 | "github.com/flipped-aurora/gin-vue-admin/server/model/system" 6 | ) 7 | 8 | type SysOperationRecordSearch struct { 9 | system.SysOperationRecord 10 | request.PageInfo 11 | } 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /server/model/system/request/sys_dictionary_detail.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "github.com/flipped-aurora/gin-vue-admin/server/model/common/request" 5 | "github.com/flipped-aurora/gin-vue-admin/server/model/system" 6 | ) 7 | 8 | type SysDictionaryDetailSearch struct { 9 | system.SysDictionaryDetail 10 | request.PageInfo 11 | } 12 | -------------------------------------------------------------------------------- /server/api/v1/enter.go: -------------------------------------------------------------------------------- 1 | package v1 2 | 3 | import ( 4 | "github.com/flipped-aurora/gin-vue-admin/server/api/v1/example" 5 | "github.com/flipped-aurora/gin-vue-admin/server/api/v1/system" 6 | ) 7 | 8 | type ApiGroup struct { 9 | SystemApiGroup system.ApiGroup 10 | ExampleApiGroup example.ApiGroup 11 | } 12 | 13 | var ApiGroupApp = new(ApiGroup) 14 | -------------------------------------------------------------------------------- /server/router/enter.go: -------------------------------------------------------------------------------- 1 | package router 2 | 3 | import ( 4 | "github.com/flipped-aurora/gin-vue-admin/server/router/example" 5 | "github.com/flipped-aurora/gin-vue-admin/server/router/system" 6 | ) 7 | 8 | type RouterGroup struct { 9 | System system.RouterGroup 10 | Example example.RouterGroup 11 | } 12 | 13 | var RouterGroupApp = new(RouterGroup) 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /server/config/gorm_sqlite.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "path/filepath" 5 | ) 6 | 7 | type Sqlite struct { 8 | GeneralDB `yaml:",inline" mapstructure:",squash"` 9 | } 10 | 11 | func (s *Sqlite) Dsn() string { 12 | return filepath.Join(s.Path, s.Dbname+".db") 13 | } 14 | 15 | func (s *Sqlite) GetLogMode() string { 16 | return s.LogMode 17 | } 18 | -------------------------------------------------------------------------------- /server/config/gorm_mysql.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type Mysql struct { 4 | GeneralDB `yaml:",inline" mapstructure:",squash"` 5 | } 6 | 7 | func (m *Mysql) Dsn() string { 8 | return m.Username + ":" + m.Password + "@tcp(" + m.Path + ":" + m.Port + ")/" + m.Dbname + "?" + m.Config 9 | } 10 | 11 | func (m *Mysql) GetLogMode() string { 12 | return m.LogMode 13 | } 14 | -------------------------------------------------------------------------------- /server/model/system/sys_menu_btn.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import "github.com/flipped-aurora/gin-vue-admin/server/global" 4 | 5 | type SysBaseMenuBtn struct { 6 | global.GVA_MODEL 7 | Name string `json:"name" gorm:"comment:按钮关键key"` 8 | Desc string `json:"desc" gorm:"按钮备注"` 9 | SysBaseMenuID uint `json:"sysBaseMenuID" gorm:"comment:菜单ID"` 10 | } 11 | -------------------------------------------------------------------------------- /server/router/system/enter.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | type RouterGroup struct { 4 | ApiRouter 5 | JwtRouter 6 | SysRouter 7 | BaseRouter 8 | InitRouter 9 | MenuRouter 10 | UserRouter 11 | CasbinRouter 12 | AutoCodeRouter 13 | AuthorityRouter 14 | DictionaryRouter 15 | OperationRecordRouter 16 | DictionaryDetailRouter 17 | AuthorityBtnRouter 18 | ChatGptRouter 19 | } 20 | -------------------------------------------------------------------------------- /server/config/gorm_oracle.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type Oracle struct { 4 | GeneralDB `yaml:",inline" mapstructure:",squash"` 5 | } 6 | 7 | func (m *Oracle) Dsn() string { 8 | return "oracle://" + m.Username + ":" + m.Password + "@" + m.Path + ":" + m.Port + "/" + m.Dbname + "?" + m.Config 9 | 10 | } 11 | 12 | func (m *Oracle) GetLogMode() string { 13 | return m.LogMode 14 | } 15 | -------------------------------------------------------------------------------- /server/service/enter.go: -------------------------------------------------------------------------------- 1 | package service 2 | 3 | import ( 4 | "github.com/flipped-aurora/gin-vue-admin/server/service/example" 5 | "github.com/flipped-aurora/gin-vue-admin/server/service/system" 6 | ) 7 | 8 | type ServiceGroup struct { 9 | SystemServiceGroup system.ServiceGroup 10 | ExampleServiceGroup example.ServiceGroup 11 | } 12 | 13 | var ServiceGroupApp = new(ServiceGroup) 14 | -------------------------------------------------------------------------------- /server/model/system/sys_user_authority.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | // SysUserAuthority 是 sysUser 和 sysAuthority 的连接表 4 | type SysUserAuthority struct { 5 | SysUserId uint `gorm:"column:sys_user_id"` 6 | SysAuthorityAuthorityId uint `gorm:"column:sys_authority_authority_id"` 7 | } 8 | 9 | func (s *SysUserAuthority) TableName() string { 10 | return "sys_user_authority" 11 | } 12 | -------------------------------------------------------------------------------- /server/utils/md5.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "crypto/md5" 5 | "encoding/hex" 6 | ) 7 | 8 | //@author: [piexlmax](https://github.com/piexlmax) 9 | //@function: MD5V 10 | //@description: md5加密 11 | //@param: str []byte 12 | //@return: string 13 | 14 | func MD5V(str []byte, b ...byte) string { 15 | h := md5.New() 16 | h.Write(str) 17 | return hex.EncodeToString(h.Sum(b)) 18 | } 19 | -------------------------------------------------------------------------------- /web/src/core/global.js: -------------------------------------------------------------------------------- 1 | import config from './config' 2 | 3 | // 统一导入el-icon图标 4 | import * as ElIconModules from '@element-plus/icons-vue' 5 | // 导入转换图标名称的函数 6 | 7 | export const register = (app) => { 8 | // 统一注册el-icon图标 9 | for (const iconName in ElIconModules) { 10 | app.component(iconName, ElIconModules[iconName]) 11 | } 12 | app.config.globalProperties.$GIN_VUE_ADMIN = config 13 | } 14 | -------------------------------------------------------------------------------- /web/.env.development: -------------------------------------------------------------------------------- 1 | ENV = 'development' 2 | VITE_CLI_PORT = 8080 3 | VITE_SERVER_PORT = 8888 4 | VITE_BASE_API = /api 5 | VITE_FILE_API = /api 6 | VITE_BASE_PATH = http://127.0.0.1 7 | VITE_EDITOR = vscode 8 | // VITE_EDITOR = webstorm 如果使用webstorm开发且要使用dom定位到代码行功能 请先自定添加 webstorm到环境变量 再将VITE_EDITOR值修改为webstorm 9 | // 如果使用docker-compose开发模式,设置为下面的地址或本机主机IP 10 | //VITE_BASE_PATH = http://177.7.0.12 11 | 12 | -------------------------------------------------------------------------------- /server/model/system/response/sys_menu.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | import "github.com/flipped-aurora/gin-vue-admin/server/model/system" 4 | 5 | type SysMenusResponse struct { 6 | Menus []system.SysMenu `json:"menus"` 7 | } 8 | 9 | type SysBaseMenusResponse struct { 10 | Menus []system.SysBaseMenu `json:"menus"` 11 | } 12 | 13 | type SysBaseMenuResponse struct { 14 | Menu system.SysBaseMenu `json:"menu"` 15 | } 16 | -------------------------------------------------------------------------------- /server/model/system/response/sys_user.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | import ( 4 | "github.com/flipped-aurora/gin-vue-admin/server/model/system" 5 | ) 6 | 7 | type SysUserResponse struct { 8 | User system.SysUser `json:"user"` 9 | } 10 | 11 | type LoginResponse struct { 12 | User system.SysUser `json:"user"` 13 | Token string `json:"token"` 14 | ExpiresAt int64 `json:"expiresAt"` 15 | } 16 | -------------------------------------------------------------------------------- /web/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: [ 4 | "./index.html", 5 | "./src/**/*.{vue,js,ts,jsx,tsx}", 6 | ], 7 | important: true, 8 | theme: { 9 | extend: { 10 | backgroundColor: { 11 | "main": "#F5F5F5", 12 | } 13 | }, 14 | }, 15 | plugins: [], 16 | corePlugins: { 17 | preflight: false 18 | } 19 | } 20 | 21 | -------------------------------------------------------------------------------- /web/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:16 2 | 3 | WORKDIR /gva_web/ 4 | COPY . . 5 | 6 | RUN yarn && yarn build 7 | 8 | FROM nginx:alpine 9 | LABEL MAINTAINER="SliverHorn@sliver_horn@qq.com" 10 | 11 | COPY .docker-compose/nginx/conf.d/my.conf /etc/nginx/conf.d/my.conf 12 | COPY --from=0 /gva_web/dist /usr/share/nginx/html 13 | RUN cat /etc/nginx/nginx.conf 14 | RUN cat /etc/nginx/conf.d/my.conf 15 | RUN ls -al /usr/share/nginx/html 16 | -------------------------------------------------------------------------------- /web/src/utils/fmtRouterTitle.js: -------------------------------------------------------------------------------- 1 | export const fmtTitle = (title, now) => { 2 | const reg = /\$\{(.+?)\}/ 3 | const reg_g = /\$\{(.+?)\}/g 4 | const result = title.match(reg_g) 5 | if (result) { 6 | result.forEach((item) => { 7 | const key = item.match(reg)[1] 8 | const value = now.params[key] || now.query[key] 9 | title = title.replace(item, value) 10 | }) 11 | } 12 | return title 13 | } 14 | -------------------------------------------------------------------------------- /server/api/v1/example/enter.go: -------------------------------------------------------------------------------- 1 | package example 2 | 3 | import "github.com/flipped-aurora/gin-vue-admin/server/service" 4 | 5 | type ApiGroup struct { 6 | CustomerApi 7 | FileUploadAndDownloadApi 8 | } 9 | 10 | var ( 11 | customerService = service.ServiceGroupApp.ExampleServiceGroup.CustomerService 12 | fileUploadAndDownloadService = service.ServiceGroupApp.ExampleServiceGroup.FileUploadAndDownloadService 13 | ) 14 | -------------------------------------------------------------------------------- /server/model/system/request/sys_auto_history.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import "github.com/flipped-aurora/gin-vue-admin/server/model/common/request" 4 | 5 | type SysAutoHistory struct { 6 | request.PageInfo 7 | } 8 | 9 | // GetById Find by id structure 10 | type RollBack struct { 11 | ID int `json:"id" form:"id"` // 主键ID 12 | DeleteTable bool `json:"deleteTable" form:"deleteTable"` // 是否删除表 13 | } 14 | -------------------------------------------------------------------------------- /server/model/system/response/sys_authority.go: -------------------------------------------------------------------------------- 1 | package response 2 | 3 | import "github.com/flipped-aurora/gin-vue-admin/server/model/system" 4 | 5 | type SysAuthorityResponse struct { 6 | Authority system.SysAuthority `json:"authority"` 7 | } 8 | 9 | type SysAuthorityCopyResponse struct { 10 | Authority system.SysAuthority `json:"authority"` 11 | OldAuthorityId uint `json:"oldAuthorityId"` // 旧角色ID 12 | } 13 | -------------------------------------------------------------------------------- /web/src/api/email.js: -------------------------------------------------------------------------------- 1 | import service from '@/utils/request' 2 | // @Tags email 3 | // @Summary 发送测试邮件 4 | // @Security ApiKeyAuth 5 | // @Produce application/json 6 | // @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}" 7 | // @Router /email/emailTest [post] 8 | export const emailTest = (data) => { 9 | return service({ 10 | url: '/email/emailTest', 11 | method: 'post', 12 | data 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /server/service/system/enter.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | type ServiceGroup struct { 4 | JwtService 5 | ApiService 6 | MenuService 7 | UserService 8 | CasbinService 9 | InitDBService 10 | AutoCodeService 11 | BaseMenuService 12 | AuthorityService 13 | DictionaryService 14 | SystemConfigService 15 | AutoCodeHistoryService 16 | OperationRecordService 17 | DictionaryDetailService 18 | AuthorityBtnService 19 | ChatGptService 20 | } 21 | -------------------------------------------------------------------------------- /server/model/system/request/sys_api.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "github.com/flipped-aurora/gin-vue-admin/server/model/common/request" 5 | "github.com/flipped-aurora/gin-vue-admin/server/model/system" 6 | ) 7 | 8 | // api分页条件查询及排序结构体 9 | type SearchApiParams struct { 10 | system.SysApi 11 | request.PageInfo 12 | OrderKey string `json:"orderKey"` // 排序 13 | Desc bool `json:"desc"` // 排序方式:升序false(默认)|降序true 14 | } 15 | -------------------------------------------------------------------------------- /server/model/system/request/jwt.go: -------------------------------------------------------------------------------- 1 | package request 2 | 3 | import ( 4 | "github.com/gofrs/uuid/v5" 5 | jwt "github.com/golang-jwt/jwt/v4" 6 | ) 7 | 8 | // Custom claims structure 9 | type CustomClaims struct { 10 | BaseClaims 11 | BufferTime int64 12 | jwt.RegisteredClaims 13 | } 14 | 15 | type BaseClaims struct { 16 | UUID uuid.UUID 17 | ID uint 18 | Username string 19 | NickName string 20 | AuthorityId uint 21 | } 22 | -------------------------------------------------------------------------------- /server/core/server_other.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | // +build !windows 3 | 4 | package core 5 | 6 | import ( 7 | "time" 8 | 9 | "github.com/fvbock/endless" 10 | "github.com/gin-gonic/gin" 11 | ) 12 | 13 | func initServer(address string, router *gin.Engine) server { 14 | s := endless.NewServer(address, router) 15 | s.ReadHeaderTimeout = 20 * time.Second 16 | s.WriteTimeout = 20 * time.Second 17 | s.MaxHeaderBytes = 1 << 20 18 | return s 19 | } 20 | -------------------------------------------------------------------------------- /web/src/api/github.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | 3 | const service = axios.create() 4 | 5 | export function Commits(page) { 6 | return service({ 7 | url: 'https://api.github.com/repos/flipped-aurora/gin-vue-admin/commits?page=' + page, 8 | method: 'get' 9 | }) 10 | } 11 | 12 | export function Members() { 13 | return service({ 14 | url: 'https://api.github.com/orgs/FLIPPED-AURORA/members', 15 | method: 'get' 16 | }) 17 | } 18 | -------------------------------------------------------------------------------- /web/src/api/jwt.js: -------------------------------------------------------------------------------- 1 | import service from '@/utils/request' 2 | // @Tags jwt 3 | // @Summary jwt加入黑名单 4 | // @Security ApiKeyAuth 5 | // @accept application/json 6 | // @Produce application/json 7 | // @Success 200 {string} string "{"success":true,"data":{},"msg":"拉黑成功"}" 8 | // @Router /jwt/jsonInBlacklist [post] 9 | export const jsonInBlacklist = () => { 10 | return service({ 11 | url: '/jwt/jsonInBlacklist', 12 | method: 'post' 13 | }) 14 | } 15 | -------------------------------------------------------------------------------- /server/config/gorm_mssql.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type Mssql struct { 4 | GeneralDB `yaml:",inline" mapstructure:",squash"` 5 | } 6 | //dsn := "sqlserver://gorm:LoremIpsum86@localhost:9930?database=gorm" 7 | func (m *Mssql) Dsn() string { 8 | return "sqlserver://" + m.Username + ":" + m.Password + "@" + m.Path + ":" + m.Port + "?database=" + m.Dbname + "&encrypt=disable" 9 | } 10 | 11 | func (m *Mssql) GetLogMode() string { 12 | return m.LogMode 13 | } 14 | -------------------------------------------------------------------------------- /server/router/system/sys_jwt.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1" 5 | "github.com/gin-gonic/gin" 6 | ) 7 | 8 | type JwtRouter struct{} 9 | 10 | func (s *JwtRouter) InitJwtRouter(Router *gin.RouterGroup) { 11 | jwtRouter := Router.Group("jwt") 12 | jwtApi := v1.ApiGroupApp.SystemApiGroup.JwtApi 13 | { 14 | jwtRouter.POST("jsonInBlacklist", jwtApi.JsonInBlacklist) // jwt加入黑名单 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /deploy/kubernetes/web/gva-web-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.k8s.io/v1 2 | kind: Ingress 3 | metadata: 4 | name: gva-ingress 5 | annotations: 6 | kubernetes.io/ingress.class: "nginx" 7 | spec: 8 | rules: 9 | - host: demo.gin-vue-admin.com 10 | http: 11 | paths: 12 | - path: / 13 | pathType: Prefix 14 | backend: 15 | service: 16 | name: gva-web 17 | port: 18 | number: 8080 -------------------------------------------------------------------------------- /server/config/jwt.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type JWT struct { 4 | SigningKey string `mapstructure:"signing-key" json:"signing-key" yaml:"signing-key"` // jwt签名 5 | ExpiresTime string `mapstructure:"expires-time" json:"expires-time" yaml:"expires-time"` // 过期时间 6 | BufferTime string `mapstructure:"buffer-time" json:"buffer-time" yaml:"buffer-time"` // 缓冲时间 7 | Issuer string `mapstructure:"issuer" json:"issuer" yaml:"issuer"` // 签发者 8 | } 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | /web/node_modules 3 | /web/dist 4 | 5 | .DS_Store 6 | 7 | # local env files 8 | .env.local 9 | .env.*.local 10 | 11 | # Log files 12 | npm-debug.log* 13 | yarn-debug.log* 14 | yarn-error.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | 25 | /server/log/ 26 | /server/gva 27 | /server/latest_log 28 | 29 | *.iml 30 | web/.pnpm-debug.log 31 | web/pnpm-lock.yaml 32 | -------------------------------------------------------------------------------- /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: 20 * time.Second, 18 | WriteTimeout: 20 * time.Second, 19 | MaxHeaderBytes: 1 << 20, 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /server/config/oss_huawei.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type HuaWeiObs struct { 4 | Path string `mapstructure:"path" json:"path" yaml:"path"` 5 | Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"` 6 | Endpoint string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint"` 7 | AccessKey string `mapstructure:"access-key" json:"access-key" yaml:"access-key"` 8 | SecretKey string `mapstructure:"secret-key" json:"secret-key" yaml:"secret-key"` 9 | } 10 | -------------------------------------------------------------------------------- /server/resource/plug_template/model/model.go.tpl: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | {{- if .HasRequest }} 4 | type Request struct { 5 | {{- range .Request }} 6 | {{ .Key }} {{ .Type }} {{- if ne .Desc "" }} // {{ .Desc }} {{ end -}} 7 | {{- end }} 8 | } 9 | {{ end -}} 10 | 11 | {{- if .HasResponse }} 12 | type Response struct { 13 | {{- range .Response }} 14 | {{ .Key }} {{ .Type }} {{- if ne .Desc "" }} // {{ .Desc }} {{ end -}} 15 | {{- end }} 16 | } 17 | {{ end -}} 18 | -------------------------------------------------------------------------------- /server/resource/plug_template/router/router.go.tpl: -------------------------------------------------------------------------------- 1 | package router 2 | 3 | import ( 4 | "github.com/flipped-aurora/gin-vue-admin/server/plugin/{{ .Snake}}/api" 5 | "github.com/gin-gonic/gin" 6 | ) 7 | 8 | type {{ .PlugName}}Router struct { 9 | } 10 | 11 | func (s *{{ .PlugName}}Router) Init{{ .PlugName}}Router(Router *gin.RouterGroup) { 12 | plugRouter := Router 13 | plugApi := api.ApiGroupApp.{{ .PlugName}}Api 14 | { 15 | plugRouter.POST("routerName", plugApi.ApiName) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /server/utils/hash.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "golang.org/x/crypto/bcrypt" 5 | ) 6 | 7 | // BcryptHash 使用 bcrypt 对密码进行加密 8 | func BcryptHash(password string) string { 9 | bytes, _ := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost) 10 | return string(bytes) 11 | } 12 | 13 | // BcryptCheck 对比明文密码和数据库的哈希值 14 | func BcryptCheck(password, hash string) bool { 15 | err := bcrypt.CompareHashAndPassword([]byte(hash), []byte(password)) 16 | return err == nil 17 | } 18 | -------------------------------------------------------------------------------- /web/src/view/systemTools/formCreate/index.vue: -------------------------------------------------------------------------------- 1 |