Compare commits

...
769 Commits
Author SHA1 Message Date
SliverHorn fba9ab0ae6 删除FindSysDictionary的校验 2020-11-09 21:24:23 +08:00
QM303176530 e18518b4d3 版本号更新 2020-11-08 14:47:04 +08:00
QM303176530 074a7145d2 Merge branches 'gva_gormv2_dev' and 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2020-11-08 14:42:47 +08:00
QM303176530 46372f0e6c Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev 2020-11-08 14:20:19 +08:00
QM303176530 1acd2e3238 前端代码优化 修改密码迁移至个人中心内部 2020-11-08 14:15:06 +08:00
SliverHorn a2e7827aa8 模板文件server/sevice层备注的规范化 2020-11-08 14:02:07 +08:00
SliverHorn ac71aafe83 service层注释规范化 2020-11-08 13:34:17 +08:00
SliverHorn 0b1cc913d9 service层注释规范化 2020-11-08 13:30:12 +08:00
QM303176530 84b967ae82 增强自动化代码使用体验 2020-11-08 13:01:28 +08:00
QM303176530 cf9002a377 自动化代码体验优化 2020-11-08 12:47:55 +08:00
songzhibin97 829fa4dac5 re 2020-11-08 11:08:02 +08:00
songzhibin97 5529d5f46d change2 2020-11-08 10:58:17 +08:00
songzhibin97 08e9c6b38a 优化auto 2020-11-08 07:52:15 +08:00
SliverHorn 5c94c73004 修改模板文件,规范化代码 2020-11-08 03:15:27 +08:00
SliverHorn 8ebb1fda77 修复中间件导包错误及代码优化,更新swagger文档 2020-11-08 02:54:14 +08:00
SliverHorn 96380bd031 server/api/v1层代码swagger备注错误修改及代码优化 2020-11-08 02:43:11 +08:00
SliverHorn c342e63e63 修复一些问题 2020-11-07 22:50:01 +08:00
SliverHorn 4fa43c232d Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2020-11-07 18:28:19 +08:00
SliverHorn d07cbc8783 修复bug 2020-11-07 18:28:04 +08:00
SliverHorn f7667ad3e1 修复bug 2020-11-07 18:24:07 +08:00
krank666 5fe66b7abc Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2020-11-07 18:22:32 +08:00
krank666 856c09c38d 个人中心优化 2020-11-07 18:22:26 +08:00
v_zhibsong b947f043ee change2 2020-11-07 18:03:23 +08:00
SliverHorn ebd515f057 add addAutoMoveFile 2020-11-07 17:32:58 +08:00
v_zhibsong 636faaf93b Update file_operations.go 2020-11-07 16:00:55 +08:00
v_zhibsong ed1c6c7a47 change filepath 2020-11-07 16:00:09 +08:00
v_zhibsong e4340641ad change filemove 2020-11-07 15:35:12 +08:00
SliverHorn 35738cfda8 add autoMoveFilePath 字段,修改utils的fileoperations.go-> file_operations.go 2020-11-07 15:09:11 +08:00
SliverHorn e749adaa10 修改初始化数据时的colume->column 2020-11-07 11:54:04 +08:00
SliverHorn 26a1a89d60 Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2020-11-07 11:38:41 +08:00
SliverHorn 2daa65f00d 修复错别单词colume -> column, 删除tag中多余的; 2020-11-07 11:38:36 +08:00
v_zhibsong d2579d390c add filemove
add filemove
2020-11-07 11:32:45 +08:00
SliverHorn 261e34a5c2 添加自动移动文件的boo; 2020-11-07 11:04:54 +08:00
SliverHorn b4bad21e35 修改v1/sys_menu.go的备注错误及代码优化 2020-11-07 10:40:00 +08:00
SliverHorn 699f53e8b2 修复配置文件设置 zap: show-line: true 没有打印文件及行号的bug 2020-11-07 09:07:57 +08:00
SliverHorn 820c9f733f 优化server/api/v1/exa_customer.go的代码及备注错误 2020-11-07 00:32:31 +08:00
SliverHorn 99bd217080 修改错误单词,新增从gin.Context获取用户id,uuid,authority_id的函数 2020-11-07 00:14:36 +08:00
SliverHorn c86c05f380 修改server/api/v1/sys_user.go的备注错误 2020-11-06 23:45:33 +08:00
pixel 544901bf45 Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev 2020-11-06 18:51:51 +08:00
pixel 8db0e2fb06 连接池最大链接数修改为100 2020-11-06 16:54:23 +08:00
pixel c5ed47192e 自动化代码中 批量删除功能增加未选择条目时提醒功能 2020-11-06 16:52:06 +08:00
klausY 3d56cb7eb2 修改scrollBar样式 2020-11-06 16:09:30 +08:00
pixel ada8818960 增加自动化生成表单功能,修改自动化生成文件的文件夹名称更加规范化,css样式调整。 2020-11-06 16:01:09 +08:00
pixel 2f97f4b979 自动填充API功能不再需要手动清理垃圾数据 2020-11-06 14:42:26 +08:00
pixel 0a4e81138a css增加悬浮效果 2020-11-05 17:25:10 +08:00
1319612909 c61350643a index css 2020-11-03 22:28:04 +08:00
1319612909 9f59275652 css 2020-11-05 10:03:01 +08:00
1319612909 1da644b96a css 2020-11-04 18:23:32 +08:00
1319612909 1de825ee43 css 2020-11-04 17:58:14 +08:00
1319612909 2e18f3f5e1 css aside 2020-11-04 11:55:23 +08:00
1319612909 653f73b989 更换ip 2020-11-03 18:12:23 +08:00
1319612909 9c5b9729d8 aside + header css 2020-11-03 18:05:44 +08:00
1319612909 6950e493f2 aside + header css 2020-11-03 18:04:59 +08:00
1319612909 286f0b74da css 整理 2020-11-02 21:59:13 +08:00
pixel a1191abc43 自动化代码不再记录日志 2020-11-02 11:19:29 +08:00
pixel 75799b81e8 Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2020-11-02 11:02:51 +08:00
pixel 511a187f49 当自动化代码报错时不下载 2020-11-02 11:02:25 +08:00
QM303176530 01ecfcdf8d Merge branches 'gva_gormv2_dev' and 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2020-11-01 19:58:29 +08:00
SliverHorn 14a55fcb83 修改断点续传的提交方式代码 2020-11-01 19:50:34 +08:00
奇淼(piexlmax 49c146b3dc Update README.md 2020-10-31 16:17:03 +08:00
QM303176530 e2c5988bea 修复自动化代码bug 2020-10-31 15:09:13 +08:00
QM303176530 3d2e9ef063 Merge branches 'develop' and 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into develop 2020-10-31 00:09:09 +08:00
QM303176530 28c7d178c4 模板按钮美化 2020-10-31 00:08:05 +08:00
QM303176530 024f461e94 date 错别字修复 2020-10-29 22:12:42 +08:00
QM303176530 a25823f5b5 修复minxs路径,调整前端结构 2020-10-29 22:08:21 +08:00
QM303176530 4d4d8e4955 修复mixins路径,调整目录结构 2020-10-29 22:08:08 +08:00
SliverHorn 7488db81c1 add err := and delete postgresql initdb 2020-10-29 22:13:24 +08:00
QM303176530 e8c6d388f2 自动化代码可以自动创建form,前端样式修复,前端mixin位置转移 2020-10-29 22:06:09 +08:00
pixel 10d8d7f28a 修改gorm.Model为自定义的全局global.GVA_MODEL 方便自定义基础参数 2020-10-29 11:23:34 +08:00
奇淼(piexlmax 986406a880 Merge pull request #261 from Enginebeck/develop
jwt.go: fix localStorage spell error
2020-10-27 14:53:23 +08:00
奇淼(piexlmax 2946c8ce34 Merge pull request #262 from Zh1Cheung/master
[fix] Unhandled error
2020-10-27 14:51:58 +08:00
奇淼(piexlmax fef12cb747 Merge pull request #257 from Junvary/own_dev
多了一个转义,后端跨域不生效
2020-10-26 21:22:40 +08:00
张子恒 4d8d4b77c1 Update jwt.go 2020-10-26 20:15:30 +08:00
SliverHorn 7cb172d60a rename data->date 2020-10-26 18:33:45 +08:00
SliverHorn 970b2d21a9 add server/api/v1/exa_breakpoint_continue.go error response message 2020-10-26 17:30:23 +08:00
SliverHorn f7804b627e add gva error message 2020-10-26 15:55:55 +08:00
pixel a7bb4a7ac4 Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev 2020-10-26 12:39:27 +08:00
pixel 06c67c1024 修改 注册接口地址 2020-10-26 12:37:20 +08:00
SliverHorn 03024f192a Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2020-10-26 11:33:28 +08:00
SliverHorn b1baccf0a5 update docker-compose related and update server/Dockerfile 2020-10-26 11:33:17 +08:00
pixel ad047f4c06 gorm 版本升级为 1.20.5 2020-10-26 11:22:40 +08:00
Beck Qin 6f589d7af9 jwt.go: fix localStorage spell error 2020-10-26 09:27:52 +08:00
SliverHorn eeaaa40259 add Makefile help information 2020-10-25 11:37:15 +08:00
QM303176530 45cc0aec93 版本号更新 2020-10-25 10:42:34 +08:00
QM303176530 0bd80ad900 Merge branches 'gva_gormv2_dev' and 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2020-10-25 10:36:53 +08:00
QM303176530 1214241dab 版本号更新发版 2020-10-25 10:36:23 +08:00
QM303176530 6a03008ac9 修改bat文件名 表达正确含义 2020-10-24 16:20:20 +08:00
奇淼(piexlmax cc215d6ad0 Update README.md 2020-10-23 21:14:19 +08:00
Junvary e28217e5ec Update cors.go
多了一个转义,后端跨域不生效
2020-10-23 16:08:50 +08:00
SliverHorn 0d8edbbb64 update initdb 2020-10-23 14:05:36 +08:00
SliverHorn 2baf392129 system add middleware, update markfile, add data 2020-10-23 13:57:41 +08:00
pixel d478246edc Merge branch 'master' of https://github.com/piexlmax/QMPlus into gva_gormv2_dev 2020-10-23 13:20:41 +08:00
SliverHorn ea375a026d add windows bat and change mysql password 2020-10-23 13:18:43 +08:00
奇淼(piexlmax 9101d5bdb8 Update README.md 2020-10-23 13:13:59 +08:00
SliverHorn 811df12524 Fix the error that windows cannot create soft connection 2020-10-23 11:04:29 +08:00
SliverHorn 3ee469aef3 add Makefile 2020-10-22 18:18:40 +08:00
SliverHorn 7b503337b1 add .gitignore ignore gva files, and optimization zap.go:Repair split file is windows error 2020-10-22 16:50:20 +08:00
SliverHorn dd65a4a716 Migrate the gva project to the cmd folder, delete other redundant database configurations, optimize the initialization method of viper, zap, and gorm 2020-10-22 16:28:51 +08:00
QM303176530 45f2bd4a15 删除注册页面 为注册接口修改为需要权限 防止业务漏洞 2020-10-18 12:49:18 +08:00
QM303176530 1848ceb8f7 删除注册页面 为注册接口修改为需要权限 防止业务漏洞 2020-10-18 12:26:34 +08:00
pixel 938c598cfb Merge branch 'master' of https://github.com/piexlmax/QMPlus into gva_gormv2_dev 2020-10-15 15:23:39 +08:00
pixel bea9ede941 为富文本编辑器增加标题 2020-10-15 15:20:53 +08:00
SliverHorn 6c4b217b1b repair config env error 2020-10-15 11:55:55 +08:00
奇淼(piexlmax f1de3e6b84 Update README-en.md 2020-10-13 17:37:59 +08:00
奇淼(piexlmax 6cc9a420bf Update README.md 2020-10-13 17:37:16 +08:00
SliverHorn 5b1eb546fd add ss.Dbname 2020-10-13 15:29:08 +08:00
SliverHorn 3c9d81756b 修改body字段类型为longtext 2020-10-12 13:23:45 +08:00
pixel 51b6c1086e 局部更新和自动打开文档 2020-10-12 12:06:00 +08:00
QM303176530 63012b31ac 暂时屏蔽前端自动打开页面功能 2020-10-11 16:18:56 +08:00
QM303176530 f5c6f95b27 修复warning 前端启动自动打开文档 2020-10-11 11:42:58 +08:00
QM303176530 b7fd730c5e Merge branch 'develop' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2020-10-11 11:04:56 +08:00
QM303176530 3df918ef00 Merge branches 'gva_gormv2_dev' and 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2020-10-11 11:04:37 +08:00
QM303176530 a200c2ebe0 更新版本号 2020-10-11 10:58:18 +08:00
QM303176530 a471bae727 修复多点登录拦截失效问题 2020-10-11 10:56:01 +08:00
QM303176530 9f73219c85 Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev 2020-10-11 10:53:27 +08:00
QM303176530 5a474585b5 修复添加子菜单不输入内容无法添加参数的问题 2020-10-11 10:53:01 +08:00
pixel c48048bd32 增加屏蔽loading功能 2020-10-10 13:33:48 +08:00
pixel 8fd8296c69 增加屏蔽loading功能 2020-10-10 13:33:33 +08:00
pixel 130910308d 增加系统信息轮询 2020-10-09 16:15:45 +08:00
奇淼(piexlmax 56cc369a77 Merge pull request #243 from ccfish86/develop_image_upload
图片上传压缩(前端)及示例
2020-10-09 13:36:38 +08:00
ccfish 8aee3b27af 图片上传压缩(前端)及示例 2020-10-09 13:22:28 +08:00
pixel 63edd741ba Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev 2020-10-09 10:48:27 +08:00
SliverHorn d7007eec59 修复用户不存在的时jwt可使用的问题 2020-10-07 11:14:27 +08:00
SliverHorn 277a732df0 优化oss的初始化方式 2020-10-07 11:02:37 +08:00
SliverHorn a4b15b4731 增加备注与调整一些细节 2020-10-06 15:00:13 +08:00
SliverHorn 07c6bbd7e1 优化docker-compose的配置文件 2020-10-06 12:00:13 +08:00
SliverHorn ad504a17e0 update server-handle.sh 2020-10-06 11:34:07 +08:00
SliverHorn d16ca6967f 优化配置文件的结构体,优化文件上传与下载功能,系统配置的前端展示更友好及其他的优化 2020-10-06 11:30:50 +08:00
SliverHorn 785fde0eaf delete sql and update docker-compose.yaml 2020-10-06 10:24:13 +08:00
Granty1 af761f7472 upgrade action's go version 2020-10-05 22:57:26 +08:00
Granty1 5235511041 front end: server state info 2020-10-05 22:47:40 +08:00
SliverHorn 272f6c7b39 添加os的Compiler的获取 2020-10-05 13:34:39 +08:00
SliverHorn 22bc9f43bd 完成获取服务器信息的功能接口 2020-10-05 13:09:55 +08:00
奇淼(piexlmax c2747590e0 Update README-en.md 2020-09-29 14:07:11 +08:00
奇淼(piexlmax 794f8a631c Update README.md 2020-09-29 14:03:54 +08:00
pixel 04c0071b83 Merge branch 'master' of https://github.com/piexlmax/QMPlus into gva_gormv2_dev
 Conflicts:
	server/gva/init_data/init_data.go
2020-09-28 15:03:23 +08:00
pixel e5de639757 增加版本号功能 2020-09-28 11:32:16 +08:00
SliverHorn 553980cf73 添加issues模板 2020-09-26 17:29:12 +08:00
SliverHorn ff7390f1e6 修复文件上传记录body太大导致的数据库报错 2020-09-25 16:37:15 +08:00
SliverHorn 4927f414f7 优化上传与下载文件示例的上传与删除的api层与service层代码 2020-09-25 13:23:31 +08:00
SliverHorn 329d3fc622 新增服务器参数工具文件,修改8000->8888,删除多余的依赖文件 2020-09-24 16:35:38 +08:00
奇淼(piexlmax 1b6d80dfe9 Merge pull request #228 from maplepie/master
默认使用兼容模式
2020-09-23 21:18:32 +08:00
奇淼(piexlmax dd45558e6a Update README-en.md 2020-09-23 21:07:30 +08:00
奇淼(piexlmax dc273edf3c Update README.md 2020-09-23 21:05:40 +08:00
SliverHorn 621069eee7 优化 优先级: 命令行 > 环境变量 > 默认值 功能 2020-09-23 19:04:24 +08:00
pixel a385d41cc3 Merge remote-tracking branch 'origin/master' 2020-09-23 11:29:30 +08:00
pixel 9e6414fcb1 根据gorm调整初始化数据 sys_data_authority_ids -> sys_data_authority_id 2020-09-23 11:29:05 +08:00
SliverHorn f6a3c65129 修改ErrorToEmail中间件的请求方式错误 2020-09-23 11:25:38 +08:00
SliverHorn d930a9e95a 对gorm生成的外键表多s问题作出兼容代码 2020-09-23 11:14:08 +08:00
SliverHorn 3dea48b54e 完善ErrorToEmail中间件 2020-09-23 11:07:50 +08:00
maplepie f1c00c6b20 默认使用兼容模式
默认使用兼容模式,避免扯皮。
2020-09-23 09:42:29 +08:00
SliverHorn 099ff42404 修复config的错误,调整记录日志中间件的获取用户id逻辑,优先从jwt里取,新增状态码不为200时发送邮件到指定邮箱功能 2020-09-22 18:45:24 +08:00
SliverHorn f8e1832172 新增postgresql的Host配置 2020-09-22 17:53:20 +08:00
QM303176530 9e19684d40 取消 xlsx类型返回 后续作为单独接口示例 修复前端配置文件form表单内容 2020-09-20 12:28:20 +08:00
QM303176530 56c226919e 取消 OkWithXlsx方法 后期会新增示例接口 此处不通用 2020-09-19 23:23:35 +08:00
QM303176530 c6d6180c3c Merge branches 'develop' and 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2020-09-19 23:20:06 +08:00
QM303176530 9265397f29 casbin修改性能优化 2020-09-19 23:19:18 +08:00
QM303176530 7aea8d71aa Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2020-09-19 22:55:51 +08:00
SliverHorn 40f8ab6101 更新docker-compose的脚本文件 2020-09-19 14:34:17 +08:00
奇淼(piexlmax d7f490a0e8 Merge pull request #219 from HuLuWang/master
cors.go: fix部分浏览器不支持*的格式
2020-09-19 10:37:43 +08:00
汪先森 01a5b859a9 global/response/response.go: add download xlsx method 2020-09-18 18:15:27 +08:00
汪先森 bafe18f6e1 cors.go: fix部分浏览器不支持*的格式 2020-09-18 17:38:14 +08:00
pixel cd310eac17 Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev 2020-09-18 15:41:44 +08:00
pixel cbdf1cd92e 取消comment后携带的'' 2020-09-18 15:41:26 +08:00
SliverHorn 759dd34c76 优化zap.go代码,修改dubg输出为info输出 2020-09-16 10:31:56 +08:00
pixel 3fbb2ab0ca 修复前端打包404的问题 2020-09-15 18:09:45 +08:00
pixel ad107aadf1 修复打包过后404的bug 2020-09-15 18:08:26 +08:00
pixel e6e0f1d5db Merge branch 'develop' of https://github.com/piexlmax/QMPlus into gva_gormv2_dev 2020-09-15 16:21:47 +08:00
pixel d3dfdace9f Merge branch 'master' of https://github.com/piexlmax/QMPlus into gva_gormv2_dev 2020-09-15 16:20:13 +08:00
SliverHorn 88abbc26d1 更新配置文件的统一化,并修改zap的level为info 2020-09-15 15:20:07 +08:00
pixel 095b2ff27e 重新整理readme结构 2020-09-15 15:11:53 +08:00
SliverHorn 28f03c3d7e 更新文档(docker-compose的部署说明,swag的安装方式,zap的使用与配置说明) 2020-09-15 11:42:34 +08:00
SliverHorn 3db0cedf7e 修改docker-compose的init.sql的COLLATE由utf8mb4_0900_ai_ci改为utf8mb4_unicode_ci 2020-09-15 10:33:50 +08:00
QM303176530 11fdd96352 修改前端用户信息修改位置,防止报错 2020-09-14 20:39:14 +08:00
pixel b6dfb393a1 替换开发者信息至官网内部链接 2020-09-14 13:38:10 +08:00
pixel 268af2e84e 替换开发者信息至官网内部链接 2020-09-14 13:37:31 +08:00
奇淼(piexlmax 225ef0fc8d Merge pull request #208 from maplepie/master
Update config.go
2020-09-12 21:36:23 +08:00
maplepie d382d15f78 Update config.go
支持自定义配置文件位置
2020-09-12 12:05:49 +08:00
pixel 0833c09e98 Merge branch 'develop' of https://github.com/piexlmax/QMPlus into gva_gormv2_dev 2020-09-11 17:27:05 +08:00
pixel 3e62007e6a Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev 2020-09-11 14:21:50 +08:00
pixel d5550bf99c gorm 版本修改 mysql驱动版本修改 2020-09-11 14:21:26 +08:00
SliverHorn 1bdf0cb2ea 更新文档 2020-09-11 11:58:47 +08:00
SliverHorn e3ccccd1f3 更新文档,优化docker-compose的网络自定义 2020-09-11 11:43:17 +08:00
SliverHorn ecfc8cd1e7 更新文档 2020-09-10 19:25:20 +08:00
SliverHorn ba0bcefec4 优化docker-compose的前端项目不依赖于Gin,使用nginx 2020-09-10 19:15:44 +08:00
SliverHorn 93d1fdae31 gorm降回v0.2.35 2020-09-10 11:04:11 +08:00
SliverHorn 35d0ab10a9 Merge pull request #204 from maplepie/master
优化图标列表代码
2020-09-09 18:36:02 +08:00
maplepie d9db6c1b36 Update index.vue
优化代码
2020-09-09 18:23:58 +08:00
pixel 096fa511f4 Merge branch 'develop' of https://github.com/piexlmax/QMPlus into gva_gormv2_dev 2020-09-09 16:17:43 +08:00
pixel df69c96bd3 默认readme修改为中文 2020-09-09 16:17:26 +08:00
pixel 9b40ea5913 默认readme修改为中文 2020-09-09 16:03:36 +08:00
pixel c9b484bec2 取消头像地址配置 2020-09-09 16:01:28 +08:00
SliverHorn c6700a72bc 适配了Gorm的v1.20.0版本,迁移初始表的注册函数至gorm.go并优化了代码,注释了sqlite的初始化,需要的自行打开注释,默认使用mysql 2020-09-09 14:48:33 +08:00
pixel 630300cf37 修改email基础配置数据 2020-09-08 17:00:14 +08:00
奇淼(piexlmax fd0f741a01 Merge pull request #201 from maplepie/master
增加邮件发送功能
2020-09-08 16:16:48 +08:00
maplepie 6631aa35db add email module 2020-09-08 15:57:46 +08:00
SliverHorn e9ef8f7882 完成GORM的支持四个数据库的配置 2020-09-07 18:17:27 +08:00
pixel be9c85ae42 删除无用函数,整洁结构目录 2020-09-07 13:56:21 +08:00
pixel a8b01b6314 开启初始化配置 暂时修改为 配置文件控制 2020-09-07 13:18:02 +08:00
pixel 513259f65f 自动初始化单独建包 为 命令行做基础 2020-09-07 13:10:53 +08:00
pixel 11cde72962 Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev
# Conflicts:
#	server/go.mod
#	server/initialize/data.go
#	server/model/sys_base_menu.go
#	server/service/sys_db_initialize.go
2020-09-07 11:38:46 +08:00
pixel fb6dfcbd72 自动初始化单独建仓 为 命令行做基础 2020-09-07 11:33:28 +08:00
SliverHorn 734ff79890 更新docker-compose的server-handle.sh 2020-09-07 09:55:15 +08:00
QM303176530 2fdb014717 增加官方网站 2020-09-05 12:28:32 +08:00
QM303176530 377777e2c1 gormv2版本不再提供db初始化数据 2020-09-05 12:05:27 +08:00
SliverHorn e810a08c0e go-logging(停止维护了)替换成zap, zap的配置完善优化,gva的日志更换zap后的处理 2020-09-05 11:55:51 +08:00
QM303176530 14ea27749c 增加侧边栏配置其他网站功能(name以:http://开头或者https://开头即可) 2020-09-05 11:40:45 +08:00
SliverHorn 012f2569b1 zap日志的配置优化及初始化优化 2020-09-03 16:25:52 +08:00
SliverHorn 01c4206443 新增zap日志库的支持,并提供Recovery的中间件 2020-09-02 15:13:54 +08:00
SliverHorn a46859987e 修改docker-compose的mysql镜像源为官方的mysql,脚本和初始数据迁移到.docker-compose文件夹下,为docker-server添加ls -al方便使用docker-compose的时候调试错误 2020-09-02 10:50:57 +08:00
QM303176530 34bc072efd gormv2版本不再提供db初始化数据 2020-08-31 23:48:02 +08:00
QM303176530 d7813c3507 用户头像由上传模式改为 媒体库选择模式 2020-08-31 23:33:28 +08:00
QM303176530 0403ec3ffe 用户头像由上传模式改为 媒体库选择模式 2020-08-31 23:04:53 +08:00
QM303176530 f8cb44b51d 调整gorm2版本对应模板细节 2020-08-31 21:23:25 +08:00
pixel b31a8d34d6 清理无用方法FileCreateComplete 2020-08-31 18:05:40 +08:00
pixel 2c5a19fe8f errors.Is相关代码嵌套层级简化 2020-08-31 18:03:54 +08:00
SliverHorn 67ec569fc1 更新测试文档 2020-08-31 16:10:19 +08:00
SliverHorn ccdb695c06 更新文档,修复新增菜单的name重复问题,修复sys_user注册,删除更新记录与casb RBAC RESTFUL测试,多余数据的删除 2020-08-31 16:05:26 +08:00
pixel db0bddf1d4 取消对插件的支持 2020-08-31 15:29:08 +08:00
pixel c1dc629daf Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev
# Conflicts:
#	server/db/qmplus.sql
2020-08-31 15:27:41 +08:00
QM303176530 dd789b3991 Merge branches 'gva_gormv2_dev' and 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev
 Conflicts:
	server/core/install_plugs.go
	server/initialize/plug.go
	server/model/sys_authority.go
2020-08-29 21:30:55 +08:00
QM303176530 be8bac1ea1 取消插件模式 不再对插件提供支持 2020-08-29 21:26:45 +08:00
奇淼(piexlmax 602a64b879 Update FUNDING.yml 2020-08-29 21:23:22 +08:00
QM303176530 3a8ea28ea2 清理垃圾数据 默认七牛上传 2020-08-29 16:30:30 +08:00
QM303176530 39e7b641ea 清理垃圾数据 2020-08-29 16:30:09 +08:00
QM303176530 a104453aae Merge branches 'develop' and 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev
 Conflicts:
	server/db/qmplus.sql
	server/service/sys_menu.go
2020-08-29 16:29:24 +08:00
QM303176530 59af022125 默认使用七牛上传 2020-08-29 16:24:57 +08:00
QM303176530 e92df293d5 Merge branches 'develop' and 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-08-29 16:20:42 +08:00
QM303176530 4805879702 向gormv2过度 自定义类型长度使用size进行限制 2020-08-29 16:19:15 +08:00
QM303176530 f90d4745c1 视图 格式化 2020-08-29 16:15:44 +08:00
QM303176530 f53f8ddc65 增加mysql过滤,修改角色id长度 模板长度修改为size模式 2020-08-29 15:55:35 +08:00
QM303176530 6ec20fce3a 增加mysql过滤,修改角色id长度 2020-08-29 15:11:20 +08:00
pixel 88e7b46f32 防止自动建表失败 角色id主键长度限制为100 2020-08-27 12:56:14 +08:00
pixel f707f70f80 Merge branch 'develop' of https://github.com/piexlmax/QMPlus into gva_gormv2_dev
 Conflicts:
	server/db/qmplus.sql
	server/service/sys_menu.go
2020-08-27 11:19:03 +08:00
奇淼(piexlmax 16722ccd31 Merge pull request #189 from azunia/own_dev
修改了头像组件 增加了本地上传功能
2020-08-26 17:49:43 +08:00
azunia 7e1cfc6f09 可切换本地与七牛云上传,增加头像与图片组件 2020-08-26 17:26:03 +08:00
azunia d6fe1339b2 可切换本地与七牛云上传,增加头像与图片组建 2020-08-26 17:16:49 +08:00
SliverHorn aab91dec6c 更新测试文档及初始数据的错误,修复in条件查询, gormv2取消()的占位符,更新模板文件的()占位符 2020-08-26 13:46:03 +08:00
SliverHorn 40e2344629 api管理测试完成,修复casbin的API更新随动map[string]string改为map[string]interface{} 2020-08-26 11:23:40 +08:00
SliverHorn 8fb0df69b9 注释初始化函数,按需打开 2020-08-25 18:39:53 +08:00
SliverHorn 8a45a686a0 修复视图执行失败的bug 2020-08-25 18:39:10 +08:00
SliverHorn d4101f7f34 修复一些数据同步问题,更新文档,取消在配置文件读取值作为同步数据的标志,改为方法注释的方式 2020-08-25 18:17:33 +08:00
SliverHorn cf73dbd0d9 数据初始化完成 2020-08-25 16:34:45 +08:00
pixel 6c9f8b5eba Association相关问题修复 2020-08-25 14:41:28 +08:00
pixel 5a9247509a 修改 authority 关联删除的问题 2020-08-25 13:56:48 +08:00
QM303176530 98d5cab1d5 文档更新 2020-08-24 21:53:50 +08:00
SliverHorn 87ee4436ea 添加测试文档,Find替换为First方法 2020-08-24 15:54:21 +08:00
QM303176530 2bbb51c41e utf8->utf8mb4 2020-08-23 19:26:52 +08:00
QM303176530 7fca9c7ce0 gormv2升级 阶段2 2020-08-23 16:41:22 +08:00
QM303176530 aee6748c49 gormv2升级 阶段2 2020-08-23 16:29:26 +08:00
QM303176530 ee9b19bb0b gormv2升级 阶段2 2020-08-23 16:28:20 +08:00
QM303176530 f69b40a532 重大bug紧急修复,获取本角色菜单查询条件丢失! 2020-08-23 15:38:03 +08:00
QM303176530 48e6ac39e2 gormv2升级 第一阶段 2020-08-23 15:27:00 +08:00
QM303176530 363ff3ba70 gormv2升级 第一阶段 2020-08-23 15:13:23 +08:00
QM303176530 f130aec168 断点续传添加事务回滚 2020-08-22 12:28:35 +08:00
pixel 10ea953bfd 修复中间件跨域问题 2020-08-20 12:01:52 +08:00
pixel 9f1504e88a 修复swag参数错误 2020-08-20 12:00:17 +08:00
pixel 0239f7b97c 增加令牌自动续期功能 2020-08-17 14:04:02 +08:00
QM303176530 9679616935 清理warning相关信息 2020-08-16 20:27:56 +08:00
QM303176530 2022a417ab 修复了tab右键相关操作的bug 2020-08-16 20:21:38 +08:00
QM303176530 980436807c 修复菜单参数导致tab栏点击切换出现错误的问题 2020-08-16 19:53:47 +08:00
QM303176530 fd74cc719d Merge remote-tracking branch 'origin/gin-vue-admin_v2_dev' into gin-vue-admin_v2_dev 2020-08-15 23:15:29 +08:00
QM303176530 d1502d2b7d 增加了断点续传插件版 保留原始版本供学习原理使用 2020-08-15 23:14:49 +08:00
SliverHorn a5558badf1 修复三首歌曲无法播放的问题 2020-08-15 17:45:20 +08:00
QM303176530 f99bfe2c84 增加菜单参数配置功能
移除视图中复杂sql更改为model映射模式
2020-08-11 23:41:47 +08:00
QM303176530 834a233d19 增加菜单参数配置功能
移除视图中复杂sql更改为model映射模式
2020-08-11 23:23:37 +08:00
SliverHorn 61fdaefe24 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-08-07 10:41:56 +08:00
SliverHorn cf217bde03 恢复web的前端production配置文件的v1代理,server的config.yaml以及core文件夹下的server.go文件恢复原样,新增两个命令行脚本自定义配置及文件变动,修改mysql的3306端口为13306 2020-08-07 10:41:21 +08:00
QM303176530 e6e99d0b52 修改sys_operation_records表的body字段和resp字段的属性为longtext 2020-08-06 22:03:26 +08:00
QM303176530 73d55910e5 Merge branches 'gin-vue-admin_v2_dev' and 'master' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-08-06 21:09:08 +08:00
SliverHorn f643abd549 README.md新增docker-compose的使用文档 2020-08-06 17:26:56 +08:00
rainyan fe40c28814 Update Readme 2020-08-06 16:50:00 +08:00
rainyan 5233bf2e5b Update Readme 2020-08-06 16:48:30 +08:00
rainyan 971dafbb8d update Readme 2020-08-06 16:47:39 +08:00
SliverHorn 8ae25dc264 新增docker-compose的支持,文档说明取消gopm,改用Go Modules主流的代理模式 2020-08-06 16:09:49 +08:00
rainyan a8524fa30f Update ReadMe 2020-08-05 22:29:28 +08:00
rainyan b9b3a30f75 Update ReadMe 2020-08-05 22:27:27 +08:00
rainyan d97b49c950 Update ReadMe 2020-08-05 22:26:32 +08:00
rainyan d303955747 Update ReadMe 2020-08-05 22:25:41 +08:00
蒋吉兆 211ba42fed Update README-zh_CN.md 2020-08-03 17:11:57 +08:00
蒋吉兆 f61f4d6b77 Update README.md 2020-08-03 17:08:58 +08:00
蒋吉兆 152ec2423c Update README.md 2020-08-03 16:56:35 +08:00
蒋吉兆 fee4af62c4 Merge pull request #170 from WangLeonard/pack-static-files
打包静态文件到二进制
2020-07-29 10:51:13 +08:00
Leonard Wang 2483581158 打包静态文件到二进制 2020-07-28 22:27:49 +08:00
pixel 9cb7ae871d Merge branch 'gin-vue-admin_v2_dev' of https://github.com/piexlmax/QMPlus into gin-vue-admin_v2_dev 2020-07-28 15:24:16 +08:00
pixel 06cbc9c3a3 消灭了小图标状态下Maximum的问题 2020-07-28 15:24:01 +08:00
QM303176530 fb0ac5356e Merge remote-tracking branch 'origin/gin-vue-admin_v2_dev' into gin-vue-admin_v2_dev 2020-07-26 20:35:18 +08:00
QM303176530 8dfdb21c36 添加指令:v-auth,根据当前角色来选择是否展示页面某些元素 2020-07-26 20:27:39 +08:00
klausY 60341e2881 版权标识细节调整 2020-07-21 11:18:02 +08:00
pixel d53fe1f32c Merge branches 'gin-vue-admin_v2_dev' and 'master' of https://github.com/piexlmax/QMPlus into gin-vue-admin_v2_dev 2020-07-20 18:05:28 +08:00
QM303176530 41c4b8f0a5 代码生成器支持直接使用字典
修复查询涉及sql关键字时sql语句报错问题
2020-07-18 14:39:03 +08:00
蒋吉兆 fbca3eaa7b Merge pull request #155 from SliverHorn/patch-1
Update sys_dictionary.go
2020-07-18 14:38:27 +08:00
QM303176530 de1d090c31 代码生成器支持直接使用字典
修复查询涉及sql关键字时sql语句报错问题
2020-07-18 14:27:03 +08:00
SliverHorn 6be75b61a8 Update sys_dictionary.go
添加``,解决mysql关键字冲突
2020-07-17 23:21:50 +08:00
pixel 0f7a6a548f 增加贡献者列表 修复系统设置mysqllog问题和创建用户最低6个字符限制 2020-07-17 16:07:59 +08:00
pixel 9a12fbf48c 增加详细教程 2020-07-16 18:16:11 +08:00
pixel 2f8c532713 增加开发步骤教学 2020-07-16 18:13:34 +08:00
pixel 6ddda9f77e Merge branches 'gin-vue-admin_v2_dev' and 'master' of https://github.com/piexlmax/QMPlus into gin-vue-admin_v2_dev 2020-07-15 10:57:43 +08:00
pixel 174a300172 修复 操作日志当结构不为json时的参数展示形式 2020-07-15 10:55:22 +08:00
QM303176530 7ca11b979a 更换在线预览地址 2020-07-11 01:34:07 +08:00
pixel a586375724 Merge branches 'gin-vue-admin_v2_dev' and 'master' of https://github.com/piexlmax/QMPlus into gin-vue-admin_v2_dev 2020-07-10 18:04:18 +08:00
pixel 4d9da856f7 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/piexlmax/QMPlus into gin-vue-admin_v2_dev 2020-07-10 18:03:41 +08:00
pixel cea3618e74 修改重复校验 2020-07-10 18:03:35 +08:00
蒋吉兆 aec64e4e79 Create FUNDING.yml 2020-07-10 16:23:32 +08:00
蒋吉兆 4adf2f1b04 Update README-zh_CN.md 2020-07-09 15:26:21 +08:00
蒋吉兆 eeb9f0aae6 Update README.md 2020-07-09 15:25:24 +08:00
蒋吉兆 cea8a12a37 Merge pull request #137 from xy6409068/develop
Update system.vue
2020-07-08 19:48:09 +08:00
安徽许彦祖 c2c8d4fa3b Update system.vue
修复端口号修改失败问题
2020-07-08 18:28:00 +08:00
安徽许彦祖 55cea812b5 Update system.vue
修复更改端口号时清零问题
2020-07-08 18:21:04 +08:00
pixel 555dd46296 Merge branches 'master' and 'operation-record' of https://github.com/piexlmax/QMPlus into operation-record 2020-07-08 16:59:24 +08:00
pixel 86ad612884 Merge branches 'develop' and 'operation-record' of https://github.com/piexlmax/QMPlus into operation-record 2020-07-08 11:24:12 +08:00
pixel df0312e60e 2020/07/08 数据库更新 数据库版本补丁 2020-07-08 11:23:21 +08:00
granty1 1a75f23615 Fixed bug: log will not appear in log file 2020-07-07 19:39:25 +08:00
pixel f8c0896775 数据库脚本替换 2020-07-07 17:40:49 +08:00
pixel 71ba8e7b55 删除测试代码 2020-07-07 16:49:59 +08:00
pixel 0e256bc912 增加状态码标签样式 2020-07-07 16:46:47 +08:00
pixel 943913b443 自动化代码增加 批量删除功能 2020-07-07 16:39:36 +08:00
pixel a7e2ef171f 更改日志功能样式 2020-07-07 15:41:40 +08:00
pixel 152946ac42 文档更新 2020-07-07 10:21:17 +08:00
pixel 35b507204c 修改查询table sql语句 兼容性 2020-07-07 10:02:20 +08:00
pixel 7a31de2960 menu鉴权模式代码书写重复 2020-07-07 09:41:54 +08:00
QM303176530 e27066d9ac 从数据库获取表结构直接生成代码 2020-07-05 22:07:22 +08:00
QM303176530 9068ca6ea7 数据库更新,从table构建代码模式更新 2020-07-05 16:48:26 +08:00
QM303176530 8f21a2158f Merge branch 'operation-record' of https://github.com/flipped-aurora/gin-vue-admin into operation-record
 Conflicts:
	server/router/sys_auto_code.go
2020-07-05 16:31:06 +08:00
QM303176530 fe7364b301 可从数据库获取字段 2020-07-05 16:29:45 +08:00
Granty1 783e355501 update method of operation record 2020-07-05 14:45:05 +08:00
QM303176530 9a582877ea 增加body列 2020-07-04 18:54:30 +08:00
granty1 537e7ced45 Add user id support for operation record. 2020-07-03 16:45:58 +08:00
蒋吉兆 ceeb00043a Update README-zh_CN.md 2020-07-02 21:54:01 +08:00
蒋吉兆 79c2d33a01 Update README.md 2020-07-02 21:53:31 +08:00
QM303176530 1c99c3a377 头部信息增加用户id 2020-07-02 15:24:02 +08:00
QM303176530 44c4b2764e 进行日志相关样式修改,删除无用接口 2020-07-02 15:06:20 +08:00
QM303176530 06976adb00 屏蔽七牛云相关配置 2020-07-02 15:05:31 +08:00
QM303176530 ec53501431 Merge branches 'master' and 'operation-record' of https://github.com/flipped-aurora/gin-vue-admin into operation-record
 Conflicts:
	server/config.yaml
2020-07-02 14:34:08 +08:00
蒋吉兆 92f82af3d2 Merge pull request #128 from JuwanXu/develop
非 Windows 操作系统使用endless启动服务
2020-07-02 14:06:33 +08:00
QM303176530 4153eb9435 屏蔽七牛云相关配置 2020-07-01 15:44:23 +08:00
蒋吉兆 ecab8cf918 Merge pull request #132 from jimmy201602/master
fix qiniu go mod bug
2020-07-01 15:45:32 +08:00
jimmy201602 46e0960c3a fix qiniu go mod bug 2020-07-01 14:56:43 +08:00
granty1 974b7c7b81 Add operation record, and the user ID is not well thought out how to parse~ 2020-06-30 13:55:43 +08:00
徐志伟 9a0c74e04c 修复Windows下编译endless失败问题 2020-06-30 12:43:21 +08:00
QM303176530 bd45ec083f 修正角色id为空的bug 2020-06-30 11:50:02 +08:00
granty1 ce013d31c2 add operation primary realization 2020-06-29 21:58:53 +08:00
Granty1 33340c2eb8 add base operation record code 2020-06-28 22:04:54 +08:00
QM303176530 7b1a87116c 增加字典提示 2020-06-28 21:36:30 +08:00
QM303176530 6adfab6d8a 增加示例注释 2020-06-28 21:29:07 +08:00
QM303176530 02df16d2f0 前端文件变化,数据库文件变更 2020-06-28 21:26:52 +08:00
QM303176530 30f1ee77e0 前端utils中封装了前端获取字典并缓存到内存的方法getDict 2020-06-28 21:23:06 +08:00
QM303176530 f6c951dd13 验证码配置参数修改进配置文件,前端角色id不再允许输入英文字符 2020-06-26 21:40:26 +08:00
QM303176530 9c40447071 修复客户管理示例文件的查询bug 2020-06-26 17:26:54 +08:00
徐志伟 990fd1f4f3 非Windows操作系统使用endless启动服务 2020-06-25 19:02:09 +08:00
徐志伟 a9961f1f19 update go.mod 2020-06-25 18:53:23 +08:00
徐志伟 413f4bca17 update go.mod 2020-06-25 18:52:07 +08:00
QM303176530 472e5039fb Merge branches 'develop', 'gin-vue-admin_v2_dev' and 'master' of https://github.com/flipped-aurora/gin-vue-admin into develop
 Conflicts:
	server/resource/template/te/model.go.tpl
2020-06-24 21:57:10 +08:00
QM303176530 fa3b53d1fd 增加字典管理 2020-06-24 21:53:54 +08:00
QM303176530 96bd856405 字典细节调整 2020-06-24 20:45:49 +08:00
QM303176530 08301fde62 增加字典管理功能 2020-06-24 20:41:36 +08:00
蒋吉兆 0e72e9f9f9 Merge pull request #127 from hansonyu183/fix-bug-and-new-feature
修复:AutoCode生成的表格不显示bool值
2020-06-23 18:38:44 +08:00
hansonyu183 666ad8c14e Merge branch 'fix-bug-and-new-feature' of github.com:hansonyu183/gin-vue-admin into fix-bug-and-new-feature 2020-06-22 22:41:47 +08:00
hansonyu183 3791e573d3 修复:AutoCode生成的表格不显示bool值
修复:多了个}
2020-06-22 22:39:38 +08:00
hansonyu183 fab3d5402f 修复:AutoCode生成的表格不显示bool值 2020-06-22 22:13:06 +08:00
蒋吉兆 f09c081b5d Update model.go.tpl
自动化代码bug修复
2020-06-21 13:00:28 +08:00
QM303176530 27e5c1786c 二维码模式更换 2020-06-20 16:38:33 +08:00
QM303176530 f54c6f2124 Merge branches 'develop' and 'master' of https://github.com/flipped-aurora/gin-vue-admin into develop 2020-06-20 15:47:32 +08:00
蒋吉兆 88aab4666d Merge pull request #125 from hansonyu183/fix-bug-and-new-feature
修复优化自动代码中对bool类型搜索字段的支持
2020-06-20 15:33:30 +08:00
hansonyu183 937239b7ba 修复优化自动代码中对bool类型搜索字段的支持 2020-06-20 13:01:08 +08:00
QM303176530 6411c5cb9c Merge branches 'gin-vue-admin_v2_dev' and 'plug' of https://github.com/flipped-aurora/gin-vue-admin into plug 2020-06-16 13:55:49 +08:00
QM303176530 052534210b 隐藏代码注入方式的插件模式 2020-06-16 13:54:54 +08:00
QM303176530 0da10baf19 修改数量查询方法 2020-06-16 13:54:07 +08:00
pixel 8853992c1a gvaplug 版本号更新 2020-06-12 17:01:47 +08:00
pixel 17d73b1262 插件功能修改 2020-06-12 16:43:47 +08:00
Granty1 561b20efe2 Add some log & remove useless func 2020-06-12 16:20:38 +08:00
QM303176530 8ec30ac3b7 插件功能更新 修改插件包的实现方案 2020-06-11 23:52:25 +08:00
QM303176530 98eb6bd796 Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin into plug 2020-06-11 23:13:28 +08:00
QM303176530 aa2d304682 屏蔽开发中的插件功能 2020-06-11 23:13:04 +08:00
蒋吉兆 738175a9d8 Update README-zh_CN.md 2020-06-11 22:16:21 +08:00
蒋吉兆 884c8a433e Update README.md 2020-06-11 22:15:56 +08:00
蒋吉兆 5f5e105c87 Update README-zh_CN.md 2020-06-11 18:03:18 +08:00
蒋吉兆 682d92e00b Update README.md 2020-06-11 16:06:17 +08:00
pixel 2d01841b9e Merge branches 'gin-vue-admin_v2_dev', 'master' and 'plug' of https://github.com/piexlmax/QMPlus into plug 2020-06-11 11:50:03 +08:00
Granty1 7e574cb525 Format project code & upgrade some dependence 2020-06-11 11:40:21 +08:00
pixel eca0a38678 增加表格注释 2020-06-11 09:39:44 +08:00
蒋吉兆 fe3256175d Merge pull request #117 from DaiZero/master
fix fullscreen bug
2020-06-09 04:43:44 -05:00
DZero e5fd2fa1a7 fix fullscreen bug
修复点击全屏后,按Esc键退出全屏,全屏按钮图标没有改变的问题
2020-06-09 14:38:01 +08:00
pixel c7ea8ccb7d 角色管理新增角色bug修复 2020-06-08 12:52:48 +08:00
pixel 3b18442e76 自动生成代码按钮列加宽 2020-06-07 15:31:09 +08:00
pixel 7ad73a09b3 按钮美化 2020-06-07 15:08:51 +08:00
pixel 2da199145d Merge branches 'develop' and 'plug' of https://github.com/piexlmax/QMPlus into plug 2020-06-07 15:07:10 +08:00
蒋吉兆 671e450a99 Merge pull request #111 from 957651480/master
数据表操作美化按钮
2020-06-07 02:06:45 -05:00
pixel fde276e159 增加自动创建搜索功能 增加搜索条件 增加数据库注释 增加插件功能(0.0.1版 请勿用于生产) 2020-06-07 14:56:37 +08:00
yangtaihua bb64ea839b 数据表操作按钮美化 2020-06-07 07:46:43 +08:00
pixel 8173ff6fc2 插件功能开发完整度 +1 2020-06-07 00:04:56 +08:00
QM303176530 c4a6b33f62 修复角色新增时携带信息问题 2020-06-01 21:02:32 +08:00
pixel db26f5b8f5 冗余代码修复 2020-06-01 17:43:02 +08:00
pixel 5d411c021e Merge branches 'gin-vue-admin_v2_dev' and 'master' of https://github.com/piexlmax/QMPlus into gin-vue-admin_v2_dev 2020-06-01 12:05:48 +08:00
pixel 1597eeacfc icon warning修复 2020-06-01 11:53:56 +08:00
pixel d94d7c4c29 上移 下载美化 2020-06-01 11:48:33 +08:00
pixel 3cd2ea25e5 Merge branches 'develop' and 'gin-vue-admin_v2_dev' of https://github.com/piexlmax/QMPlus into gin-vue-admin_v2_dev
 Conflicts:
	server/resource/template/te/model.go.tpl
2020-06-01 11:22:00 +08:00
pixel fb2794adde Merge remote-tracking branch 'origin/gin-vue-admin_v2_dev' into gin-vue-admin_v2_dev
# Conflicts:
#	server/resource/template/te/model.go.tpl
2020-06-01 11:18:45 +08:00
pixel 318f688259 Merge branch 'gin-vue-admin_v2_dev' of G:\QMPlus with conflicts. 2020-06-01 11:18:13 +08:00
蒋吉兆 e51e8aef73 Merge pull request #102 from WangLeonard/refactor-CreateTemp
重构CreateTemp
2020-05-31 22:13:03 -05:00
蒋吉兆 f237557b99 Update README.md 2020-05-30 15:32:21 +08:00
蒋吉兆 291c30cfed Update README-zh_CN.md 2020-05-30 15:18:24 +08:00
QM303176530 518bdba578 tag添加form 前端icon不存在的属性增加 2020-05-29 20:59:17 +08:00
pixel 5cb3d7bc86 全局样式bug修复 2020-05-28 22:16:41 +08:00
pixel 7b52618f53 增加路由搜索功能 左侧菜单栏增加图标 2020-05-28 22:08:26 +08:00
Leonard Wang a7141feff7 重构CreateTemp 2020-05-28 00:48:27 +08:00
pixel f2a0f9776d Merge branches 'gin-vue-admin_v2_dev' and 'master' of https://github.com/piexlmax/QMPlus into gin-vue-admin_v2_dev 2020-05-26 16:47:08 +08:00
蒋吉兆 9bfb5eba97 Merge pull request #100 from DaiZero/master
field列表添加上移和下移的功能
2020-05-25 22:43:56 -05:00
Grant 0de756512f Merge pull request #67 from flipped-aurora/action-ci
Add code build test
2020-05-26 10:11:58 +08:00
Granty1 68296e6f4f Delete backend_deploy.yml 2020-05-26 10:07:15 +08:00
Granty1 3d9837b7e3 Remove deploy script & reset config file 2020-05-26 10:05:04 +08:00
Granty1 6c991962fc Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin into action-ci 2020-05-26 10:02:16 +08:00
DZero 75432c45ba field列表添加上移和下移的功能 2020-05-26 08:37:40 +08:00
klausY c96a7732b4 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-25 16:55:38 +08:00
klausY 8c5ae61a13 顶部搜索功能添加及生成代码功能去重校验 2020-05-25 16:55:27 +08:00
QM303176530 af3b6919be system组件修复 2020-05-22 22:08:19 +08:00
klausY ad4562b026 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-22 17:34:42 +08:00
jinlan.du 0f7cb13821 添加全屏切换 2020-05-22 16:36:22 +08:00
pixel 8186d9ef3a 左侧菜单优化 2020-05-21 17:22:07 +08:00
jinlan.du 625bd91b94 添加导航项目名称 2020-05-21 14:39:31 +08:00
jinlan.du 67fb113648 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-20 18:30:18 +08:00
jinlan.du c958853c14 表格css冲突修正 2020-05-20 18:30:10 +08:00
klausY 1d38214fe5 Merge branch 'gin-vue-admin_v2_dev' of
https://github.com/flipped-aurora/gin-vue-admin into
gin-vue-admin_v2_dev
2020-05-20 17:44:50 +08:00
klausY bcdc7b266a 上传图片跳转审核页面的问题修改 2020-05-20 17:44:43 +08:00
pixel 7544b9dcf6 Merge remote-tracking branch 'origin/gin-vue-admin_v2_dev' into gin-vue-admin_v2_dev 2020-05-20 16:11:42 +08:00
pixel dd699b1546 支持path添加参数 2020-05-20 16:11:19 +08:00
pixel cfb6f5038b 修改配置path灵活度 可增加路由参数 2020-05-20 16:01:48 +08:00
jinlan.du 927c8ab248 断点续传input隐藏 2020-05-20 15:11:12 +08:00
jinlan.du e63394a355 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-20 15:02:17 +08:00
蒋吉兆 1264272ff8 Merge pull request #92 from WangLeonard/fix-format-problems
Fix format problems
2020-05-20 00:53:34 -05:00
Leonard Wang b09e54c205 修复格式问题,重构嵌套层数过深的函数 2020-05-19 23:46:07 +08:00
Leonard Wang 5e2687a742 修复 go fmt 问题 2020-05-19 22:08:45 +08:00
jinlan.du 905ad0e2d2 表格折行优化 2020-05-18 14:53:30 +08:00
jinlan.du 56ff0c69cb 表格折行优化 2020-05-18 13:29:48 +08:00
jinlan.du 1110a3f7dc Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-18 10:43:26 +08:00
pixel f567ce80e6 仪表盘细节调整 2020-05-15 16:09:10 +08:00
pixel fa50c11a67 404不再全屏展示 方便退出和修改配置 2020-05-15 14:45:14 +08:00
jinlan.du e878d35b6f Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-15 13:39:10 +08:00
pixel dc27fe21b2 样式美化 2020-05-15 11:38:00 +08:00
pixel 00077b6b85 动画视觉效果优化 2020-05-15 10:40:02 +08:00
pixel 2cbd21635d 修复关闭右侧的bug 2020-05-15 10:34:19 +08:00
pixel cb51890c25 css样式美化 2020-05-15 10:19:52 +08:00
pixel 9d9404b3c5 修复表单生成器加载问题 2020-05-15 10:10:19 +08:00
1319612909 10a5390327 全局css 2020-05-14 21:54:00 +08:00
pixel d04acfd39b 修改掉线登出的时机 2020-05-14 17:37:49 +08:00
jinlan.du 865b66b3db Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-12 09:00:12 +08:00
sun_song_1203 73e31c6d23 modify register.vue 2020-05-11 21:44:10 +08:00
sun_song_1203 db9b3dce10 modify login.vue 2020-05-11 21:41:53 +08:00
pixel 7072d7e981 修改字段方便配置 2020-05-11 13:46:26 +08:00
QM303176530 95781e858d 前端icon细节优化 2020-05-10 21:40:48 +08:00
QM303176530 cec6f164fb 增加表格内icon 2020-05-10 21:32:10 +08:00
QM303176530 e58cf2544b Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-10 21:12:47 +08:00
QM303176530 b81ea1a22e 增加表格内icon 2020-05-10 21:12:37 +08:00
klausY 6ac8fe871b Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-10 20:09:29 +08:00
klausY 9c9f4d1244 编辑菜单-icon功能完善 2020-05-10 20:09:21 +08:00
QM303176530 07b030d9a8 修改文字说明错误 2020-05-10 19:17:29 +08:00
klausY efe539dbd2 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-10 17:24:04 +08:00
klausY 0306efb866 编辑菜单-icon功能完善 2020-05-10 17:23:52 +08:00
QM303176530 262c6b1594 增加验证规则复用 2020-05-10 16:55:42 +08:00
QM303176530 5e7570e557 增加验证规则复用 2020-05-10 16:34:21 +08:00
QM303176530 bf4344323d 增加验证规则复用 2020-05-10 16:21:00 +08:00
QM303176530 760a242118 Merge branches 'master' and 'verify' of https://github.com/flipped-aurora/gin-vue-admin into verify 2020-05-09 21:42:10 +08:00
pixel c059390538 增加后台表单校验工具以及添加校验 2020-05-09 17:53:32 +08:00
pixel 2756d2041c 增加校验工具以及后台校验拦截 2020-05-09 17:48:31 +08:00
klausY 8699d6f534 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-09 16:16:31 +08:00
klausY 625ca336e7 yx 2020-05-09 16:16:24 +08:00
蒋吉兆 e424421585 Update README-zh_CN.md 2020-05-08 23:27:56 +08:00
蒋吉兆 731e8ec609 Update README.md 2020-05-08 23:27:20 +08:00
QM303176530 235c2a75a8 表单校验工具封装以及使用 2020-05-08 23:17:20 +08:00
rainyan b95db1de3b Merge pull request #83 from flipped-aurora/gin-vue-admin_v2_dev
Add project layout to README.
2020-05-08 17:07:28 +08:00
rainyan 133b1c3bb7 Add project layout to README. 2020-05-08 17:03:57 +08:00
rainyan e3920f4ee9 Merge pull request #82 from flipped-aurora/gin-vue-admin_v2_dev
Fix some texts in README.md.
2020-05-08 17:02:07 +08:00
rainyan ef0c5f3b24 Fix some texts in README.md. 2020-05-08 17:01:21 +08:00
pixel 098705e48e 增加前端工程图 2020-05-08 16:26:23 +08:00
klausY f415428740 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-08 15:03:18 +08:00
klausY 717bc28b5d gengxin 2020-05-08 15:03:09 +08:00
pixel 828dc6cfe8 增加前端工程图 2020-05-08 09:45:43 +08:00
pixel 10b943c57c 删除地区编码数据 2020-05-07 17:49:50 +08:00
jinlan.du 9fe459afe1 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-07 15:25:31 +08:00
klausY 5fe8a85be3 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-07 15:04:04 +08:00
pixel 06c2e5639c 删除地区编码数据 2020-05-06 18:00:53 +08:00
pixel 462e396486 修复user API组的中间件未开放问题 2020-05-06 16:05:38 +08:00
pixel 7e9d32651b 修改了menu的查询次数 增强了菜单查询时的性能 2020-05-06 11:19:35 +08:00
klausY a58330c0ff Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-06 09:58:23 +08:00
klausY eb2361f9ac yx 2020-05-06 09:58:08 +08:00
QM303176530 b44c5f76e1 Merge remote-tracking branch 'origin/gin-vue-admin_v2_dev' into gin-vue-admin_v2_dev 2020-05-05 16:43:51 +08:00
QM303176530 890adbfa4e 修复api自动入库获取列表的分组不正确的bug 2020-05-05 16:43:33 +08:00
sun_song_1203 315e71e851 modify login.vue 2020-05-04 21:51:17 +08:00
sun_song_1203 a48910f696 modify login.vue and register.vue 2020-05-04 21:46:33 +08:00
QM303176530 5878ffe937 Merge branches 'gin-vue-admin_v2_dev' and 'master' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-03 21:57:20 +08:00
QM303176530 c20a266662 增加是否自动创建api入库的开关 可自动产生api入库 2020-05-03 21:55:49 +08:00
QM303176530 6d53a47b59 增加了自动添加api入库选项 修改了某些已知的bug 2020-05-03 21:55:14 +08:00
QM303176530 9510177350 增加是否自动创建api入库的开关 可自动产生api入库 2020-05-03 21:52:14 +08:00
蒋吉兆 ba1dd82988 Update README.md 2020-05-03 17:45:29 +08:00
蒋吉兆 cafc344def Update README-zh_CN.md 2020-05-03 17:43:33 +08:00
QM303176530 6ce439597b Merge branches 'gin-vue-admin_v2_dev' and 'master' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-03 17:25:02 +08:00
QM303176530 c731b87f90 登录验证码灰色 模板内容修改 2020-05-03 17:17:12 +08:00
rainyan 71c57ec382 Merge pull request #77 from flipped-aurora/gin-vue-admin_v2_dev
Gin vue admin v2 dev
2020-05-03 14:35:09 +08:00
rainyan 08e21621d7 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-05-03 14:31:53 +08:00
rainyan 8c605efdbe package.json更新 2020-05-03 14:31:38 +08:00
Granty1 a3110de71f Modify login logo and background svg 2020-05-02 21:32:27 +08:00
QM303176530 019e28fb13 修改模板默认绑定key 2020-05-02 20:06:37 +08:00
QM303176530 166d73b124 css 样式调节 2020-05-02 17:55:22 +08:00
QM303176530 215c955e19 自动化模板中注释废弃 2020-05-02 17:29:31 +08:00
QM303176530 0044f1da1f 登录界面美化 2020-05-02 16:26:24 +08:00
QM303176530 53de9c7511 Merge remote-tracking branch 'origin/gin-vue-admin_v2_dev' into gin-vue-admin_v2_dev 2020-05-02 16:11:31 +08:00
QM303176530 431e53cb45 角色权限自动切换保存 提示信息友好修改 2020-05-02 16:11:06 +08:00
Granty1 f9764fcebf Remove notify 2020-05-02 09:33:47 +08:00
Granty1 9290b3b68c Modify login page 2020-05-02 01:06:08 +08:00
QM303176530 bb42fc86eb 修复仪表盘横向拖动问题 2020-05-01 22:45:59 +08:00
QM303176530 5745afaea8 顶部页签右键bug修复 2020-05-01 18:20:02 +08:00
QM303176530 7dd0512e67 修复top栏样式问题 2020-05-01 18:10:45 +08:00
QM303176530 113d59fdf9 menu弹窗美化 2020-04-30 21:12:43 +08:00
pixel 3ae83b25ff Merge remote-tracking branch 'origin/gin-vue-admin_v2_dev' into gin-vue-admin_v2_dev 2020-04-30 20:49:56 +08:00
pixel 0468584851 列表布局修改 2020-04-30 20:49:31 +08:00
QM303176530 5bce3a1567 Merge remote-tracking branch 'origin/gin-vue-admin_v2_dev' into gin-vue-admin_v2_dev 2020-04-30 19:18:30 +08:00
QM303176530 4bf6371bee 代码生成器增加前端table.vue的自动生成 前端fd修改 2020-04-30 19:05:11 +08:00
klausY 36b07a3006 首页样式优化 2020-04-30 18:01:59 +08:00
pixel 29fe71b482 增加图标页 menu增加icon前缀 2020-04-30 17:53:18 +08:00
pixel 176362448a 标签页右键功能 2020-04-30 17:29:48 +08:00
pixel 0afed943a5 table模板修复 2020-04-30 11:34:11 +08:00
QM303176530 40a78d8228 代码生成器增加前端table.vue的自动生成 2020-04-30 00:00:24 +08:00
pixel 9185d573ab iconList 组件修复 2020-04-29 17:22:05 +08:00
pixel 9b2acbae11 Merge branches 'gin-vue-admin_v2_dev' and 'master' of https://github.com/piexlmax/QMPlus into gin-vue-admin_v2_dev 2020-04-29 17:16:35 +08:00
sun_song_1203 4b07123509 Modified iconList 2020-04-29 17:15:23 +08:00
sun_song_1203 b7a0a6ee08 add iconList 2020-04-29 15:56:06 +08:00
rainyan 666b79f584 Create CONTRIBUTING.md 2020-04-28 21:31:44 +08:00
Granty1 34faaf8c19 Spelling correction 2020-04-28 20:50:20 +08:00
rainyan af4f83d4cb Deploy server using Docker successfully. 2020-04-28 19:34:24 +08:00
rainyan 377241276c Merge pull request #74 from flipped-aurora/gin-vue-admin_v2_dev
Gin vue admin v2 dev
2020-04-28 00:17:46 +08:00
rainyan 1077e8e40f Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-28 00:16:39 +08:00
rainyan fee540735a Modify readme. 2020-04-28 00:16:07 +08:00
QM303176530 3d91c3768d 顶栏吸顶 侧边栏收起时不能正常显示的bug修复 2020-04-27 22:59:58 +08:00
QM303176530 b1fe359cd5 Merge branches 'gin-vue-admin_v2_dev' and 'master' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-27 22:16:14 +08:00
pixel c2454d998f 解决文件上传存在的bug 2020-04-27 18:11:12 +08:00
Granty1 8369584880 Update flipped-aurora.png 2020-04-27 12:17:31 +08:00
Granty1 2680da2873 Add style for org img 2020-04-26 22:16:18 +08:00
Granty1 0bd9a21318 Add some github information 2020-04-26 22:07:20 +08:00
rainyan ca7d06780f Merge pull request #72 from flipped-aurora/gin-vue-admin_v2_dev
Gin vue admin v2 dev
2020-04-26 16:31:03 +08:00
rainyan eba0f4f495 提交dockerfile 2020-04-26 16:15:44 +08:00
pixel 09e06dd278 Merge remote-tracking branch 'origin/gin-vue-admin_v2_dev' into gin-vue-admin_v2_dev 2020-04-26 11:50:05 +08:00
pixel 6ace32ee78 解决文件上传存在的bug 2020-04-26 11:48:40 +08:00
rainyan 6da7424fcd 分支说明更新
分支说明更新
2020-04-26 10:40:33 +08:00
rainyan 5e63794cbd translate to English
- master: 2.0 开发版代码,生产环境

- develop: 2.0 开发版代码,测试环境
2020-04-26 10:39:10 +08:00
Granty1 a815c1b599 Add 'enter' event for login & format login.vue 2020-04-26 10:13:50 +08:00
Granty1 de2f19ae50 Handle nil pointer dereference panic after db connect fail 2020-04-25 20:54:49 +08:00
Granty1 386a4d38b4 Fixed callback bug in front end file upload & move some constants to config.yaml 2020-04-25 10:14:17 +08:00
QM303176530 283830fc53 更新代码生成器 2020-04-24 21:20:44 +08:00
QM303176530 5375234c23 更新代码生成器 2020-04-24 21:17:49 +08:00
rainyan 784c8705b7 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-24 21:08:23 +08:00
rainyan 68a853b755 Dockerfile 2020-04-24 21:08:06 +08:00
Granty1 c65732d0e1 Remove action-ci branch in trigger list 2020-04-24 11:05:23 +08:00
Granty1 0533c6b01a Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into action-ci 2020-04-24 10:58:00 +08:00
pixel 2acbde21b8 更新中文版readme 2020-04-24 10:38:41 +08:00
pixel 3c87b3d449 更新中文版readme 2020-04-24 10:36:07 +08:00
pixel dcd0420892 数据库增加拷贝角色相关api和权限 2020-04-24 10:29:02 +08:00
pixel 03e14142e3 修复前端项目代码丢失,问题,修复角色拷贝功能 2020-04-24 10:23:40 +08:00
rainyan e0f2153172 Merge pull request #66 from flipped-aurora/gin-vue-admin_v2_dev
Gin vue admin v2 dev
2020-04-24 01:08:27 +08:00
rainyan ee6d5883b1 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-24 01:07:10 +08:00
rainyan 0f6bc8dc31 Modify dockerfile 2020-04-24 01:06:53 +08:00
sun_song_1203 26820458d1 modify authority.vue's listApi 2020-04-24 00:32:22 +08:00
sun_song_1203 3a3be3b23f 1. authority.js export const copyAuthority
2. authority.vue  add a method
2020-04-24 00:25:46 +08:00
rainyan 5834f19746 Merge pull request #65 from flipped-aurora/gin-vue-admin_v2_dev
Gin vue admin v2 dev
2020-04-23 23:23:45 +08:00
rainyan 8034ca5e13 Add Docker 2020-04-23 23:22:32 +08:00
pixel 4f94e846c9 修复total返回为0的bug 2020-04-23 17:23:16 +08:00
pixel 5305bf3680 Merge branches 'develop' and 'gin-vue-admin_v2_dev' of https://github.com/piexlmax/QMPlus into gin-vue-admin_v2_dev
 Conflicts:
	server/config.yaml
	server/service/sys_menu.go
2020-04-23 17:18:03 +08:00
蒋吉兆 aba79bb3d0 Merge pull request #62 from FWangZil/develop
README.md: fix text bug
2020-04-23 17:15:08 +08:00
klausY a2b12cf37a Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-22 15:53:18 +08:00
klausY 10ef49e4e8 首页新增播放器/ToDoList 2020-04-22 15:53:04 +08:00
pixel dd4563c9e4 修复total返回为0的bug 2020-04-22 15:40:07 +08:00
FWangZil 75352f45cd Merge pull request #2 from FWangZil/FWangZil-patch-2
README.md: fix text bug
2020-04-22 14:33:16 +08:00
FWangZil 25b5947587 README.md: fix text bug 2020-04-22 14:32:20 +08:00
pixel 2eab2a6a22 解决了登陆页面会请求一次 404的bug 2020-04-22 13:39:39 +08:00
QM303176530 78670f79af 修改config set时导致config.yamlkey改变的bug 2020-04-21 00:12:47 +08:00
pixel 0be0ec9a2f 增加角色复制后台功能 修复swagger不能带token的问题 2020-04-20 16:21:50 +08:00
jinlan.du a55d5e2f1a Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-20 13:26:53 +08:00
pixel eea245e405 Merge branch 'master' of https://github.com/piexlmax/QMPlus into gin-vue-admin_v2_dev 2020-04-20 12:11:03 +08:00
pixel 75035b9038 修复菜单展示下级只有一个隐藏菜单时候的交互错误 2020-04-20 12:10:50 +08:00
蒋吉兆 538c8ba0df Update README-zh_CN.md 2020-04-20 11:46:27 +08:00
蒋吉兆 e3aae896ad Update README.md 2020-04-20 11:44:07 +08:00
QM303176530 645d0fd842 修改api编辑保存时出现的bug 2020-04-19 12:28:53 +08:00
QM303176530 72f725bb4f 删除多余函数调用 2020-04-18 10:15:03 +08:00
QM303176530 992b8446cf 暂时隐藏音乐播放器 修改全局css 2020-04-17 23:31:08 +08:00
QM303176530 a766be61d8 还原dbname 2020-04-17 21:45:29 +08:00
klausY ff82bc47e6 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-17 18:11:04 +08:00
klausY 093cde16c2 首页美化 2020-04-17 18:10:54 +08:00
pixel 04536fe226 Merge remote-tracking branch 'origin/gin-vue-admin_v2_dev' into gin-vue-admin_v2_dev 2020-04-17 14:16:42 +08:00
pixel 832100f39d 菜单 角色选择更改为树形选择 2020-04-17 14:15:41 +08:00
jinlan.du 02bee9b6f2 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-17 13:20:18 +08:00
Granty1 a837638672 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-17 10:56:52 +08:00
pixel 569abbeb53 增加删除用户功能 修正一些细节bug 2020-04-16 20:16:19 +08:00
pixel 5698c207a1 form表单重置bug修复 2020-04-16 09:48:18 +08:00
pixel 57167b6c38 提供了keepalive支持 需要导入新的数据库表 2020-04-15 17:49:30 +08:00
pixel cd0b1e0336 menu和authority修改父级变为选择模式 2020-04-15 16:37:53 +08:00
pixel ea3f49d68a menu和authority修改父级变为选择模式 2020-04-15 16:37:17 +08:00
jinlan.du 91a3b5b3ce Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-15 10:47:03 +08:00
pixel 6a03835d66 swagger修复完成 2020-04-15 09:37:39 +08:00
pixel 2fbbde2581 恢复断点续传页面 2020-04-14 16:24:32 +08:00
jinlan.du 6b61abdf96 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-14 13:31:24 +08:00
jinlan.du f1c92e5b96 断点续传UI 2020-04-14 13:31:01 +08:00
rainyan 20156e2a34 英文注释 2020-04-13 22:30:40 +08:00
rainyan 8804ef6b67 中文版本号 2020-04-13 22:29:11 +08:00
rainyan 6ac385f45a Merge pull request #55 from rikugun/feature/docker-support
feat: 增加docker 支持
2020-04-13 20:37:04 +08:00
pixel be2bef5600 Merge branches 'gin-vue-admin_v2_dev' and 'master' of https://github.com/piexlmax/QMPlus into gin-vue-admin_v2_dev 2020-04-13 17:46:15 +08:00
pixel f68947d50e 修复了api唯一key关联的bug,修复了角色删除失败的bug 2020-04-13 17:45:33 +08:00
rikugun 1632c6361f Merge branch 'develop' into feature/docker-support 2020-04-13 14:37:27 +08:00
pixel 959aa9cd38 Merge remote-tracking branch 'origin/gin-vue-admin_v2_dev' into gin-vue-admin_v2_dev 2020-04-13 11:31:09 +08:00
rainyan 7b9f8f19c0 Merge pull request #58 from flipped-aurora/gin-vue-admin_v2_dev
README.md: fix head.
2020-04-13 11:30:01 +08:00
rainyan f1d225375f README.md: fix head. 2020-04-13 11:28:43 +08:00
rainyan 58ca2231e1 Merge pull request #57 from flipped-aurora/gin-vue-admin_v2_dev
README.md: add Contributing Guide.
2020-04-13 11:27:42 +08:00
rainyan f71bf74c48 README.md: add Contributing Guide.
README-zh_CN.md: add Contributing Guide.
2020-04-13 11:26:57 +08:00
rainyan 6003728944 Update README-zh_CN.md
可以参考用户管理模块中的示例API。
2020-04-13 10:51:22 +08:00
rainyan 001f7a2676 update README.md
You can see sample APIs in user management module.
2020-04-13 10:48:14 +08:00
pixel 2f0b39af3d 注释sqlite 防止gcc错误 需要使用自行打开注释即可 感谢 sqlitet提供者 [rikugun] 作者github: https://github.com/rikugun 2020-04-13 10:30:26 +08:00
rikugun 836e4aad86 Merge branch 'master' into feature/docker-support 2020-04-13 10:28:23 +08:00
rikugun ba46a6effd 默认使用mysql 数据库 2020-04-13 10:26:45 +08:00
rikugun 05cbc853f7 修改错误的修改使用试图查询菜单的问题 2020-04-13 10:25:21 +08:00
pixel c9bf4e6e72 修复首页404情况,sqlite数据库如果缺少gcc依赖请自行安装或注释sqlit相关功能 2020-04-13 09:50:04 +08:00
rikugun f5e29733e0 feat: 增加docker 支持 2020-04-12 21:58:20 +08:00
蒋吉兆 571df5a415 Update README-zh_CN.md 2020-04-12 16:54:32 +08:00
蒋吉兆 98455325cb Update README.md 2020-04-12 16:53:14 +08:00
QM303176530 dfa4ef100a 增加对sqlite数据库的支持 默认模式为mysql数据库 2020-04-12 13:44:11 +08:00
QM303176530 c6a8a47932 增加对sqlite数据库的支持 默认模式为mysql数据库 2020-04-12 13:34:29 +08:00
蒋吉兆 0ff3bdc64f 增加对sqlite数据库的支持
增加对sqlite数据库的支持
2020-04-12 13:33:56 +08:00
rikugun 71fd0eb9ad feat: 系统配置界面增加sqlite 配置 2020-04-12 11:39:16 +08:00
rikugun 47a45e2d67 feat: 增加sqlite 支持 2020-04-12 11:19:28 +08:00
rikugun 3ebbd7690f fix: 获取菜单失败的错误 2020-04-12 11:19:20 +08:00
rikugun 7c48de76c4 feat: 增加sqlite sql 脚本 2020-04-12 11:18:58 +08:00
rainyan ae3b3b3579 Merge pull request #52 from flipped-aurora/gin-vue-admin_v2_dev
Gin vue admin v2 dev
2020-04-10 16:17:38 +08:00
sun_song_1203 339490e20d Merge branch 'gin-vue-admin_v2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-10 14:32:14 +08:00
sun_song_1203 ed289aeb49 Modify No.12 of the file README.md 2020-04-10 14:17:52 +08:00
pixel 7b6eea6974 Merge branches 'gin-vue-admin_v2_dev' and 'master' of https://github.com/piexlmax/QMPlus into gin-vue-admin_v2_dev 2020-04-10 14:16:01 +08:00
pixel b35169ca20 提供restful示例 参考 customer 客户管理(资源示例)版块 涉及到权限变动 请更新数据库 sys_api和casbin表 2020-04-10 14:15:29 +08:00
pixel c11f6d428a 提供restful示例 参考 customer 客户管理(资源示例)版块 涉及到权限变动 请更新数据库 sys_api和casbin表 2020-04-10 13:49:58 +08:00
pixel da8a1c20b6 修改customer文件位restful模式 提供示例 2020-04-10 13:47:52 +08:00
rainyan 8a2f903576 Merge pull request #51 from flipped-aurora/gin-vue-admin_v2_dev
correct all comments of functions in service
2020-04-10 11:33:34 +08:00
rainyan 849f0dcf43 correct all comments of functions in service 2020-04-10 10:36:15 +08:00
Granty1 63e23ff367 Add path ignore for md file 2020-04-10 09:52:19 +08:00
Granty1 a2bef96512 Update build_test.yml 2020-04-10 09:48:53 +08:00
Granty1 d6fbe7c8de Format script 2020-04-10 09:47:22 +08:00
Granty1 b15fe4493e Modified some grammar problems 2020-04-10 09:45:23 +08:00
Granty1 013a44f480 Refine the ci script 2020-04-10 09:40:21 +08:00
rainyan d27b152a09 Merge pull request #50 from flipped-aurora/gin-vue-admin_v2_dev
add /web/dist to .gitignore
2020-04-10 09:28:26 +08:00
rainyan e0916eeb63 add /web/dist to .gitignore 2020-04-10 09:24:29 +08:00
Granty1 b5197b0013 Add build test ci script 2020-04-10 09:18:14 +08:00
Granty1 74201dfcd0 Add permission when move file 2020-04-09 21:50:18 +08:00
Granty1 641adca61f Refine ci script 2020-04-09 21:33:13 +08:00
QM303176530 ee24387a79 增加开发者模式 配置文件env 修改为develop就可跳过鉴权 2020-04-09 21:28:19 +08:00
蒋吉兆 b308c6e416 Update LICENSE 2020-04-09 21:13:19 +08:00
pixel 7993e878cc 默认验证码长度设置为4位 2020-04-09 17:41:13 +08:00
Granty1 5b753f2e72 Reduction the runner name 2020-04-09 17:39:21 +08:00
Granty1 26bba8ead8 Test self-runner label 2020-04-09 17:35:52 +08:00
Granty1 4399994b80 Format config file and ci script 2020-04-09 17:34:17 +08:00
Granty1 19548446e2 Remove useless command 2020-04-09 17:03:22 +08:00
Granty1 6bf46327bc Modify run script 2020-04-09 16:52:51 +08:00
Granty1 f683d89517 Test for env variables 2020-04-09 16:46:11 +08:00
Granty1 4d2c13d83a Test env variables in github action 2020-04-09 14:58:34 +08:00
Granty1 aabf7c0656 Add working-directory tag 2020-04-09 12:36:57 +08:00
Granty1 f93bd6020a Modify the sort of cd command 2020-04-09 12:22:31 +08:00
蒋吉兆 d2bc6ba615 Merge pull request #46 from xiaomiba0904/master
优化GetUserInfoList逻辑
2020-04-09 12:12:33 +08:00
pixel 6f3e3188b2 消除冗余代码 细节提示修复 2020-04-09 12:03:29 +08:00
Granty1 443922c7de Fixed error that can not use 'uses' and 'run' both 2020-04-09 11:50:43 +08:00
pixel 3a778ccdf1 修改编辑方法逻辑,前端细节调整 2020-04-09 11:49:15 +08:00
Granty1 a68628efbe Rename ci script 2020-04-09 11:48:11 +08:00
Granty1 ea9bd37fe8 Update go.yml 2020-04-09 11:37:15 +08:00
Granty1 f87ae7a2ea Update go.yml 2020-04-09 11:35:03 +08:00
Granty1 060961e312 Test ci 2020-04-09 11:15:03 +08:00
pixel 73a141d2b4 修復部分創建bug,數據庫api更新權限更改 2020-04-09 11:14:21 +08:00
pixel 0a832dfe24 修復部分創建bug,數據庫api更新權限更改 2020-04-09 11:09:52 +08:00
pixel d447913056 修復部分創建bug,數據庫api更新權限更改 2020-04-09 11:07:43 +08:00
xiaomibaghb 5586f1ddc3 优化GetUserInfoList逻辑 2020-04-09 10:39:25 +08:00
Granty1 cbe2e9a729 Create go.yml 2020-04-09 10:23:56 +08:00
QM303176530 5b29b661dc jwt异地登陆bug修复 2020-04-08 20:15:13 +08:00
Grant 71095f3e2e Merge pull request #45 from flipped-aurora/gin-vue-admin_v2_dev-restruct-service
Fixed bug that can not create jwt black record
2020-04-08 19:39:01 +08:00
Granty1 a9651d1ce4 Fixed bug that can not create jwt black record 2020-04-08 19:37:38 +08:00
pixel d198856633 统一分页回传结构体 2020-04-08 14:35:45 +08:00
pixel 1051db5d4c 统一分页回传结构体 2020-04-08 14:31:22 +08:00
Granty1 4277505c6a Unifies the output of the routing layer and the isolated response structure 2020-04-08 14:00:08 +08:00
Granty1 5d222585dd Migrate all methods in the model package to the service package 2020-04-08 11:07:27 +08:00
QM303176530 2c35adaffc 提出api中的model到单独model分组 修改dashboard 拼写错误 2020-04-07 22:26:00 +08:00
QM303176530 137db98ee4 Merge branches 'gin-vue-admin_v2_dev' and 'master' of https://github.com/piexlmax/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-07 21:56:33 +08:00
QM303176530 433bd0dd03 增加排序功能,修改错别字 dashbord->dashboard 需更新数据库中base_menu表中 所有的dashbord改为dashboard 2020-04-07 21:56:05 +08:00
QM303176530 604d6dcd42 增加排序功能,修改错别字 dashbord->dashboard 需更新数据库中base_menu表中 所有的dashbord改为dashboard 2020-04-07 21:54:02 +08:00
Granty1 38ccce5182 Update README.md 2020-04-07 18:54:47 +08:00
pixel 55d96245c2 order test 2020-04-07 18:02:29 +08:00
rainyan 13ead70368 Merge pull request #43 from flipped-aurora/gin-vue-admin_v2_dev
nick name mixed: krank666 granty1
2020-04-07 16:31:54 +08:00
rainyan 2d7cd2e61a nick name mixed: krank666 granty1 2020-04-07 16:30:16 +08:00
pixel 1e70d266ac Merge branches 'gin-vue-admin_v2_dev' and 'master' of https://github.com/piexlmax/QMPlus into gin-vue-admin_v2_dev
 Conflicts:
	README-zh_CN.md
2020-04-07 16:06:17 +08:00
pixel 688742aa42 add ercode 2020-04-07 16:03:53 +08:00
rainyan 3dcdd36d76 Delete donation QR code, add wechat QR code of all members. 2020-04-07 13:34:01 +08:00
rainyan de8557781e Show error fix 2020-04-07 10:20:00 +08:00
rainyan 5dac0b17b0 ##### (2)无法翻墙
##### (2)无法翻墙显示错误
2020-04-07 10:17:26 +08:00
rainyan 7318e0cfae Merge pull request #41 from piexlmax/gin-vue-admin_v2_dev
Gin vue admin v2 dev
2020-04-07 10:16:07 +08:00
rainyan 0401b2c00b Show error fix:in Line '#####(2)无法翻墙' 2020-04-07 10:13:27 +08:00
rainyan 1f2c77a49b Spelling fix: README.md ever->server, urtils->utils 2020-04-07 10:07:01 +08:00
rainyan 43994c7bfd Merge pull request #40 from piexlmax/gin-vue-admin_v2_dev
Spelling fix: erver->server, urtils->utils
2020-04-07 10:04:49 +08:00
rainyan 4332607f40 Spelling fix: erver->server, urtils->utils 2020-04-07 10:01:28 +08:00
Grant df76e190fb Merge pull request #39 from piexlmax/gin-vue-admin_v2_dev
Update .gitignore and readme
2020-04-07 08:00:32 +08:00
Granty1 8d24342a90 Update .gitignore and readme 2020-04-07 07:34:43 +08:00
QM303176530 12f90505b1 Merge branches 'gin-vue-admin_v2_dev' and 'master' of https://github.com/piexlmax/gin-vue-admin into gin-vue-admin_v2_dev
 Conflicts:
	QMPlusServer/db/jwt_blacklists.sql
	QMPlusServer/db/sys_base_menus.sql
	QMPlusServer/db/sys_menus.sql
	QMPlusServer/tpl/te/router.go.tpl
	README.md
	server/db/qmplus.sql
2020-04-07 00:18:15 +08:00
QM303176530 7da3980c78 bug:Menu SQL repair 2020-04-07 00:13:50 +08:00
QM303176530 11691cdd13 bug:Menu SQL repair 2020-04-07 00:12:22 +08:00
QM303176530 209db0c4c3 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/piexlmax/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-07 00:09:01 +08:00
QM303176530 f9c80aed27 bug:Menu SQL repair 2020-04-07 00:08:37 +08:00
rainyan e22af46d92 Delete: http://doc.henrongyi.top/, link 'Online Documentation' to http://doc.henrongyi.top/ 2020-04-06 23:39:22 +08:00
rainyan 8bd8b54993 modify: in -> Yin 2020-04-06 23:33:20 +08:00
rainyan 8bd1bf0b22 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/piexlmax/gin-vue-admin into gin-vue-admin_v2_dev
# Add version list to README.md
# Conflicts:
#	README-zh_CN.md
2020-04-06 23:22:43 +08:00
rainyan 44cd748ee4 Modify: speliing fix 2020-04-06 23:14:31 +08:00
QM303176530 90d371124e Modify:Add version list 2020-04-06 23:08:19 +08:00
QM303176530 1b47200a42 Modify:Modify Tencent video to be bilibilibili 2020-04-06 22:59:16 +08:00
rainyan 3996cb8e82 -- 拼写错误修改 2020-04-06 22:40:05 +08:00
rainyan 6373800be2 拼错修改 2020-04-06 22:25:42 +08:00
rainyan 9495215d07 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/piexlmax/gin-vue-admin into gin-vue-admin_v2_dev
# Conflicts:
#	README.md
2020-04-06 22:18:24 +08:00
rainyan a2a439c45a 新增英文注释,修改部分中文注释 2020-04-06 22:17:27 +08:00
QM303176530 bc00db8d1b 开放2.0测试入口 2020-04-06 15:02:00 +08:00
QM303176530 0e5b3e638a update:Teaching video update 2020-04-06 15:01:20 +08:00
QM303176530 fb45acc42b update:Teaching video update 2020-04-06 15:00:20 +08:00
QM303176530 f6e38d5cd1 更新文档视频 提供2.0测试版入口 2020-04-06 14:57:43 +08:00
QM303176530 002f6d4159 update:Teaching video update 2020-04-06 14:50:17 +08:00
QM303176530 29be427f5f update:Teaching video update 2020-04-06 14:49:09 +08:00
QM303176530 640e5feb6f Merge branch 'gin-vue-admin_v2_dev' of https://github.com/piexlmax/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-06 14:02:29 +08:00
QM303176530 2415cb26fa update:Repair code generator 2020-04-06 14:02:10 +08:00
蒋吉兆 478cce60c8 Update README.md 2020-04-06 14:01:48 +08:00
蒋吉兆 e6ea76e03e Update README.md 2020-04-06 14:00:31 +08:00
QM303176530 4b5a102cb5 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/piexlmax/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-06 13:52:46 +08:00
QM303176530 fbf4a33a31 update:Login failure refresh verification code 2020-04-06 13:52:18 +08:00
QM303176530 79254bd64c bug: the latest database table, modify the associated deletion method of menu and authority 2020-04-06 13:42:41 +08:00
QM303176530 2467522d30 Merge branches 'gin-vue-admin_v1_stable' and 'master' of https://github.com/piexlmax/gin-vue-admin into gin-vue-admin_v1_stable 2020-04-06 12:51:12 +08:00
QM303176530 733d062683 修改menu表排序字段为int 2020-04-06 12:50:34 +08:00
sun_song_1203 3a4b729b8e Merge branch 'gin-vue-admin_v2_dev' of https://github.com/piexlmax/gin-vue-admin into gin-vue-admin_v2_dev
# Conflicts:
#	README.md
2020-04-06 11:06:44 +08:00
sun_song_1203 b076ae5704 README文档规范化 2020-04-06 11:03:01 +08:00
rainyan f538e7b99a ReadMe.md开发者名称修改 2020-04-06 10:32:09 +08:00
Granty1 1e4daaba4e Remove useless notes 2020-04-06 08:40:36 +08:00
Granty1 9766f12016 Fixed bug that log soft link can not point to the correct log file 2020-04-06 08:39:33 +08:00
rainyan fddfdf44a1 更新README.md,部分错误注释修改 2020-04-06 02:40:08 +08:00
rainyan dc4ebc5851 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/piexlmax/gin-vue-admin into gin-vue-admin_v2_dev
# Conflicts:
#	server/model/sys_authority.go
#	server/model/sys_authority_menu.go
#	server/model/sys_base_menu.go
2020-04-06 00:47:46 +08:00
rainyan 13c30d4c55 方法添加注释,中文版注释 2020-04-05 22:23:17 +08:00
QM303176530 39f256b4b7 Merge branch 'gin-vue-admin_v2_dev' of https://github.com/piexlmax/gin-vue-admin into gin-vue-admin_v2_dev 2020-04-05 20:58:08 +08:00
QM303176530 63fe673169 bug: Fix bug in form reset 2020-04-05 20:57:11 +08:00
Granty1 9d99777b1f Refine db password 2020-04-05 20:36:54 +08:00
Granty1 7c52c05280 Migrating configuration files from json to yaml 2020-04-05 20:35:52 +08:00
QM303176530 81a54b5a44 update: menu relation transformation completed 2020-04-05 20:14:15 +08:00
QM303176530 c755120c8d update: The code structure is finished, and the project can run successfully 2020-04-05 16:19:34 +08:00
QM303176530 08ff55ffce update: The code structure is finished, and the project can run successfully 2020-04-05 16:18:19 +08:00
Granty1 1891c1bcbc Refine some structs and handle cycle import 2020-04-05 09:18:25 +08:00
QM303176530 6db275ca39 gin-vue-admin 2.0代码重构 2020-04-04 21:39:27 +08:00
QM303176530 1b9adea284 gin-vue-admin 2.0代码重构 2020-04-04 21:39:07 +08:00
pixel d1e0ab1db9 修复模板字符串多一个空格的bug 2020-04-03 14:38:18 +08:00
pixel 54bdc9b834 tab历史记录细节修复(刷新或重新登录的bug) 2020-04-03 13:35:10 +08:00
蒋吉兆 ffdd677d8f Merge pull request #37 from gpYang/master
登录失败后刷新验证码
2020-04-03 11:33:33 +08:00
gpYang a1583ad2a4 登录失败后刷新验证码
防止被暴力破解
2020-04-03 09:57:17 +08:00
QM303176530 5ed41ddd8c 增加总数据库sql和单表sql 此次拼写错误设计到 sys_api casbin两个表 2020-04-02 22:37:58 +08:00
QM303176530 f545048e60 拼写错误修改 updata->update regist->register 更新需更新数据库 建议更新数据库文件 数据库将单表数据录入 方便选择性更新 2020-04-02 22:31:48 +08:00
QM303176530 1c30ae1080 拼写错误修改 2020-04-02 22:12:05 +08:00
蒋吉兆 f32c1d93bb Merge pull request #36 from Ruio9244/gin-vue-admin-develop
updata->update,Updata->Update
2020-04-02 22:12:34 +08:00
rainyan 40ef40afa8 updata->update
Updata->Update
2020-04-02 20:35:19 +08:00
pixel abc88cdbe0 修复了api设置时候可以重复path的bug 2020-04-02 18:10:09 +08:00
gpYang 5810791099 登录失败刷新验证码
失败了需要刷新验证码,不然更容易暴力破解
2020-04-02 14:56:37 +08:00
pixel 507d4620ca 重新开放配置管理功能 2020-04-02 14:34:21 +08:00
pixel 29dee32b47 增加文档 调整readme 修复已知bug 2020-04-02 13:46:43 +08:00
pixel 825ffa2dcb 修复已知bug提升体验 2020-04-02 09:42:48 +08:00
pixel c08b8fdc49 修复已知bug 2020-04-01 17:04:13 +08:00
pixel 13295bb9e7 修复了一些已知的bug 2020-04-01 16:32:22 +08:00
pixel 1ea720093a 美化登陆页面 2020-04-01 16:19:43 +08:00
pixel c2e90af0c9 删除无用方法 2020-04-01 16:05:30 +08:00
pixel 11c3ff681a 四月一日更新日志 2020-04-01 16:02:07 +08:00
pixel 42bec5811c 增加历史页签功能 2020-04-01 15:56:39 +08:00
pixel 7f5504f840 增加api查询模式 修改后台查询方法示例 2020-04-01 11:53:49 +08:00
pixel aa145bc905 gin-vue-admin LOGO上传 2020-03-31 18:07:23 +08:00
413 changed files with 40526 additions and 26547 deletions
+26
View File
@@ -0,0 +1,26 @@
server {
listen 8080;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /usr/share/nginx/html;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
try_files $uri $uri/ /index.html;
}
location /api {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
rewrite ^/api/(.*)$ /$1 break; #重写
proxy_pass http://177.7.0.12:8888; # 设置代理服务器的协议和地址
}
location /api/swagger/index.html {
proxy_pass http://127.0.0.1:8888/swagger/index.html;
}
}
+85
View File
@@ -0,0 +1,85 @@
#! /bin/bash
rm -f ./config.yaml
# 生成config.yaml文件, 用于docker-compose的使用
touch ./config.yaml
filename="./config.yaml"
cat>"${filename}"<<EOF
# Gin-Vue-Admin Global Configuration
# jwt configuration
jwt:
signing-key: 'qmPlus'
# zap logger configuration
zap:
level: 'info'
format: 'console'
prefix: '[GIN-VUE-ADMIN]'
director: 'log'
link-name: 'latest_log'
show-line: true
encode-level: 'LowercaseColorLevelEncoder'
stacktrace-key: 'stacktrace'
log-in-console: true
# redis configuration
redis:
db: 0
addr: '177.7.0.14:6379'
password: ''
# email configuration
email:
to: 'xxx@qq.com'
port: 465
from: 'xxx@163.com'
host: 'smtp.163.com'
is-ssl: true
secret: 'xxx'
nickname: 'test'
# casbin configuration
casbin:
model-path: './resource/rbac_model.conf'
# system configuration
system:
env: 'public' # Change to "develop" to skip authentication for development mode
addr: 8888
db-type: 'mysql'
oss-type: 'local'
use-multipoint: false
# captcha configuration
captcha:
key-long: 6
img-width: 240
img-height: 80
# mysql connect configuration
mysql:
path: '177.7.0.13:3306'
config: 'charset=utf8mb4&parseTime=True&loc=Local'
db-name: 'qmPlus'
username: 'root'
password: 'Aa@6447985'
max-idle-conns: 10
max-open-conns: 10
log-mode: false
# local configuration
local:
path: 'uploads/file'
# qiniu configuration (请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址)
qiniu:
zone: 'ZoneHuadong'
bucket: 'qm-plus-img'
img-path: 'http://qmplusimg.henrongyi.top'
use-https: false
access-key: '25j8dYBZ2wuiy0yhwShytjZDTX662b8xiFguwxzZ'
secret-key: 'pgdbqEsf7ooZh7W3xokP833h3dZ_VecFXPDeG5JY'
use-cdn-domains: false
EOF
+119
View File
@@ -0,0 +1,119 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.pnp.*
**/node_modules
+12
View File
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: https://www.gin-vue-admin.com/docs/coffee
+70
View File
@@ -0,0 +1,70 @@
---
name: issues模板
about: 请严格按照要求进行提交issues! 如果未能按照要求,我们将会close您的issues,敬请谅解!
---
<!-- 在提交问题之前,请先回答这些问题。谢谢! -->
### 1. 您使用的是哪个版本的`Go`和系统类型/架构 ?
<!--
请从您的终端粘贴命令 `go version` 的输出。
期望看到像: `go version go1.14.4 darwin/amd64`
-->
### 2. 您使用的是哪个版本的 `Nodejs` 和 `npm` 或 `cnpm` ?
<!--
请从您的终端粘贴命令 `node -v` 的输出。
期望看到像: `v12.16.1`
-->
<!--
请从您的终端粘贴命令 `npm -v` 的输出。
期望看到像: `6.13.4`
-->
<!--
请从您的终端粘贴命令 `cnpm -v` 的输出。
期望看到的像: `
cnpm@6.1.1 (/usr/local/lib/node_modules/cnpm/lib/parse_argv.js)
npm@6.14.2 (/usr/local/lib/node_modules/cnpm/node_modules/npm/lib/npm.js)
node@12.16.1 (/usr/local/bin/node)
npminstall@3.27.0 (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/index.js)
prefix=/usr/local
darwin x64 19.6.0
registry=https://r.npm.taobao.org
`
-->
### 3. 您使用的是哪个版本的 `gin-vue-admin` ?
<!--
您如果克隆的是master就写master,
如果是在Releases中下载的zip/tar.gz对应的tag版本,
如:`v2.3.0`
-->
### 4. 可以在master版本中复现此问题吗 ?
### 5. 您做了什么 ?
<!--
如果可能,请提供最短代码的副本以重现该错误。
一个完整的可运行程序是最好的。
-->
### 6. 您期望看到什么 ?
### 7. 您看到了什么 ?
### 8. 错误堆栈或者SQL打印
+64
View File
@@ -0,0 +1,64 @@
name: gin-vue-admin build test
on:
push:
branches:
- "*"
paths-ignore:
- "./db/**"
- "**.md"
pull_request:
branches:
- "*"
paths-ignore:
- "./db/**"
- "**.md"
jobs:
frontend:
name: Frontend build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- name: Check out branch
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Build test
run: |
npm install
npm run build
working-directory: ./web
backend:
name: Backend build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- name: Check out branch
uses: actions/checkout@v2
- name: Download dependencies
run: |
go get -v -t -d ./...
if [ -f Gopkg.toml ]; then
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
dep ensure
fi
working-directory: ./server
- name: Test and Build
run: |
go build -v -race
working-directory: ./server
+29
View File
@@ -1 +1,30 @@
.idea/
/web/node_modules
/web/dist
.DS_Store
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
go.sum
/server/log/
/server/gva
/server/latest_log
*.iml
+19
View File
@@ -0,0 +1,19 @@
### Contributing Guide
#### 1 Issue Guidelines
- Issues are exclusively for bug reports, feature requests and design-related topics. Other questions may be closed directly. If any questions come up when you are using Element, please hit [Gitter](https://gitter.im/element-en/Lobby) for help.
- Before submitting an issue, please check if similar problems have already been issued.
#### 2 Pull Request Guidelines
- Fork this repository to your own account. Do not create branches here.
- Commit info should be formatted as `[File Name]: Info about commit.` (e.g. `README.md: Fix xxx bug`)
- <font color=red>Make sure PRs are created to `develop` branch instead of `master` branch.</font>
- If your PR fixes a bug, please provide a description about the related bug.
- Merging a PR takes two maintainers: one approves the changes after reviewing, and then the other reviews and merges.
+41
View File
@@ -0,0 +1,41 @@
FROM golang:alpine as builder
RUN apk add --update --no-cache yarn make g++
RUN yarn global add cross-env node-sass
ENV GOPROXY=https://goproxy.cn,https://goproxy.io,direct \
GO111MODULE=on \
CGO_ENABLED=1
WORKDIR /go/src/gin-vue-admin
RUN go env -w GOPROXY=https://goproxy.cn,https://goproxy.io,direct
COPY server/ ./
RUN go env && go list && go build -v -a -ldflags "-extldflags \"-static\" " -o gvadmin .
WORKDIR /web
COPY web/ ./
RUN yarn install && yarn run build
FROM nginx:alpine
LABEL MAINTAINER="rikugun"
RUN apk add --no-cache gettext tzdata && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone && \
date && \
apk del tzdata
COPY docker/etc/nginx/nginx.conf.tpl /etc/nginx/nginx.conf.tpl
WORKDIR /app
#copy web
COPY --from=builder /web/dist/ /var/www/
#copy go app
COPY --from=builder /go/src/gin-vue-admin/gvadmin ./
COPY --from=builder /go/src/gin-vue-admin/db.db ./
COPY --from=builder /go/src/gin-vue-admin/config.yaml ./
COPY --from=builder /go/src/gin-vue-admin/resource ./resource
COPY docker/docker-start.sh ./
ENV API_SERVER="http://localhost:8888/"
EXPOSE 80
ENTRYPOINT ["./docker-start.sh"]
+1 -1
View File
@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Copyright 2019 JiZhao Jiang
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
-3
View File
@@ -1,3 +0,0 @@
go.sum
.idea/
log/
-16
View File
@@ -1,16 +0,0 @@
FROM golang:1.12 AS build
WORKDIR /go/src/gin-vue-admin
COPY . .
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn
RUN go get ./... \
&& go build -o gin-vue-admin
FROM golang:1.12 AS serve
COPY --from=build /go/src/gin-vue-admin /go/src/gin-vue-admin
EXPOSE 8080
ENTRYPOINT [ "./gin-vue-admin" ]
-31
View File
@@ -1,31 +0,0 @@
package cmd
import (
"fmt"
"gin-vue-admin/config"
"gin-vue-admin/init/initlog"
"github.com/gin-gonic/gin"
"net/http"
"time"
)
func RunWindowsServer(Router *gin.Engine) {
address := fmt.Sprintf(":%d", config.GinVueAdminconfig.System.Addr)
s := &http.Server{
Addr: address,
Handler: Router,
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
MaxHeaderBytes: 1 << 20,
}
time.Sleep(10 * time.Microsecond)
log.L.Debug("server run success on ", address)
fmt.Printf(`欢迎使用 Gin-Vue-Admin
作者:奇淼 And Spike666
微信:shouzi_1994
默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
默认前端文件运行地址:http://127.0.0.1:8080
`, s.Addr)
_ = s.ListenAndServe()
}
-105
View File
@@ -1,105 +0,0 @@
package config
import (
"fmt"
"github.com/fsnotify/fsnotify"
"github.com/spf13/viper"
)
type Config struct {
MysqlAdmin MysqlAdmin `json:"mysqlAdmin"`
Qiniu Qiniu `json:"qiniu"`
CasbinConfig CasbinConfig `json:"casbinConfig"`
RedisAdmin RedisAdmin `json:"redisAdmin"`
System System `json:"system"`
JWT JWT `json:"jwt"`
Captcha Captcha `json:"captcha"`
Log Log `json:"log"`
}
type System struct { // 系统配置
UseMultipoint bool `json:"useMultipoint"`
Env string `json:"env"`
Addr int `json:"addr"`
}
type JWT struct { // jwt签名
SigningKey string `json:"signingKey"`
}
type CasbinConfig struct { //casbin配置
ModelPath string `json:"modelPath"` // casbin model地址配置
}
type MysqlAdmin struct { // mysql admin 数据库配置
Username string `json:"username"`
Password string `json:"password"`
Path string `json:"path"`
Dbname string `json:"dbname"`
Config string `json:"config"`
MaxIdleConns int `json:"maxIdleConns"`
MaxOpenConns int `json:"maxOpenConns"`
LogMode bool `json:"maxOpenConns"`
}
type RedisAdmin struct { // Redis admin 数据库配置
Addr string `json:"addr"`
Password string `json:"password"`
DB int `json:"db"`
}
type Qiniu struct { // 七牛 密钥配置
AccessKey string `json:"accessKey"`
SecretKey string `json:"secretKey"`
}
type Captcha struct { // 验证码配置
KeyLong int `json:"keyLong"`
ImgWidth int `json:"imgWidth"`
ImgHeight int `json:"imgHeight"`
}
/**
Log Config
"CRITICAL"
"ERROR"
"WARNING"
"NOTICE"
"INFO"
"DEBUG"
*/
type Log struct {
// log 打印的前缀
Prefix string `json:"prefix"`
// 是否显示打印log的文件具体路径
LogFile bool `json:"logFile"`
// 在控制台打印log的级别, []默认不打印
Stdout []string `json:"stdout"`
// 在文件中打印log的级别 []默认不打印
File []string `json:"file"`
}
var GinVueAdminconfig Config
var VTool *viper.Viper
func init() {
v := viper.New()
v.SetConfigName("config") // 设置配置文件名 (不带后缀)
v.AddConfigPath("./static/config/") // 第一个搜索路径
v.SetConfigType("json")
err := v.ReadInConfig() // 搜索路径,并读取配置数据
if err != nil {
panic(fmt.Errorf("Fatal error config file: %s \n", err))
}
v.WatchConfig()
v.OnConfigChange(func(e fsnotify.Event) {
fmt.Println("config file changed:", e.Name)
if err := v.Unmarshal(&GinVueAdminconfig); err != nil {
fmt.Println(err)
}
})
if err := v.Unmarshal(&GinVueAdminconfig); err != nil {
fmt.Println(err)
}
VTool = v
}
@@ -1,117 +0,0 @@
package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/dbModel"
"github.com/gin-gonic/gin"
"io/ioutil"
"strconv"
)
// @Tags ExaFileUploadAndDownload
// @Summary 断点续传到服务器
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "断点续传示例"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"上传成功"}"
// @Router /fileUploadAndDownload/breakpointContinue [post]
func BreakpointContinue(c *gin.Context) {
fileMd5 := c.Request.FormValue("fileMd5")
fileName := c.Request.FormValue("fileName")
chunkMd5 := c.Request.FormValue("chunkMd5")
chunkNumber, _ := strconv.Atoi(c.Request.FormValue("chunkNumber"))
chunkTotal, _ := strconv.Atoi(c.Request.FormValue("chunkTotal"))
_, FileHeader, err := c.Request.FormFile("file")
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("%v", err), gin.H{})
} else {
f, err := FileHeader.Open()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("%v", err), gin.H{})
} else {
cen, _ := ioutil.ReadAll(f)
defer f.Close()
if flag := servers.CheckMd5(cen, chunkMd5); flag {
err, file := new(dbModel.ExaFile).FindOrCreateFile(fileMd5, fileName, chunkTotal)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("%v", err), gin.H{})
} else {
err, pathc := servers.BreakPointContinue(cen, fileName, chunkNumber, chunkTotal, fileMd5)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("%v", err), gin.H{})
} else {
err = file.CreateFileChunk(pathc, chunkNumber)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "切片创建成功", gin.H{})
}
}
}
} else {
}
}
}
}
// @Tags ExaFileUploadAndDownload
// @Summary 查找文件
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "查找文件"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查找成功"}"
// @Router /fileUploadAndDownload/findFile [post]
func FindFile(c *gin.Context) {
fileMd5 := c.Query("fileMd5")
fileName := c.Query("fileName")
chunkTotal, _ := strconv.Atoi(c.Query("chunkTotal"))
err, file := new(dbModel.ExaFile).FindOrCreateFile(fileMd5, fileName, chunkTotal)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("查找失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "查找成功", gin.H{"file": file})
}
}
// @Tags ExaFileUploadAndDownload
// @Summary 查找文件
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "查找文件"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查找成功"}"
// @Router /fileUploadAndDownload/findFile [post]
func BreakpointContinueFinish(c *gin.Context) {
fileMd5 := c.Query("fileMd5")
fileName := c.Query("fileName")
err, filePath := servers.MakeFile(fileName, fileMd5)
if err != nil {
servers.ReportFormat(c, true, fmt.Sprintf("文件创建失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "文件创建成功", gin.H{"filePath": filePath})
}
}
// @Tags ExaFileUploadAndDownload
// @Summary 删除切片
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "查找文件"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查找成功"}"
// @Router /fileUploadAndDownload/removeChunk [post]
func RemoveChunk(c *gin.Context) {
fileMd5 := c.Query("fileMd5")
fileName := c.Query("fileName")
filePath := c.Query("filePath")
err := servers.RemoveChunk(fileMd5)
err = new(dbModel.ExaFile).DeleteFileChunk(fileMd5, fileName, filePath)
if err != nil {
servers.ReportFormat(c, true, fmt.Sprintf("缓存切片删除失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "缓存切片删除成功", gin.H{})
}
}
-120
View File
@@ -1,120 +0,0 @@
package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/middleware"
"gin-vue-admin/model/dbModel"
"gin-vue-admin/model/modelInterface"
"github.com/gin-gonic/gin"
)
// @Tags SysApi
// @Summary 创建客户
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body dbModel.ExaCustomer true "创建客户"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /customer/createExaCustomer [post]
func CreateExaCustomer(c *gin.Context) {
var cu dbModel.ExaCustomer
_ = c.ShouldBindJSON(&cu)
claims, _ := c.Get("claims")
waitUse := claims.(*middleware.CustomClaims)
cu.SysUserID = waitUse.ID
cu.SysUserAuthorityID = waitUse.AuthorityId
err := cu.CreateExaCustomer()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("创建失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "创建成功", gin.H{})
}
}
// @Tags SysApi
// @Summary 删除客户
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body dbModel.ExaCustomer true "删除客户"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /customer/deleteExaCustomer [post]
func DeleteExaCustomer(c *gin.Context) {
var cu dbModel.ExaCustomer
_ = c.ShouldBindJSON(&cu)
err := cu.DeleteExaCustomer()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("创建失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "创建成功", gin.H{})
}
}
// @Tags SysApi
// @Summary 更新客户信息
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body dbModel.ExaCustomer true "创建客户"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /customer/updataExaCustomer [post]
func UpdataExaCustomer(c *gin.Context) {
var cu dbModel.ExaCustomer
_ = c.ShouldBindJSON(&cu)
err := cu.UpdataExaCustomer()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("创建失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "创建成功", gin.H{})
}
}
// @Tags SysApi
// @Summary 获取单一客户信息
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body dbModel.ExaCustomer true "获取单一客户信息"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /customer/getExaCustomer [post]
func GetExaCustomer(c *gin.Context) {
var cu dbModel.ExaCustomer
_ = c.ShouldBindJSON(&cu)
err, customer := cu.GetExaCustomer()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("创建失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "创建成功", gin.H{
"customer": customer,
})
}
}
// @Tags SysApi
// @Summary 获取权限客户列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "获取权限客户列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /customer/getExaCustomerList [post]
func GetExaCustomerList(c *gin.Context) {
claims, _ := c.Get("claims")
waitUse := claims.(*middleware.CustomClaims)
var cu dbModel.ExaCustomer
cu.SysUserAuthorityID = waitUse.AuthorityId
var pageInfo modelInterface.PageInfo
_ = c.ShouldBindJSON(&pageInfo)
err, customerList, total := cu.GetInfoList(pageInfo)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("创建失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "创建成功", gin.H{
"customer": customerList,
"total": total,
"page": pageInfo.Page,
"pageSize": pageInfo.PageSize,
})
}
}
@@ -1,100 +0,0 @@
package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/dbModel"
"gin-vue-admin/model/modelInterface"
"github.com/gin-gonic/gin"
"strings"
)
// @Tags ExaFileUploadAndDownload
// @Summary 上传文件示例
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "上传文件示例"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"上传成功"}"
// @Router /fileUploadAndDownload/upload [post]
func UploadFile(c *gin.Context) {
noSave := c.DefaultQuery("noSave", "0")
_, header, err := c.Request.FormFile("file")
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("上传文件失败,%v", err), gin.H{})
} else {
//文件上传后拿到文件路径
err, filePath, key := servers.Upload(header, USER_HEADER_BUCKET, USER_HEADER_IMG_PATH)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("接收返回值失败,%v", err), gin.H{})
} else {
//修改数据库后得到修改后的user并且返回供前端使用
var file dbModel.ExaFileUploadAndDownload
file.Url = filePath
file.Name = header.Filename
s := strings.Split(file.Name, ".")
file.Tag = s[len(s)-1]
file.Key = key
if noSave == "0" {
err = file.Upload()
}
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("修改数据库链接失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "上传成功", gin.H{"file": file})
}
}
}
}
// @Tags ExaFileUploadAndDownload
// @Summary 删除文件
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body dbModel.ExaFileUploadAndDownload true "传入文件里面id即可"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
// @Router /fileUploadAndDownload/deleteFile [post]
func DeleteFile(c *gin.Context) {
var file dbModel.ExaFileUploadAndDownload
_ = c.ShouldBindJSON(&file)
err, f := file.FindFile()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("删除失败,%v", err), gin.H{})
} else {
err = servers.DeleteFile(USER_HEADER_BUCKET, f.Key)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("删除失败,%v", err), gin.H{})
} else {
err = f.DeleteFile()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("删除失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, fmt.Sprintf("删除成功,%v", err), gin.H{})
}
}
}
}
// @Tags ExaFileUploadAndDownload
// @Summary 分页文件列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "分页获取文件户列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /fileUploadAndDownload/getFileList [post]
func GetFileList(c *gin.Context) {
var pageInfo modelInterface.PageInfo
_ = c.ShouldBindJSON(&pageInfo)
err, list, total := new(dbModel.ExaFileUploadAndDownload).GetInfoList(pageInfo)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("获取数据失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "获取数据成功", gin.H{
"list": list,
"total": total,
"page": pageInfo.Page,
"pageSize": pageInfo.PageSize,
})
}
}
-152
View File
@@ -1,152 +0,0 @@
package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/modelInterface"
"gin-vue-admin/model/sysModel"
"github.com/gin-gonic/gin"
)
type CreateApiParams struct {
Path string `json:"path"`
Description string `json:"description"`
}
type DeleteApiParams struct {
ID uint `json:"id"`
}
// @Tags SysApi
// @Summary 创建基础api
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.CreateApiParams true "创建api"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /api/createApi [post]
func CreateApi(c *gin.Context) {
var api sysModel.SysApi
_ = c.ShouldBindJSON(&api)
err := api.CreateApi()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("创建失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "创建成功", gin.H{})
}
}
// @Tags SysApi
// @Summary 删除指定api
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body sysModel.SysApi true "删除api"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /api/deleteApi [post]
func DeleteApi(c *gin.Context) {
var a sysModel.SysApi
_ = c.ShouldBindJSON(&a)
err := a.DeleteApi()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("删除失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "删除成功", gin.H{})
}
}
type AuthAndPathIn struct {
AuthorityId string `json:"authorityId"`
ApiIds []uint `json:"apiIds"`
}
//条件搜索后端看此api
// @Tags SysApi
// @Summary 分页获取API列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "分页获取API列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /api/getApiList [post]
func GetApiList(c *gin.Context) {
// 此结构体仅本方法使用
type searchParams struct {
sysModel.SysApi
modelInterface.PageInfo
}
var sp searchParams
_ = c.ShouldBindJSON(&sp)
err, list, total := sp.SysApi.GetInfoList(sp.PageInfo)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("获取数据失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "获取数据成功", gin.H{
"list": list,
"total": total,
"page": sp.PageInfo.Page,
"pageSize": sp.PageInfo.PageSize,
})
}
}
// @Tags SysApi
// @Summary 根据id获取api
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "分页获取用户列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /api/getApiById [post]
func GetApiById(c *gin.Context) {
var idInfo GetById
_ = c.ShouldBindJSON(&idInfo)
err, api := new(sysModel.SysApi).GetApiById(idInfo.Id)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("获取数据失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "获取数据成功", gin.H{
"api": api,
})
}
}
// @Tags SysApi
// @Summary 创建基础api
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.CreateApiParams true "创建api"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /api/updataApi [post]
func UpdataApi(c *gin.Context) {
var api sysModel.SysApi
_ = c.ShouldBindJSON(&api)
err := api.UpdataApi()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("修改数据失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "修改数据成功", gin.H{})
}
}
// @Tags SysApi
// @Summary 获取所有的Api 不分页
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /api/getAllApis [post]
func GetAllApis(c *gin.Context) {
err, apis := new(sysModel.SysApi).GetAllApis()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("获取数据失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "获取数据成功", gin.H{
"apis": apis,
})
}
}
@@ -1,95 +0,0 @@
package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/modelInterface"
"gin-vue-admin/model/sysModel"
"github.com/gin-gonic/gin"
)
// @Tags authority
// @Summary 创建角色
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body sysModel.SysAuthority true "创建角色"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /authority/createAuthority [post]
func CreateAuthority(c *gin.Context) {
var auth sysModel.SysAuthority
_ = c.ShouldBindJSON(&auth)
err, authBack := auth.CreateAuthority()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("创建失败:%v", err), gin.H{
"authority": authBack,
})
} else {
servers.ReportFormat(c, true, "创建成功", gin.H{
"authority": authBack,
})
}
}
// @Tags authority
// @Summary 删除角色
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body sysModel.SysAuthority true "删除角色"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /authority/deleteAuthority [post]
func DeleteAuthority(c *gin.Context) {
var a sysModel.SysAuthority
_ = c.ShouldBindJSON(&a)
//删除角色之前需要判断是否有用户正在使用此角色
err := a.DeleteAuthority()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("删除失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "删除成功", gin.H{})
}
}
// @Tags authority
// @Summary 分页获取角色列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "分页获取用户列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /authority/getAuthorityList [post]
func GetAuthorityList(c *gin.Context) {
var pageInfo modelInterface.PageInfo
_ = c.ShouldBindJSON(&pageInfo)
err, list, total := new(sysModel.SysAuthority).GetInfoList(pageInfo)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("获取数据失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "获取数据成功", gin.H{
"list": list,
"total": total,
"page": pageInfo.Page,
"pageSize": pageInfo.PageSize,
})
}
}
// @Tags authority
// @Summary 设置角色资源权限
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body sysModel.SysAuthority true "设置角色资源权限"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
// @Router /authority/setDataAuthority [post]
func SetDataAuthority(c *gin.Context) {
var auth sysModel.SysAuthority
_ = c.ShouldBindJSON(&auth)
err := auth.SetDataAuthority()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("设置关联失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "设置关联成功", gin.H{})
}
}
@@ -1,33 +0,0 @@
package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/autoCodeModel"
"github.com/gin-gonic/gin"
"os"
)
// @Tags SysApi
// @Summary 自动代码模板
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body autoCodeModel.AutoCodeStruct true "创建自动代码"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /autoCode/createTemp [post]
func CreateTemp(c *gin.Context) {
var a autoCodeModel.AutoCodeStruct
_ = c.ShouldBindJSON(&a)
err := a.CreateTemp()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("创建失败:%v", err), gin.H{})
os.Remove("./ginvueadmin.zip")
} else {
c.Writer.Header().Add("Content-Disposition", fmt.Sprintf("attachment; filename=%s", "ginvueadmin.zip")) //fmt.Sprintf("attachment; filename=%s", filename)对下载的文件重命名
c.Writer.Header().Add("Content-Type", "application/json")
c.Writer.Header().Add("success", "true")
c.File("./ginvueadmin.zip")
os.Remove("./ginvueadmin.zip")
}
}
@@ -1,35 +0,0 @@
package api
import (
"gin-vue-admin/config"
"gin-vue-admin/controller/servers"
"github.com/dchest/captcha"
"github.com/gin-gonic/gin"
)
// 获取图片验证码id
// @Tags base
// @Summary 生成验证码
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /base/captcha [post]
func Captcha(c *gin.Context) {
captchaId := captcha.NewLen(config.GinVueAdminconfig.Captcha.KeyLong)
servers.ReportFormat(c, true, "验证码获取成功", gin.H{
"captchaId": captchaId,
"picPath": "/base/captcha/" + captchaId + ".png",
})
}
// @Tags base
// @Summary 生成验证码图片路径
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /base/captcha/:captchaId [get]
func CaptchaImg(c *gin.Context) {
servers.GinCapthcaServeHTTP(c.Writer, c.Request)
}
-57
View File
@@ -1,57 +0,0 @@
package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/sysModel"
"github.com/gin-gonic/gin"
)
// @Tags casbin
// @Summary 更改角色api权限
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body sysModel.CasbinInReceive true "更改角色api权限"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /casbin/casbinPUpdata [post]
func CasbinPUpdata(c *gin.Context) {
var cmr sysModel.CasbinInReceive
_ = c.ShouldBindJSON(&cmr)
err := new(sysModel.CasbinModel).CasbinPUpdata(cmr.AuthorityId, cmr.CasbinInfos)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("添加规则失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "添加规则成功", gin.H{})
}
}
// @Tags casbin
// @Summary 获取权限列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.CreateAuthorityParams true "获取权限列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /casbin/getPolicyPathByAuthorityId [post]
func GetPolicyPathByAuthorityId(c *gin.Context) {
var cmr sysModel.CasbinInReceive
_ = c.ShouldBindJSON(&cmr)
paths := new(sysModel.CasbinModel).GetPolicyPathByAuthorityId(cmr.AuthorityId)
servers.ReportFormat(c, true, "获取规则成功", gin.H{"paths": paths})
}
// @Tags casbin
// @Summary casb RBAC RESTFUL测试路由
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.CreateAuthorityParams true "获取权限列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /casbin/CasbinTest [get]
func CasbinTest(c *gin.Context) {
// 测试restful以及占位符代码 随意书写
pathParam := c.Param("pathParam")
query := c.Query("query")
servers.ReportFormat(c, true, "获取规则成功", gin.H{"pathParam": pathParam, "query": query})
}
@@ -1,28 +0,0 @@
package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/sysModel"
"github.com/gin-gonic/gin"
)
// @Tags jwt
// @Summary jwt加入黑名单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"拉黑成功"}"
// @Router /jwt/jsonInBlacklist [post]
func JsonInBlacklist(c *gin.Context){
token := c.Request.Header.Get("x-token")
ModelJwt := sysModel.JwtBlacklist{
Jwt:token,
}
err := ModelJwt.JsonInBlacklist()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("jwt作废失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "jwt作废成功", gin.H{})
}
}
-199
View File
@@ -1,199 +0,0 @@
package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/middleware"
"gin-vue-admin/model/modelInterface"
"gin-vue-admin/model/sysModel"
"github.com/gin-gonic/gin"
)
// @Tags authorityAndMenu
// @Summary 获取用户动态路由
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body api.RegistAndLoginStuct true "可以什么都不填"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
// @Router /menu/getMenu [post]
func GetMenu(c *gin.Context) {
claims, _ := c.Get("claims")
waitUse := claims.(*middleware.CustomClaims)
err, menus := new(sysModel.SysMenu).GetMenuTree(waitUse.AuthorityId)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("获取失败:%v", err), gin.H{"menus": menus})
} else {
servers.ReportFormat(c, true, "获取成功", gin.H{"menus": menus})
}
}
// @Tags menu
// @Summary 分页获取基础menu列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "分页获取基础menu列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/getMenuList [post]
func GetMenuList(c *gin.Context) {
var pageInfo modelInterface.PageInfo
_ = c.ShouldBindJSON(&pageInfo)
err, menuList, total := new(sysModel.SysBaseMenu).GetInfoList(pageInfo)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("获取数据失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "获取数据成功", gin.H{
"list": menuList,
"total": total,
"page": pageInfo.Page,
"pageSize": pageInfo.PageSize,
})
}
}
// @Tags menu
// @Summary 新增菜单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body sysModel.SysBaseMenu true "新增菜单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/addBaseMenu [post]
func AddBaseMenu(c *gin.Context) {
var addMenu sysModel.SysBaseMenu
_ = c.ShouldBindJSON(&addMenu)
err := addMenu.AddBaseMenu()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("添加失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, fmt.Sprintf("添加成功,%v", err), gin.H{})
}
}
// @Tags authorityAndMenu
// @Summary 获取用户动态路由
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body api.RegistAndLoginStuct true "可以什么都不填"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
// @Router /menu/getBaseMenuTree [post]
func GetBaseMenuTree(c *gin.Context) {
err, menus := new(sysModel.SysBaseMenu).GetBaseMenuTree()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("获取失败:%v", err), gin.H{"menus": menus})
} else {
servers.ReportFormat(c, true, "获取成功", gin.H{"menus": menus})
}
}
type AddMenuAuthorityInfo struct {
Menus []sysModel.SysBaseMenu
AuthorityId string
}
// @Tags authorityAndMenu
// @Summary 增加menu和角色关联关系
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.AddMenuAuthorityInfo true "增加menu和角色关联关系"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/addMenuAuthority [post]
func AddMenuAuthority(c *gin.Context) {
var addMenuAuthorityInfo AddMenuAuthorityInfo
_ = c.ShouldBindJSON(&addMenuAuthorityInfo)
err := new(sysModel.SysMenu).AddMenuAuthority(addMenuAuthorityInfo.Menus, addMenuAuthorityInfo.AuthorityId)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("添加失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, fmt.Sprintf("添加成功,%v", err), gin.H{})
}
}
type AuthorityIdInfo struct {
AuthorityId string
}
// @Tags authorityAndMenu
// @Summary 获取指定角色menu
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.AuthorityIdInfo true "增加menu和角色关联关系"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/addMenuAuthority [post]
func GetMenuAuthority(c *gin.Context) {
var authorityIdInfo AuthorityIdInfo
_ = c.ShouldBindJSON(&authorityIdInfo)
err, menus := new(sysModel.SysMenu).GetMenuAuthority(authorityIdInfo.AuthorityId)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("获取失败:%v", err), gin.H{"menus": menus})
} else {
servers.ReportFormat(c, true, "获取成功", gin.H{"menus": menus})
}
}
type IdInfo struct {
Id float64
}
// @Tags menu
// @Summary 删除菜单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.IdInfo true "删除菜单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/deleteBaseMenu [post]
func DeleteBaseMenu(c *gin.Context) {
var idInfo IdInfo
_ = c.ShouldBindJSON(&idInfo)
err := new(sysModel.SysBaseMenu).DeleteBaseMenu(idInfo.Id)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("删除失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "删除成功", gin.H{})
}
}
// @Tags menu
// @Summary 更新菜单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body sysModel.SysBaseMenu true "更新菜单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/updataBaseMen [post]
func UpdataBaseMenu(c *gin.Context) {
var menu sysModel.SysBaseMenu
_ = c.ShouldBindJSON(&menu)
err := menu.UpdataBaseMenu()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("修改失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "修改成功", gin.H{})
}
}
type GetById struct {
Id float64 `json:"id"`
}
// @Tags menu
// @Summary 根据id获取菜单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.GetById true "根据id获取菜单"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/getBaseMenuById [post]
func GetBaseMenuById(c *gin.Context) {
var idInfo GetById
_ = c.ShouldBindJSON(&idInfo)
err, menu := new(sysModel.SysBaseMenu).GetBaseMenuById(idInfo.Id)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("查询失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "查询成功", gin.H{"menu": menu})
}
}
-61
View File
@@ -1,61 +0,0 @@
package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/sysModel"
"github.com/gin-gonic/gin"
)
// @Tags system
// @Summary 获取配置文件内容
// @Security ApiKeyAuth
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
// @Router /system/getSystemConfig [post]
func GetSystemConfig(c *gin.Context) {
err, config := new(sysModel.System).GetSystemConfig()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("获取失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "获取成功", gin.H{"config": config})
}
}
// @Tags system
// @Summary 设置配置文件内容
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body sysModel.System true "设置配置文件内容"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
// @Router /system/setSystemConfig [post]
func SetSystemConfig(c *gin.Context) {
var sys sysModel.System
_ = c.ShouldBindJSON(&sys)
err := sys.SetSystemConfig()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("设置失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "设置成功", gin.H{})
}
}
//本方法开发中 开发者windows系统 缺少linux系统所需的包 因此搁置
// @Tags system
// @Summary 设置配置文件内容
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body sysModel.System true "设置配置文件内容"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
// @Router /system/ReloadSystem [post]
func ReloadSystem(c *gin.Context) {
var sys sysModel.System
_ = c.ShouldBindJSON(&sys)
err := sys.SetSystemConfig()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("设置失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "设置成功", gin.H{})
}
}
-247
View File
@@ -1,247 +0,0 @@
package api
import (
"fmt"
"gin-vue-admin/config"
"gin-vue-admin/controller/servers"
"gin-vue-admin/middleware"
"gin-vue-admin/model/modelInterface"
"gin-vue-admin/model/sysModel"
"github.com/dchest/captcha"
"github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin"
"github.com/go-redis/redis"
uuid "github.com/satori/go.uuid"
"mime/multipart"
"time"
)
var (
USER_HEADER_IMG_PATH string = "http://qmplusimg.henrongyi.top"
USER_HEADER_BUCKET string = "qm-plus-img"
)
type RegistAndLoginStuct struct {
Username string `json:"username"`
Password string `json:"password"`
Captcha string `json:"captcha"`
CaptchaId string `json:"captchaId"`
}
type RegestStuct struct {
Username string `json:"userName"`
Password string `json:"passWord"`
NickName string `json:"nickName" gorm:"default:'QMPlusUser'"`
HeaderImg string `json:"headerImg" gorm:"default:'http://www.henrongyi.top/avatar/lufu.jpg'"`
AuthorityId string `json:"authorityId" gorm:"default:888"`
}
// @Tags Base
// @Summary 用户注册账号
// @Produce application/json
// @Param data body sysModel.SysUser true "用户注册接口"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"注册成功"}"
// @Router /base/regist [post]
func Regist(c *gin.Context) {
var R RegestStuct
_ = c.ShouldBindJSON(&R)
user := &sysModel.SysUser{Username: R.Username, NickName: R.NickName, Password: R.Password, HeaderImg: R.HeaderImg, AuthorityId: R.AuthorityId}
err, user := user.Regist()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("%v", err), gin.H{
"user": user,
})
} else {
servers.ReportFormat(c, true, "创建成功", gin.H{
"user": user,
})
}
}
// @Tags Base
// @Summary 用户登录
// @Produce application/json
// @Param data body api.RegistAndLoginStuct true "用户登录接口"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"登陆成功"}"
// @Router /base/login [post]
func Login(c *gin.Context) {
var L RegistAndLoginStuct
_ = c.ShouldBindJSON(&L)
if captcha.VerifyString(L.CaptchaId, L.Captcha) {
U := &sysModel.SysUser{Username: L.Username, Password: L.Password}
if err, user := U.Login(); err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("用户名密码错误或%v", err), gin.H{})
} else {
tokenNext(c, *user)
}
} else {
servers.ReportFormat(c, false, "验证码错误", gin.H{})
}
}
//登录以后签发jwt
func tokenNext(c *gin.Context, user sysModel.SysUser) {
j := &middleware.JWT{
[]byte(config.GinVueAdminconfig.JWT.SigningKey), // 唯一签名
}
clams := middleware.CustomClaims{
UUID: user.UUID,
ID: user.ID,
NickName: user.NickName,
AuthorityId: user.AuthorityId,
StandardClaims: jwt.StandardClaims{
NotBefore: int64(time.Now().Unix() - 1000), // 签名生效时间
ExpiresAt: int64(time.Now().Unix() + 60*60*24*7), // 过期时间 一周
Issuer: "qmPlus", //签名的发行者
},
}
token, err := j.CreateToken(clams)
if err != nil {
servers.ReportFormat(c, false, "获取token失败", gin.H{})
} else {
if config.GinVueAdminconfig.System.UseMultipoint {
var loginJwt sysModel.JwtBlacklist
loginJwt.Jwt = token
err, jwtStr := loginJwt.GetRedisJWT(user.Username)
if err == redis.Nil {
err2 := loginJwt.SetRedisJWT(user.Username)
if err2 != nil {
servers.ReportFormat(c, false, "设置登录状态失败", gin.H{})
} else {
servers.ReportFormat(c, true, "登录成功", gin.H{"user": user, "token": token, "expiresAt": clams.StandardClaims.ExpiresAt * 1000})
}
} else if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("%v", err), gin.H{})
} else {
var blackjWT sysModel.JwtBlacklist
blackjWT.Jwt = jwtStr
err3 := blackjWT.JsonInBlacklist()
if err3 != nil {
servers.ReportFormat(c, false, "jwt作废失败", gin.H{})
} else {
err2 := loginJwt.SetRedisJWT(user.Username)
if err2 != nil {
servers.ReportFormat(c, false, "设置登录状态失败", gin.H{})
} else {
servers.ReportFormat(c, true, "登录成功", gin.H{"user": user, "token": token, "expiresAt": clams.StandardClaims.ExpiresAt * 1000})
}
}
}
} else {
servers.ReportFormat(c, true, "登录成功", gin.H{"user": user, "token": token, "expiresAt": clams.StandardClaims.ExpiresAt * 1000})
}
}
}
type ChangePasswordStutrc struct {
Username string `json:"username"`
Password string `json:"password"`
NewPassword string `json:"newPassword"`
}
// @Tags SysUser
// @Summary 用户修改密码
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body api.ChangePasswordStutrc true "用户修改密码"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
// @Router /user/changePassword [post]
func ChangePassword(c *gin.Context) {
var params ChangePasswordStutrc
_ = c.ShouldBindJSON(&params)
U := &sysModel.SysUser{Username: params.Username, Password: params.Password}
if err, _ := U.ChangePassword(params.NewPassword); err != nil {
servers.ReportFormat(c, false, "修改失败,请检查用户名密码", gin.H{})
} else {
servers.ReportFormat(c, true, "修改成功", gin.H{})
}
}
type UserHeaderImg struct {
HeaderImg multipart.File `json:"headerImg"`
}
// @Tags SysUser
// @Summary 用户上传头像
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param headerImg formData file true "用户上传头像"
// @Param username formData string true "用户上传头像"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"上传成功"}"
// @Router /user/uploadHeaderImg [post]
func UploadHeaderImg(c *gin.Context) {
claims, _ := c.Get("claims")
//获取头像文件
// 这里我们通过断言获取 claims内的所有内容
waitUse := claims.(*middleware.CustomClaims)
uuid := waitUse.UUID
_, header, err := c.Request.FormFile("headerImg")
//便于找到用户 以后从jwt中取
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("上传文件失败,%v", err), gin.H{})
} else {
//文件上传后拿到文件路径
err, filePath, _ := servers.Upload(header, USER_HEADER_BUCKET, USER_HEADER_IMG_PATH)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("接收返回值失败,%v", err), gin.H{})
} else {
//修改数据库后得到修改后的user并且返回供前端使用
err, user := new(sysModel.SysUser).UploadHeaderImg(uuid, filePath)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("修改数据库链接失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "上传成功", gin.H{"user": user})
}
}
}
}
// @Tags SysUser
// @Summary 分页获取用户列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "分页获取用户列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /user/getUserList [post]
func GetUserList(c *gin.Context) {
var pageInfo modelInterface.PageInfo
_ = c.ShouldBindJSON(&pageInfo)
err, list, total := new(sysModel.SysUser).GetInfoList(pageInfo)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("获取数据失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "获取数据成功", gin.H{
"userList": list,
"total": total,
"page": pageInfo.Page,
"pageSize": pageInfo.PageSize,
})
}
}
type SetUserAuth struct {
UUID uuid.UUID `json:"uuid"`
AuthorityId string `json:"authorityId"`
}
// @Tags SysUser
// @Summary 设置用户权限
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body api.SetUserAuth true "设置用户权限"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
// @Router /user/setUserAuthority [post]
func SetUserAuthority(c *gin.Context) {
var sua SetUserAuth
_ = c.ShouldBindJSON(&sua)
err := new(sysModel.SysUser).SetUserAuthority(sua.UUID, sua.AuthorityId)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("修改失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "修改成功", gin.H{})
}
}
@@ -1,25 +0,0 @@
package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/sysModel"
"github.com/gin-gonic/gin"
)
// @Tags workflow
// @Summary 注册工作流
// @Produce application/json
// @Param data body sysModel.SysWorkflow true "注册工作流接口"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"注册成功"}"
// @Router /workflow/createWorkFlow [post]
func CreateWorkFlow(c *gin.Context) {
var wk sysModel.SysWorkflow
_ = c.ShouldBindJSON(&wk)
err := wk.Create()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("获取失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "获取成功", gin.H{})
}
}
@@ -1,55 +0,0 @@
package servers
import (
"bytes"
"fmt"
"gin-vue-admin/config"
"github.com/dchest/captcha"
"net/http"
"path"
"strings"
"time"
)
// 这里需要自行实现captcha 的gin模式
func GinCapthcaServeHTTP(w http.ResponseWriter, r *http.Request) {
dir, file := path.Split(r.URL.Path)
ext := path.Ext(file)
id := file[:len(file)-len(ext)]
if ext == "" || id == "" {
http.NotFound(w, r)
return
}
fmt.Println("reload : " + r.FormValue("reload"))
if r.FormValue("reload") != "" {
captcha.Reload(id)
}
lang := strings.ToLower(r.FormValue("lang"))
download := path.Base(dir) == "download"
if Serve(w, r, id, ext, lang, download, config.GinVueAdminconfig.Captcha.ImgWidth, config.GinVueAdminconfig.Captcha.ImgHeight) == captcha.ErrNotFound {
http.NotFound(w, r)
}
}
func Serve(w http.ResponseWriter, r *http.Request, id, ext, lang string, download bool, width, height int) error {
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
w.Header().Set("Pragma", "no-cache")
w.Header().Set("Expires", "0")
var content bytes.Buffer
switch ext {
case ".png":
w.Header().Set("Content-Type", "image/png")
captcha.WriteImage(&content, id, width, height)
case ".wav":
w.Header().Set("Content-Type", "audio/x-wav")
captcha.WriteAudio(&content, id, lang)
default:
return captcha.ErrNotFound
}
if download {
w.Header().Set("Content-Type", "application/octet-stream")
}
http.ServeContent(w, r, id+ext, time.Time{}, bytes.NewReader(content.Bytes()))
return nil
}
-16
View File
@@ -1,16 +0,0 @@
package servers
import (
"gin-vue-admin/init/qmsql"
"gin-vue-admin/model/modelInterface"
"github.com/jinzhu/gorm"
)
//获取分页功能 接收实现了分页接口的结构体 返回搜索完成的结果 许需要自行scan 或者find
func PagingServer(paging modelInterface.Paging, info modelInterface.PageInfo) (err error, db *gorm.DB, total int) {
limit := info.PageSize
offset := info.PageSize * (info.Page - 1)
err = qmsql.DEFAULTDB.Model(paging).Count(&total).Error
db = qmsql.DEFAULTDB.Limit(limit).Offset(offset).Order("id desc")
return err, db, total
}
@@ -1,16 +0,0 @@
package servers
import (
"net/http"
"github.com/gin-gonic/gin"
)
func ReportFormat(c *gin.Context, success bool, msg string, json gin.H) {
// 开始时间
c.JSON(http.StatusOK, gin.H{
"success": success,
"msg": msg,
"data": json,
})
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-50
View File
@@ -1,50 +0,0 @@
module gin-vue-admin
go 1.12
require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751
github.com/casbin/casbin v1.9.1
github.com/casbin/gorm-adapter v1.0.0
github.com/dchest/captcha v0.0.0-20170622155422-6a29415a8364
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect
github.com/fsnotify/fsnotify v1.4.9
github.com/gin-gonic/gin v1.6.1
github.com/go-openapi/spec v0.19.7 // indirect
github.com/go-openapi/swag v0.19.8 // indirect
github.com/go-redis/redis v6.15.7+incompatible
github.com/go-sql-driver/mysql v1.5.0 // indirect
github.com/golang/protobuf v1.3.5 // indirect
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 // indirect
github.com/jinzhu/gorm v1.9.12
github.com/lestrrat/go-envload v0.0.0-20180220120943-6ed08b54a570 // indirect
github.com/lestrrat/go-file-rotatelogs v0.0.0-20180223000712-d3151e2a480f
github.com/lestrrat/go-strftime v0.0.0-20180220042222-ba3bf9c1d042 // indirect
github.com/lib/pq v1.3.0 // indirect
github.com/mailru/easyjson v0.7.1 // indirect
github.com/mitchellh/mapstructure v1.2.2 // indirect
github.com/onsi/ginkgo v1.7.0 // indirect
github.com/onsi/gomega v1.4.3 // indirect
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
github.com/pelletier/go-toml v1.6.0 // indirect
github.com/pkg/errors v0.9.1
github.com/qiniu/api.v7 v7.2.5+incompatible
github.com/qiniu/x v7.0.8+incompatible // indirect
github.com/satori/go.uuid v1.2.0
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.6.2
github.com/swaggo/gin-swagger v1.2.0
github.com/swaggo/swag v1.6.5
github.com/tebeka/strftime v0.1.3 // indirect
github.com/unrolled/secure v1.0.7
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 // indirect
golang.org/x/net v0.0.0-20200320220750-118fecf932d8 // indirect
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd // indirect
golang.org/x/tools v0.0.0-20200324003944-a576cf524670 // indirect
gopkg.in/ini.v1 v1.55.0 // indirect
qiniupkg.com/x v7.0.8+incompatible // indirect
)
-25
View File
@@ -1,25 +0,0 @@
package initRedis
import (
"gin-vue-admin/config"
"gin-vue-admin/init/initlog"
"github.com/go-redis/redis"
)
var DEFAULTREDIS *redis.Client
func InitRedis() (client *redis.Client) {
client = redis.NewClient(&redis.Options{
Addr: config.GinVueAdminconfig.RedisAdmin.Addr,
Password: config.GinVueAdminconfig.RedisAdmin.Password, // no password set
DB: config.GinVueAdminconfig.RedisAdmin.DB, // use default DB
})
pong, err := client.Ping().Result()
if err != nil {
log.L.Error(err)
} else {
log.L.Info("redis connect ping response:", pong)
DEFAULTREDIS = client
}
return client
}
-17
View File
@@ -1,17 +0,0 @@
package log
// Custom Logger
type Logger interface {
Debug(v ...interface{})
Info(v ...interface{})
Warning(v ...interface{})
Error(v ...interface{})
Critical(v ...interface{})
Fatal(v ...interface{})
}
var L Logger
func SetLogger(logger Logger) {
L = logger
}
-146
View File
@@ -1,146 +0,0 @@
package qmlog
// Register logger
import (
"errors"
"fmt"
"gin-vue-admin/config"
"gin-vue-admin/init/initlog"
"gin-vue-admin/tools"
rotatelogs "github.com/lestrrat/go-file-rotatelogs"
oplogging "github.com/op/go-logging"
"io"
"os"
"strings"
"time"
)
const (
logDir = "log"
logSoftLink = "api.log"
module = "gin-vue-admin"
)
var (
configNotFound = errors.New("logger prefix not found")
defaultFormatter = `%{time:2006/01/02 - 15:04:05.000} %{longfile} %{color:bold}▶ [%{level:.6s}] %{message}%{color:reset}`
)
type Logger struct{
logger *oplogging.Logger
}
func NewLogger() error {
c := config.GinVueAdminconfig.Log
if c.Prefix == "" {
return configNotFound
}
logger := oplogging.MustGetLogger(module)
var backends []oplogging.Backend
backends = registerStdout(c, backends)
backends = registerFile(c, backends)
oplogging.SetBackend(backends...)
log.SetLogger(logger)
return nil
}
func registerStdout(c config.Log, backends []oplogging.Backend) []oplogging.Backend {
for _, v := range c.Stdout {
level, err := oplogging.LogLevel(v)
if err != nil {
fmt.Println(err)
continue
}
backends = append(backends, createBackend(os.Stdout, c, level))
}
return backends
}
func registerFile(c config.Log, backends []oplogging.Backend) []oplogging.Backend {
if len(c.File) > 0 {
if ok, _ := tools.PathExists(logDir); !ok {
// directory not exist
fmt.Println("create log directory")
_ = os.Mkdir(logDir, os.ModePerm)
}
apiLogPath := logDir + string(os.PathSeparator) + logSoftLink
fileWriter, err := rotatelogs.New(
apiLogPath+".%Y-%m-%d-%H-%M.log",
// generate soft link, point to latest log file
rotatelogs.WithLinkName(apiLogPath),
// maximum time to save log files
rotatelogs.WithMaxAge(7*24*time.Hour),
// time period of log file switching
rotatelogs.WithRotationTime(24*time.Hour),
)
if err != nil {
fmt.Println(err)
return backends
}
for _, v := range c.File {
level, err := oplogging.LogLevel(v)
if err != nil {
fmt.Println(err)
continue
}
backends = append(backends, createBackend(fileWriter, c, level))
}
}
return backends
}
func createBackend(w io.Writer, c config.Log, level oplogging.Level) oplogging.Backend {
backend := oplogging.NewLogBackend(w, c.Prefix, 0)
stdoutWriter := false
if w == os.Stdout {
stdoutWriter = true
}
format := getLogFormatter(c, stdoutWriter)
backendLeveled := oplogging.AddModuleLevel(oplogging.NewBackendFormatter(backend, format))
backendLeveled.SetLevel(level, module)
return backendLeveled
}
func getLogFormatter(c config.Log, stdoutWriter bool) oplogging.Formatter {
pattern := defaultFormatter
if !stdoutWriter {
// Color is only required for console output
// Other writers don't need %{color} tag
pattern = strings.Replace(pattern, "%{color:bold}", "", -1)
pattern = strings.Replace(pattern, "%{color:reset}", "", -1)
}
if !c.LogFile {
// Remove %{logfile} tag
pattern = strings.Replace(pattern, "%{longfile}", "", -1)
}
return oplogging.MustStringFormatter(pattern)
}
func (l Logger) Debug(v ...interface{}) {
l.logger.Debug(v)
}
func (l Logger) Info(v ...interface{}) {
l.logger.Info(v)
}
func (l Logger) Warning(v ...interface{}) {
l.logger.Warning(v)
}
func (l Logger) Error(v ...interface{}) {
l.logger.Error(v)
}
func (l Logger) Critical(v ...interface{}) {
l.logger.Critical(v)
}
func (l Logger) Fatal(v ...interface{}) {
l.logger.Fatal(v)
}
-23
View File
@@ -1,23 +0,0 @@
package qmsql
import (
"gin-vue-admin/config"
"gin-vue-admin/init/initlog"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/mysql"
)
var DEFAULTDB *gorm.DB
//初始化数据库并产生数据库全局变量
func InitMysql(admin config.MysqlAdmin) *gorm.DB {
if db, err := gorm.Open("mysql", admin.Username+":"+admin.Password+"@("+admin.Path+")/"+admin.Dbname+"?"+admin.Config); err != nil {
log.L.Error("DEFAULTDB数据库启动异常",err)
} else {
DEFAULTDB = db
DEFAULTDB.DB().SetMaxIdleConns(admin.MaxIdleConns)
DEFAULTDB.DB().SetMaxOpenConns(admin.MaxOpenConns)
DEFAULTDB.LogMode(admin.LogMode)
}
return DEFAULTDB
}
@@ -1,26 +0,0 @@
package registTable
import (
"gin-vue-admin/init/initlog"
"gin-vue-admin/model/dbModel"
"gin-vue-admin/model/sysModel"
"github.com/jinzhu/gorm"
)
//注册数据库表专用
func RegistTable(db *gorm.DB) {
db.AutoMigrate(sysModel.SysUser{},
sysModel.SysAuthority{},
sysModel.SysMenu{},
sysModel.SysApi{},
sysModel.SysBaseMenu{},
sysModel.JwtBlacklist{},
sysModel.SysWorkflow{},
sysModel.SysWorkflowStepInfo{},
dbModel.ExaFileUploadAndDownload{},
dbModel.ExaFile{},
dbModel.ExaFileChunk{},
dbModel.ExaCustomer{},
)
log.L.Debug("register table success")
}
-63
View File
@@ -1,63 +0,0 @@
package main
import (
"gin-vue-admin/cmd"
"gin-vue-admin/config"
"gin-vue-admin/init/initRedis"
"gin-vue-admin/init/initRouter"
"gin-vue-admin/init/initlog/qmlog"
"gin-vue-admin/init/qmsql"
"gin-vue-admin/init/registTable"
"os"
//"runtime"
)
// @title Swagger Example API
// @version 0.0.1
// @description This is a sample Server pets
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name x-token
// @BasePath /
var (
mysqlHost = os.Getenv("MYSQLHOST")
mysqlPort = os.Getenv("MYSQLPORT")
)
func main() {
if err := qmlog.NewLogger(); err != nil {
panic(err)
}
// 可以通过环境变量来覆盖配置值
// 未设定有效的环境变量时,使用配置值
mysqlConfig := config.GinVueAdminconfig.MysqlAdmin
if mysqlHost != "" && mysqlPort != "" {
mysqlConfig.Path = mysqlHost + ":" + mysqlPort
}
// 链接初始化数据库
db := qmsql.InitMysql(mysqlConfig) // 链接初始化数据库
if config.GinVueAdminconfig.System.UseMultipoint {
// 初始化redis服务
_ = initRedis.InitRedis()
}
// 注册数据库表
registTable.RegistTable(db)
// 程序结束前关闭数据库链接
defer qmsql.DEFAULTDB.Close()
// 注册路由
Router := initRouter.InitRouter()
Router.Static("/form-generator", "./static/form-generator")
//Router.RunTLS(":443","ssl.pem", "ssl.key") // https支持 需要添加中间件
//sysType := runtime.GOOS
//
//if sysType == "linux" {
// // LINUX系统
// // 借助endless开发无感知重启后台 以及前端接口重启后台功能
//}
//if sysType == "windows" {
// WIN系统
cmd.RunWindowsServer(Router)
//}
}
-31
View File
@@ -1,31 +0,0 @@
package middleware
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/sysModel"
"github.com/gin-gonic/gin"
)
//拦截器
func CasbinHandler() gin.HandlerFunc {
return func(c *gin.Context) {
claims, _ := c.Get("claims")
waitUse := claims.(*CustomClaims)
//获取请求的URI
obj := c.Request.URL.RequestURI()
//获取请求方法
act := c.Request.Method
//获取用户的角色
sub := waitUse.AuthorityId
e := sysModel.Casbin()
//判断策略中是否存在
if e.Enforce(sub, obj, act) {
c.Next()
} else {
servers.ReportFormat(c, false, fmt.Sprintf("权限不足"), gin.H{})
c.Abort()
return
}
}
}
-137
View File
@@ -1,137 +0,0 @@
package middleware
import (
"errors"
"gin-vue-admin/config"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/sysModel"
"github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin"
uuid "github.com/satori/go.uuid"
"time"
)
func JWTAuth() gin.HandlerFunc {
return func(c *gin.Context) {
// 我们这里jwt鉴权取头部信息 x-token 登录时回返回token信息 这里前端需要把token存储到cookie或者本地localSstorage中 不过需要跟后端协商过期时间 可以约定刷新令牌或者重新登录
token := c.Request.Header.Get("x-token")
ModelToken := sysModel.JwtBlacklist{
Jwt: token,
}
if token == "" {
servers.ReportFormat(c, false, "未登录或非法访问", gin.H{
"reload": true,
})
c.Abort()
return
}
if ModelToken.IsBlacklist(token) {
servers.ReportFormat(c, false, "您的帐户异地登陆或令牌失效", gin.H{
"reload": true,
})
c.Abort()
return
}
j := NewJWT()
// parseToken 解析token包含的信息
claims, err := j.ParseToken(token)
if err != nil {
if err == TokenExpired {
servers.ReportFormat(c, false, "授权已过期", gin.H{
"reload": true,
})
c.Abort()
return
}
servers.ReportFormat(c, false, err.Error(), gin.H{
"reload": true,
})
c.Abort()
return
}
c.Set("claims", claims)
c.Next()
}
}
type JWT struct {
SigningKey []byte
}
var (
TokenExpired error = errors.New("Token is expired")
TokenNotValidYet error = errors.New("Token not active yet")
TokenMalformed error = errors.New("That's not even a token")
TokenInvalid error = errors.New("Couldn't handle this token:")
)
type CustomClaims struct {
UUID uuid.UUID
ID uint
NickName string
AuthorityId string
jwt.StandardClaims
}
func NewJWT() *JWT {
return &JWT{
[]byte(config.GinVueAdminconfig.JWT.SigningKey),
}
}
//创建一个token
func (j *JWT) CreateToken(claims CustomClaims) (string, error) {
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
return token.SignedString(j.SigningKey)
}
//解析 token
func (j *JWT) ParseToken(tokenString string) (*CustomClaims, error) {
token, err := jwt.ParseWithClaims(tokenString, &CustomClaims{}, func(token *jwt.Token) (i interface{}, e error) {
return j.SigningKey, nil
})
if err != nil {
if ve, ok := err.(*jwt.ValidationError); ok {
if ve.Errors&jwt.ValidationErrorMalformed != 0 {
return nil, TokenMalformed
} else if ve.Errors&jwt.ValidationErrorExpired != 0 {
// Token is expired
return nil, TokenExpired
} else if ve.Errors&jwt.ValidationErrorNotValidYet != 0 {
return nil, TokenNotValidYet
} else {
return nil, TokenInvalid
}
}
}
if token != nil {
if claims, ok := token.Claims.(*CustomClaims); ok && token.Valid {
return claims, nil
}
return nil, TokenInvalid
} else {
return nil, TokenInvalid
}
}
// 更新token
func (j *JWT) RefreshToken(tokenString string) (string, error) {
jwt.TimeFunc = func() time.Time {
return time.Unix(0, 0)
}
token, err := jwt.ParseWithClaims(tokenString, &CustomClaims{}, func(token *jwt.Token) (interface{}, error) {
return j.SigningKey, nil
})
if err != nil {
return "", err
}
if claims, ok := token.Claims.(*CustomClaims); ok && token.Valid {
jwt.TimeFunc = time.Now
claims.StandardClaims.ExpiresAt = time.Now().Add(1 * time.Hour).Unix()
return j.CreateToken(*claims)
}
return "", TokenInvalid
}
-64
View File
@@ -1,64 +0,0 @@
package middleware
import (
"bytes"
"gin-vue-admin/init/initlog"
"net/http/httputil"
"strings"
"time"
"github.com/gin-gonic/gin"
)
func Logger() gin.HandlerFunc {
return func(c *gin.Context) {
// request time
start := time.Now()
// request path
path := c.Request.URL.Path
logFlag := true
if strings.Contains(path, "swagger") {
logFlag = false
}
// request ip
clientIP := c.ClientIP()
// method
method := c.Request.Method
// copy request content
req, _ := httputil.DumpRequest(c.Request, true)
if logFlag {
log.L.Debug(
"Request:", method, clientIP, path, string(req))
}
// replace writer
cusWriter := &responseBodyWriter{
ResponseWriter: c.Writer,
body: bytes.NewBufferString(""),
}
c.Writer = cusWriter
// handle request
c.Next()
// ending time
end := time.Now()
//execute time
latency := end.Sub(start)
statusCode := c.Writer.Status()
if logFlag {
log.L.Debug(
"Response:",
statusCode,
latency,
cusWriter.body.String())
}
}
}
type responseBodyWriter struct {
gin.ResponseWriter
body *bytes.Buffer
}
func (w responseBodyWriter) Write(b []byte) (int, error) {
w.body.Write(b)
return w.ResponseWriter.Write(b)
}
@@ -1,150 +0,0 @@
package autoCodeModel
import (
"gin-vue-admin/tools"
"html/template"
"os"
)
// 初始版本自动化代码工具
type AutoCodeStruct struct {
StructName string `json:"structName"`
PackageName string `json:"packageName"`
Abbreviation string `json:"abbreviation"`
Fields []Field `json:"fields"`
}
type Field struct {
FieldName string `json:"fieldName"`
FieldType string `json:"fieldType"`
FieldJson string `json:"fieldJson"`
ColumnName string `json:"columnName"`
}
func (a *AutoCodeStruct) CreateTemp() (err error) {
basePath := "./tpl"
modelTmpl, err := template.ParseFiles(basePath + "/te/model.go.tpl")
if err != nil {
return err
}
apiTmpl, err := template.ParseFiles(basePath + "/te/api.go.tpl")
if err != nil {
return err
}
routerTmpl, err := template.ParseFiles(basePath + "/te/router.go.tpl")
if err != nil {
return err
}
feapiTmpl, err := template.ParseFiles(basePath + "/fe/api.js.tpl")
if err != nil {
return err
}
readmeTmpl, err := template.ParseFiles(basePath + "/readme.txt.tpl")
if err != nil {
return err
}
//自动化总目录
_autoCode := "./autoCode/"
//自动化后台代码目录
_te := "./autoCode/te/"
_dir := _te + a.PackageName
_modeldir := _te + a.PackageName + "/model"
_apidir := _te + a.PackageName + "/api"
_routerdir := _te + a.PackageName + "/router"
//自动化前台代码目录
_fe := "./autoCode/fe/"
_fe_dir := _fe + a.PackageName
_fe_apidir := _fe + a.PackageName + "/api"
err = createDir(_autoCode, _te, _dir, _modeldir, _apidir, _routerdir, _fe, _fe_dir, _fe_apidir)
if err != nil {
return err
}
model, err := os.OpenFile(_te+a.PackageName+"/model/model.go", os.O_CREATE|os.O_WRONLY, 0755)
if err != nil {
return err
}
api, err := os.OpenFile(_te+a.PackageName+"/api/api.go", os.O_CREATE|os.O_WRONLY, 0755)
if err != nil {
return err
}
router, err := os.OpenFile(_te+a.PackageName+"/router/router.go", os.O_CREATE|os.O_WRONLY, 0755)
if err != nil {
return err
}
feapi, err := os.OpenFile(_fe+a.PackageName+"/api/api.js", os.O_CREATE|os.O_WRONLY, 0755)
if err != nil {
return err
}
readme, err := os.OpenFile(_autoCode+"readme.txt", os.O_CREATE|os.O_WRONLY, 0755)
if err != nil {
return err
}
// 生成代码
{
err = modelTmpl.Execute(model, a)
if err != nil {
return err
}
err = apiTmpl.Execute(api, a)
if err != nil {
return err
}
err = routerTmpl.Execute(router, a)
if err != nil {
return err
}
err = feapiTmpl.Execute(feapi, a)
if err != nil {
return err
}
err = readmeTmpl.Execute(readme, a)
if err != nil {
return err
}
}
_ = model.Close()
_ = api.Close()
_ = router.Close()
_ = feapi.Close()
_ = readme.Close()
fileList := []string{
_te + a.PackageName + "/model/model.go",
_te + a.PackageName + "/api/api.go",
_te + a.PackageName + "/router/router.go",
_fe + a.PackageName + "/api/api.js",
_autoCode + "readme.txt",
}
err = tools.ZipFiles("./ginvueadmin.zip", fileList, ".", ".")
if err != nil {
return err
}
err = os.RemoveAll(_autoCode)
if err != nil {
return err
}
return nil
}
//批量创建文件夹
func createDir(dirs ...string) (err error) {
for _, v := range dirs {
exist, err := tools.PathExists(v)
if err != nil {
//log.L.Info(fmt.Sprintf("get dir error![%v]\n", err))
return err
}
if exist {
//log.L.Info(fmt.Sprintf("has dir![%v]\n"+_dir))
} else {
//log.L.Info(fmt.Sprintf("no dir![%v]\n"+_dir))
// 创建文件夹
err = os.Mkdir(v, os.ModePerm)
if err != nil {
//log.L.Error(fmt.Sprintf("mkdir error![%v]\n",err))
} else {
//log.L.Info("mkdir success!\n")
}
}
}
return err
}
@@ -1,72 +0,0 @@
package dbModel
import (
"gin-vue-admin/init/qmsql"
"github.com/jinzhu/gorm"
)
//文件结构体
type ExaFile struct {
gorm.Model
FileName string
FileMd5 string
FilePath string
ExaFileChunk []ExaFileChunk
ChunkTotal int
IsFinish bool
}
//切片结构体
type ExaFileChunk struct {
gorm.Model
ExaFileId uint
FileChunkNumber int
FileChunkPath string
}
//文件合成完成
func (f *ExaFile) FileCreateComplete(FileMd5 string, FileName string, FilePath string) error {
var file ExaFile
upDateFile := make(map[string]interface{})
upDateFile["FilePath"] = FilePath
upDateFile["IsFinish"] = true
err := qmsql.DEFAULTDB.Where("file_md5 = ? AND file_name = ?", FileMd5, FileName).First(&file).Updates(upDateFile).Error
return err
}
//第一次上传或者断点续传时候检测当前文件属性,没有则创建,有则返回文件的当前切片
func (f *ExaFile) FindOrCreateFile(FileMd5 string, FileName string, ChunkTotal int) (err error, file ExaFile) {
var cfile ExaFile
cfile.FileMd5 = FileMd5
cfile.FileName = FileName
cfile.ChunkTotal = ChunkTotal
notHaveSameMd5Finish := qmsql.DEFAULTDB.Where("file_md5 = ? AND is_finish = ?", FileMd5, true).First(&file).RecordNotFound()
if notHaveSameMd5Finish {
err = qmsql.DEFAULTDB.Where("file_md5 = ? AND file_name = ?", FileMd5, FileName).Preload("ExaFileChunk").FirstOrCreate(&file, cfile).Error
return err, file
} else {
cfile.IsFinish = true
cfile.FilePath = file.FilePath
err = qmsql.DEFAULTDB.Create(&cfile).Error
return err, cfile
}
}
// 创建文件切片记录
func (f *ExaFile) CreateFileChunk(FileChunkPath string, FileChunkNumber int) error {
var chunk ExaFileChunk
chunk.FileChunkPath = FileChunkPath
chunk.ExaFileId = f.ID
chunk.FileChunkNumber = FileChunkNumber
err := qmsql.DEFAULTDB.Create(&chunk).Error
return err
}
// 删除文件切片记录
func (f *ExaFile) DeleteFileChunk(fileMd5 string, fileName string, filePath string) error {
var chunks []ExaFileChunk
var file ExaFile
err := qmsql.DEFAULTDB.Where("file_md5 = ? AND file_name = ?", fileMd5, fileName).First(&file).Update("IsFinish", true).Update("file_path", filePath).Error
err = qmsql.DEFAULTDB.Where("exa_file_id = ?", file.ID).Delete(&chunks).Unscoped().Error
return err
}
@@ -1,68 +0,0 @@
package dbModel
import (
"gin-vue-admin/controller/servers"
"gin-vue-admin/init/qmsql"
"gin-vue-admin/model/modelInterface"
"gin-vue-admin/model/sysModel"
"github.com/jinzhu/gorm"
)
type ExaCustomer struct {
gorm.Model
CustomerName string `json:"customerName"`
CustomerPhoneData string `json:"customerPhoneData"`
SysUserID uint `json:"sysUserId"`
SysUserAuthorityID string `json:"sysUserAuthorityID"`
SysUser sysModel.SysUser `json:"sysUser"`
}
//创建用户
func (e *ExaCustomer)CreateExaCustomer()(err error){
err = qmsql.DEFAULTDB.Create(e).Error
return err
}
//删除用户
func (e *ExaCustomer)DeleteExaCustomer()(err error){
err = qmsql.DEFAULTDB.Delete(e).Error
return err
}
//更新用户
func (e *ExaCustomer)UpdataExaCustomer()(err error){
err = qmsql.DEFAULTDB.Save(e).Error
return err
}
//获取用户信息
func (e *ExaCustomer)GetExaCustomer()(err error,customer ExaCustomer){
err= qmsql.DEFAULTDB.Where("id = ?",e.ID).First(&customer).Error
return
}
//获取用户列表
// 分页获取数据 需要分页实现这个接口即可
func (e *ExaCustomer) GetInfoList(info modelInterface.PageInfo) (err error, list interface{}, total int) {
// 封装分页方法 调用即可 传入 当前的结构体和分页信息
err, db, total := servers.PagingServer(e, info)
if err != nil {
return
} else {
var a sysModel.SysAuthority
a.AuthorityId = e.SysUserAuthorityID
err,auth := a.GetAuthorityInfo()
var dataId []string
for _,v := range auth.DataAuthorityId{
dataId = append(dataId, v.AuthorityId)
}
var CustomerList []ExaCustomer
err = db.Where("sys_user_authority_id in (?)",dataId).Find(&CustomerList).Count(&total).Error
if err!=nil{
return err, CustomerList, total
}else{
err = db.Preload("SysUser").Where("sys_user_authority_id in (?)",dataId).Find(&CustomerList).Error
}
return err, CustomerList, total
}
}
@@ -1,45 +0,0 @@
package dbModel
import (
"gin-vue-admin/controller/servers"
"gin-vue-admin/init/qmsql"
"gin-vue-admin/model/modelInterface"
"github.com/jinzhu/gorm"
)
type ExaFileUploadAndDownload struct {
gorm.Model
Name string `json:"name"`
Url string `json:"url"`
Tag string `json:"tag"`
Key string `json:"key"`
}
func (f *ExaFileUploadAndDownload) Upload() error {
err := qmsql.DEFAULTDB.Create(f).Error
return err
}
func (f *ExaFileUploadAndDownload) DeleteFile() error {
err := qmsql.DEFAULTDB.Where("id = ?", f.ID).Unscoped().Delete(f).Error
return err
}
func (f *ExaFileUploadAndDownload) FindFile() (error, ExaFileUploadAndDownload) {
var file ExaFileUploadAndDownload
err := qmsql.DEFAULTDB.Where("id = ?", f.ID).First(&file).Error
return err, file
}
// 分页获取数据 需要分页实现这个接口即可
func (f *ExaFileUploadAndDownload) GetInfoList(info modelInterface.PageInfo) (err error, list interface{}, total int) {
// 封装分页方法 调用即可 传入 当前的结构体和分页信息
err, db, total := servers.PagingServer(f, info)
if err != nil {
return
} else {
var fileLists []ExaFileUploadAndDownload
err = db.Order("updated_at desc").Find(&fileLists).Error
return err, fileLists, total
}
}
@@ -1,14 +0,0 @@
package modelInterface
// 因为我也不确定项目要不要多人维护 所以定义了CURD接口 作为接口参考
// 由于很多接口使用Restful模式 暂时不用泛型 有需要可以iss提供示例
type PageInfo struct {
Page int
PageSize int
}
//分页接口
type Paging interface {
GetInfoList(PageInfo) (err error, list interface{}, total int)
}
-82
View File
@@ -1,82 +0,0 @@
package sysModel
import (
"gin-vue-admin/controller/servers"
"gin-vue-admin/init/qmsql"
"gin-vue-admin/model/modelInterface"
"github.com/jinzhu/gorm"
"github.com/pkg/errors"
)
type SysApi struct {
gorm.Model
Path string `json:"path"`
Description string `json:"description"`
Group string `json:"group"`
Method string `json:"method" gorm:"default:'POST'"`
}
//新增基础api
func (a *SysApi) CreateApi() (err error) {
findOne := qmsql.DEFAULTDB.Where("path = ?", a.Path).Find(&SysMenu{}).Error
if findOne == nil {
return errors.New("存在相同api")
} else {
err = qmsql.DEFAULTDB.Create(a).Error
}
return err
}
//删除基础api
func (a *SysApi) DeleteApi() (err error) {
err = qmsql.DEFAULTDB.Delete(a).Error
new(CasbinModel).clearCasbin(1, a.Path)
return err
}
//更新api
func (a *SysApi) UpdataApi() (err error) {
var oldA SysApi
err = qmsql.DEFAULTDB.Where("id = ?", a.ID).First(&oldA).Error
if err != nil {
return err
} else {
err = new(CasbinModel).CasbinApiUpdata(oldA.Path, a.Path)
if err != nil {
return err
} else {
err = qmsql.DEFAULTDB.Save(a).Error
}
}
return err
}
//获取选中角色所拥有的api
func (a *SysApi) GetApiById(id float64) (err error, api SysApi) {
err = qmsql.DEFAULTDB.Where("id = ?", id).First(&api).Error
return
}
// 获取所有api信息
func (a *SysApi) GetAllApis() (err error, apis []SysApi) {
err = qmsql.DEFAULTDB.Find(&apis).Error
return
}
// 分页获取数据 需要分页实现这个接口即可
func (a *SysApi) GetInfoList(info modelInterface.PageInfo) (err error, list interface{}, total int) {
// 封装分页方法 调用即可 传入 当前的结构体和分页信息
err, db, total := servers.PagingServer(a, info)
if err != nil {
return
} else {
var apiList []SysApi
err = qmsql.DEFAULTDB.Where("path LIKE ?", "%"+a.Path+"%").Find(&apiList).Count(&total).Error
if err!=nil{
return err, apiList, total
}else{
err = db.Order("group", true).Where("path LIKE ?", "%"+a.Path+"%").Find(&apiList).Error
}
return err, apiList, total
}
}
@@ -1,81 +0,0 @@
package sysModel
import (
"gin-vue-admin/controller/servers"
"gin-vue-admin/init/qmsql"
"gin-vue-admin/model/modelInterface"
"github.com/jinzhu/gorm"
"github.com/pkg/errors"
)
type SysAuthority struct {
gorm.Model
AuthorityId string `json:"authorityId" gorm:"not null;unique"`
AuthorityName string `json:"authorityName"`
ParentId string `json:"parentId"`
DataAuthorityId []SysAuthority `json:"dataAuthorityId" gorm:"many2many:sys_data_authority_id;association_jointable_foreignkey:data_id"`
Children []SysAuthority `json:"children"`
}
// 创建角色
func (a *SysAuthority) CreateAuthority() (err error, authority *SysAuthority) {
err = qmsql.DEFAULTDB.Create(a).Error
return err, a
}
// 删除角色
func (a *SysAuthority) DeleteAuthority() (err error) {
err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).Find(&SysUser{}).Error
if err != nil {
err = qmsql.DEFAULTDB.Where("parent_id = ?", a.AuthorityId).Find(&SysAuthority{}).Error
if err != nil {
err = qmsql.DEFAULTDB.Where("authority_id = ?", a.AuthorityId).First(a).Unscoped().Delete(a).Error
new(CasbinModel).clearCasbin(0, a.AuthorityId)
} else {
err = errors.New("此角色存在子角色不允许删除")
}
} else {
err = errors.New("此角色有用户正在使用禁止删除")
}
return err
}
// 分页获取数据 需要分页实现这个接口即可
func (a *SysAuthority) GetInfoList(info modelInterface.PageInfo) (err error, list interface{}, total int) {
// 封装分页方法 调用即可 传入 当前的结构体和分页信息
err, db, total := servers.PagingServer(a, info)
if err != nil {
return
} else {
var authority []SysAuthority
err = db.Preload("DataAuthorityId").Where("parent_id = 0").Find(&authority).Error
if len(authority) > 0 {
for k, _ := range authority {
err = findChildrenAuthority(&authority[k])
}
}
return err, authority, total
}
}
func findChildrenAuthority(authority *SysAuthority) (err error) {
err = qmsql.DEFAULTDB.Preload("DataAuthorityId").Where("parent_id = ?", authority.AuthorityId).Find(&authority.Children).Error
if len(authority.Children) > 0 {
for k, _ := range authority.Children {
err = findChildrenAuthority(&authority.Children[k])
}
}
return err
}
func (a *SysAuthority) SetDataAuthority() error {
var s SysAuthority
qmsql.DEFAULTDB.Preload("DataAuthorityId").First(&s, "id = ?", a.ID)
err := qmsql.DEFAULTDB.Model(&s).Association("DataAuthorityId").Replace(&a.DataAuthorityId).Error
return err
}
func (a *SysAuthority) GetAuthorityInfo() (err error, sa SysAuthority) {
err = qmsql.DEFAULTDB.Preload("DataAuthorityId").Where("authority_id = ?", a.AuthorityId).First(&sa).Error
return err, sa
}
@@ -1,105 +0,0 @@
package sysModel
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/init/qmsql"
"gin-vue-admin/model/modelInterface"
"github.com/jinzhu/gorm"
"github.com/pkg/errors"
)
type SysBaseMenu struct {
gorm.Model
MenuLevel uint `json:"-"`
ParentId string `json:"parentId"`
Path string `json:"path"`
Name string `json:"name"`
Hidden bool `json:"hidden"`
Component string `json:"component"`
Sort string `json:"sort"`
Meta `json:"meta"`
NickName string `json:"nickName"`
Children []SysBaseMenu `json:"children"`
}
//增加基础路由
func (b *SysBaseMenu) AddBaseMenu() (err error) {
findOne := qmsql.DEFAULTDB.Where("name = ?", b.Name).Find(&SysBaseMenu{}).Error
if findOne != nil {
b.NickName = b.Title
err = qmsql.DEFAULTDB.Create(b).Error
} else {
err = errors.New("存在重复name,请修改name")
}
return err
}
//删除基础路由
func (b *SysBaseMenu) DeleteBaseMenu(id float64) (err error) {
err = qmsql.DEFAULTDB.Where("parent_id = ?", id).First(&SysBaseMenu{}).Error
if err != nil {
err = qmsql.DEFAULTDB.Where("id = ?", id).Delete(&b).Error
err = qmsql.DEFAULTDB.Where("menu_id = ?", id).Unscoped().Delete(&SysMenu{}).Error
} else {
return errors.New("此菜单存在子菜单不可删除")
}
return err
}
//更新路由
func (b *SysBaseMenu) UpdataBaseMenu() (err error) {
upDataMap := make(map[string]interface{})
upDataMap["parent_id"] = b.ParentId
upDataMap["path"] = b.Path
upDataMap["name"] = b.Name
upDataMap["hidden"] = b.Hidden
upDataMap["component"] = b.Component
upDataMap["title"] = b.Title
upDataMap["icon"] = b.Icon
upDataMap["sort"] = b.Sort
upDataMap["nick_name"] = b.Title
err = qmsql.DEFAULTDB.Where("id = ?", b.ID).Find(&SysBaseMenu{}).Updates(upDataMap).Error
err1 := qmsql.DEFAULTDB.Where("menu_id = ?", b.ID).Find(&[]SysMenu{}).Updates(upDataMap).Error
fmt.Printf("菜单修改时候,关联菜单err1:%v,err:%v", err1, err)
return err
}
//当前选中角色所拥有的路由
func (b *SysBaseMenu) GetBaseMenuById(id float64) (err error, menu SysBaseMenu) {
err = qmsql.DEFAULTDB.Where("id = ?", id).First(&menu).Error
return
}
//获取路由分页
func (b *SysBaseMenu) GetInfoList(info modelInterface.PageInfo) (err error, list interface{}, total int) {
// 封装分页方法 调用即可 传入 当前的结构体和分页信息
err, db, total := servers.PagingServer(b, info)
if err != nil {
return
} else {
var menuList []SysBaseMenu
err = db.Where("parent_id = 0").Order("sort", true).Find(&menuList).Error
for i := 0; i < len(menuList); i++ {
err = getBaseChildrenList(&menuList[i])
}
return err, menuList, total
}
}
//获取基础路由树
func (m *SysBaseMenu) GetBaseMenuTree() (err error, menus []SysBaseMenu) {
err = qmsql.DEFAULTDB.Where(" parent_id = ?", 0).Order("sort", true).Find(&menus).Error
for i := 0; i < len(menus); i++ {
err = getBaseChildrenList(&menus[i])
}
return err, menus
}
func getBaseChildrenList(menu *SysBaseMenu) (err error) {
err = qmsql.DEFAULTDB.Where("parent_id = ?", menu.ID).Order("sort", true).Find(&menu.Children).Error
for i := 0; i < len(menu.Children); i++ {
err = getBaseChildrenList(&menu.Children[i])
}
return err
}
-105
View File
@@ -1,105 +0,0 @@
package sysModel
import (
"errors"
"gin-vue-admin/config"
"gin-vue-admin/init/qmsql"
"github.com/casbin/casbin"
"github.com/casbin/casbin/util"
gormadapter "github.com/casbin/gorm-adapter"
"strings"
)
type CasbinModel struct {
ID uint `json:"id" gorm:"column:_id"`
Ptype string `json:"ptype" gorm:"column:ptype"`
AuthorityId string `json:"rolename" gorm:"column:v0"`
Path string `json:"path" gorm:"column:v1"`
Method string `json:"method" gorm:"column:v2"`
}
// 供入参使用
type CasbinInfo struct {
Path string `json:"path"`
Method string `json:"method"`
}
// 供入参使用
type CasbinInReceive struct {
AuthorityId string `json:"authorityId"`
CasbinInfos []CasbinInfo `json:"casbinInfos"`
}
// 更新权限
func (c *CasbinModel) CasbinPUpdata(AuthorityId string, casbinInfos []CasbinInfo) error {
c.clearCasbin(0, AuthorityId)
for _, v := range casbinInfos {
cm := CasbinModel{
ID: 0,
Ptype: "p",
AuthorityId: AuthorityId,
Path: v.Path,
Method: v.Method,
}
addflag := c.AddCasbin(cm)
if addflag == false {
return errors.New("存在相同api,添加失败,请联系管理员")
}
}
return nil
}
// API更新随动
func (c *CasbinModel) CasbinApiUpdata(oldPath string, newPath string) error {
var cs []CasbinModel
err := qmsql.DEFAULTDB.Table("casbin_rule").Where("v1 = ?", oldPath).Find(&cs).Update("v1", newPath).Error
return err
}
//添加权限
func (c *CasbinModel) AddCasbin(cm CasbinModel) bool {
e := Casbin()
return e.AddPolicy(cm.AuthorityId, cm.Path, cm.Method)
}
//获取权限列表
func (c *CasbinModel) GetPolicyPathByAuthorityId(AuthorityId string) []string {
e := Casbin()
var pathList []string
list := e.GetFilteredPolicy(0, AuthorityId)
for _, v := range list {
pathList = append(pathList, v[1])
}
return pathList
}
//清除匹配的权限
func (c *CasbinModel) clearCasbin(v int, p string) bool {
e := Casbin()
return e.RemoveFilteredPolicy(v, p)
}
// 自定义规则函数
func ParamsMatch(fullNameKey1 string, key2 string) bool {
key1 := strings.Split(fullNameKey1, "?")[0]
//剥离路径后再使用casbin的keyMatch2
return util.KeyMatch2(key1, key2)
}
// 自定义规则函数
func ParamsMatchFunc(args ...interface{}) (interface{}, error) {
name1 := args[0].(string)
name2 := args[1].(string)
return (bool)(ParamsMatch(name1, name2)), nil
}
//持久化到数据库 引入自定义规则
func Casbin() *casbin.Enforcer {
a := gormadapter.NewAdapterByDB(qmsql.DEFAULTDB)
e := casbin.NewEnforcer(config.GinVueAdminconfig.CasbinConfig.ModelPath, a)
e.AddFunction("ParamsMatch", ParamsMatchFunc)
e.LoadPolicy()
return e
}
@@ -1,35 +0,0 @@
package sysModel
import (
"gin-vue-admin/init/initRedis"
"gin-vue-admin/init/qmsql"
"github.com/jinzhu/gorm"
)
type JwtBlacklist struct {
gorm.Model
Jwt string `gorm:"type:text"`
}
func (j *JwtBlacklist) JsonInBlacklist() (err error) {
err = qmsql.DEFAULTDB.Create(j).Error
return
}
//判断JWT是否在黑名单内部
func (j *JwtBlacklist) IsBlacklist(Jwt string) bool {
isNotFound := qmsql.DEFAULTDB.Where("jwt = ?", Jwt).First(j).RecordNotFound()
return !isNotFound
}
//判断当前用户是否在线
func (j *JwtBlacklist) GetRedisJWT(userName string) (err error, RedisJWT string) {
RedisJWT, err = initRedis.DEFAULTREDIS.Get(userName).Result()
return err, RedisJWT
}
//设置当前用户在线
func (j *JwtBlacklist) SetRedisJWT(userName string) (err error) {
err = initRedis.DEFAULTREDIS.Set(userName, j.Jwt, 1000*1000*1000*60*60*24*7).Err()
return err
}
@@ -1,59 +0,0 @@
package sysModel
import (
"fmt"
"gin-vue-admin/init/qmsql"
)
// menu需要构建的点有点多 这里关联关系表直接把所有数据拿过来 用代码实现关联 后期实现主外键模式
type SysMenu struct {
SysBaseMenu
MenuId string `json:"menuId"`
AuthorityId string `json:"-"`
Children []SysMenu `json:"children"`
}
type Meta struct {
Title string `json:"title"`
Icon string `json:"icon"`
}
// 为角色增加menu树
func (m *SysMenu) AddMenuAuthority(menus []SysBaseMenu, authorityId string) (err error) {
var menu SysMenu
qmsql.DEFAULTDB.Where("authority_id = ? ", authorityId).Unscoped().Delete(&SysMenu{})
for _, v := range menus {
menu.SysBaseMenu = v
menu.AuthorityId = authorityId
menu.MenuId = fmt.Sprintf("%v", v.ID)
menu.ID = 0
err = qmsql.DEFAULTDB.Create(&menu).Error
if err != nil {
return err
}
}
return nil
}
// 查看当前角色树
func (m *SysMenu) GetMenuAuthority(authorityId string) (err error, menus []SysMenu) {
err = qmsql.DEFAULTDB.Where("authority_id = ?", authorityId).Find(&menus).Error
return err, menus
}
//获取动态路由树
func (m *SysMenu) GetMenuTree(authorityId string) (err error, menus []SysMenu) {
err = qmsql.DEFAULTDB.Where("authority_id = ? AND parent_id = ?", authorityId, 0).Order("sort", true).Find(&menus).Error
for i := 0; i < len(menus); i++ {
err = getChildrenList(&menus[i])
}
return err, menus
}
func getChildrenList(menu *SysMenu) (err error) {
err = qmsql.DEFAULTDB.Where("authority_id = ? AND parent_id = ?", menu.AuthorityId, menu.MenuId).Order("sort", true).Find(&menu.Children).Error
for i := 0; i < len(menu.Children); i++ {
err = getChildrenList(&menu.Children[i])
}
return err
}
-26
View File
@@ -1,26 +0,0 @@
package sysModel
import (
"gin-vue-admin/config"
"gin-vue-admin/tools"
)
//配置文件结构体
type System struct {
Config config.Config
}
//读取配置文件
func (s *System) GetSystemConfig() (err error, conf config.Config) {
return nil, config.GinVueAdminconfig
}
//设置配置文件
func (s *System) SetSystemConfig() (err error) {
confs := tools.StructToMap(s.Config)
for k, v := range confs {
config.VTool.Set(k, v)
}
err = config.VTool.WriteConfig()
return err
}
-90
View File
@@ -1,90 +0,0 @@
package sysModel
import (
"gin-vue-admin/controller/servers"
"gin-vue-admin/init/qmsql"
"gin-vue-admin/model/modelInterface"
"gin-vue-admin/tools"
"github.com/jinzhu/gorm"
"github.com/pkg/errors"
uuid "github.com/satori/go.uuid"
)
type SysUser struct {
gorm.Model
UUID uuid.UUID `json:"uuid"`
Username string `json:"userName"`
Password string `json:"-"`
NickName string `json:"nickName" gorm:"default:'QMPlusUser'"`
HeaderImg string `json:"headerImg" gorm:"default:'http://www.henrongyi.top/avatar/lufu.jpg'"`
Authority SysAuthority `json:"authority" gorm:"ForeignKey:AuthorityId;AssociationForeignKey:AuthorityId"`
AuthorityId string `json:"authorityId" gorm:"default:888"`
}
//type Propertie struct {
// gorm.Model
//}
//注册接口model方法
func (u *SysUser) Regist() (err error, userInter *SysUser) {
var user SysUser
//判断用户名是否注册
notResigt := qmsql.DEFAULTDB.Where("username = ?", u.Username).First(&user).RecordNotFound()
//notResigt为false表明读取到了 不能注册
if !notResigt {
return errors.New("用户名已注册"), nil
} else {
// 否则 附加uuid 密码md5简单加密 注册
u.Password = tools.MD5V([]byte(u.Password))
u.UUID = uuid.NewV4()
err = qmsql.DEFAULTDB.Create(u).Error
}
return err, u
}
//修改用户密码
func (u *SysUser) ChangePassword(newPassword string) (err error, userInter *SysUser) {
var user SysUser
//后期修改jwt+password模式
u.Password = tools.MD5V([]byte(u.Password))
err = qmsql.DEFAULTDB.Where("username = ? AND password = ?", u.Username, u.Password).First(&user).Update("password", tools.MD5V([]byte(newPassword))).Error
return err, u
}
//用户更新接口
func (u *SysUser) SetUserAuthority(uuid uuid.UUID, AuthorityId string) (err error) {
err = qmsql.DEFAULTDB.Where("uuid = ?", uuid).First(&SysUser{}).Update("authority_id", AuthorityId).Error
return err
}
//用户登录
func (u *SysUser) Login() (err error, userInter *SysUser) {
var user SysUser
u.Password = tools.MD5V([]byte(u.Password))
err = qmsql.DEFAULTDB.Where("username = ? AND password = ?", u.Username, u.Password).First(&user).Error
if err != nil {
return err, &user
}
err = qmsql.DEFAULTDB.Where("authority_id = ?", user.AuthorityId).First(&user.Authority).Error
return err, &user
}
// 用户头像上传更新地址
func (u *SysUser) UploadHeaderImg(uuid uuid.UUID, filePath string) (err error, userInter *SysUser) {
var user SysUser
err = qmsql.DEFAULTDB.Where("uuid = ?", uuid).First(&user).Update("header_img", filePath).First(&user).Error
return err, &user
}
// 分页获取数据 需要分页实现这个接口即可
func (u *SysUser) GetInfoList(info modelInterface.PageInfo) (err error, list interface{}, total int) {
// 封装分页方法 调用即可 传入 当前的结构体和分页信息
err, db, total := servers.PagingServer(u, info)
if err != nil {
return
} else {
var userList []SysUser
err = db.Preload("Authority").Find(&userList).Error
return err, userList, total
}
}
@@ -1,32 +0,0 @@
package sysModel
import (
"gin-vue-admin/init/qmsql"
"github.com/jinzhu/gorm"
)
//工作流属性表
type SysWorkflow struct {
gorm.Model
WorkflowNickName string `json:"workflowNickName"` // 工作流名称
WorkflowName string `json:"workflowName"` // 工作流英文id
WorkflowDescription string `json:"workflowDescription"` // 工作流描述
WorkflowStepInfo []SysWorkflowStepInfo `json:"workflowStep"` // 工作流步骤
}
// 工作流状态表
type SysWorkflowStepInfo struct {
gorm.Model
SysWorkflowID uint `json:"workflowID"` // 所属工作流ID
IsStrat bool `json:"isStrat"` // 是否是开始流节点
StepName string `json:"stepName"` // 工作流名称
StepNo float64 `json:"stepNo"` // 步骤id (第几步)
StepAuthorityID string `json:"stepAuthorityID"` // 操作者级别id
IsEnd bool `json:"isEnd"` // 是否是完结流节点
}
//创建工作流
func (wk *SysWorkflow) Create() error {
err := qmsql.DEFAULTDB.Create(&wk).Error
return err
}
@@ -1,14 +0,0 @@
package sysModel
import "github.com/jinzhu/gorm"
// 工作流流转表
type SysWorkFlowProcess struct {
gorm.Model
ApplicationID uint // 当前工作流所属申请的ID
CurrentNode string // 当前进度节点
HistoricalNode string //上一个进度节点
CurrentUser string // 当前进度操作人
HistoricalUser string // 上一个进度的操作人
State bool // 状态 是否是正在进行的状态
}
-18
View File
@@ -1,18 +0,0 @@
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func InitCustomerRouter(Router *gin.RouterGroup) {
ApiRouter := Router.Group("customer").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
{
ApiRouter.POST("createExaCustomer", api.CreateExaCustomer) // 创建客户
ApiRouter.POST("updataExaCustomer", api.UpdataExaCustomer) // 更新客户
ApiRouter.POST("deleteExaCustomer", api.DeleteExaCustomer) // 删除客户
ApiRouter.POST("getExaCustomer", api.GetExaCustomer) // 获取单一客户信息
ApiRouter.POST("getExaCustomerList", api.GetExaCustomerList) // 获取客户列表
}
}
@@ -1,20 +0,0 @@
package router
import (
"gin-vue-admin/controller/api"
"github.com/gin-gonic/gin"
)
func InitFileUploadAndDownloadRouter(Router *gin.RouterGroup) {
FileUploadAndDownloadGroup := Router.Group("fileUploadAndDownload")
//.Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
{
FileUploadAndDownloadGroup.POST("/upload", api.UploadFile) // 上传文件
FileUploadAndDownloadGroup.POST("/getFileList", api.GetFileList) // 获取上传文件列表
FileUploadAndDownloadGroup.POST("/deleteFile", api.DeleteFile) // 删除指定文件
FileUploadAndDownloadGroup.POST("/breakpointContinue", api.BreakpointContinue) // 断点续传
FileUploadAndDownloadGroup.GET("/findFile", api.FindFile) // 查询当前文件成功的切片
FileUploadAndDownloadGroup.POST("/breakpointContinueFinish", api.BreakpointContinueFinish) // 查询当前文件成功的切片
FileUploadAndDownloadGroup.POST("/removeChunk", api.RemoveChunk) // 查询当前文件成功的切片
}
}
-19
View File
@@ -1,19 +0,0 @@
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func InitApiRouter(Router *gin.RouterGroup) {
ApiRouter := Router.Group("api").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
{
ApiRouter.POST("createApi", api.CreateApi) //创建Api
ApiRouter.POST("deleteApi", api.DeleteApi) //删除Api
ApiRouter.POST("getApiList", api.GetApiList) //获取Api列表
ApiRouter.POST("getApiById", api.GetApiById) //获取单条Api消息
ApiRouter.POST("updataApi", api.UpdataApi) //更新api
ApiRouter.POST("getAllApis", api.GetAllApis) // 获取所有api
}
}
-17
View File
@@ -1,17 +0,0 @@
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func InitAuthorityRouter(Router *gin.RouterGroup) {
AuthorityRouter := Router.Group("authority").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
{
AuthorityRouter.POST("createAuthority", api.CreateAuthority) //创建角色
AuthorityRouter.POST("deleteAuthority", api.DeleteAuthority) //删除角色
AuthorityRouter.POST("getAuthorityList", api.GetAuthorityList) //获取角色列表
AuthorityRouter.POST("setDataAuthority", api.SetDataAuthority) //设置角色资源权限
}
}
-14
View File
@@ -1,14 +0,0 @@
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func InitAutoCodeRouter(Router *gin.RouterGroup) {
AutoCodeRouter := Router.Group("autoCode").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
{
AutoCodeRouter.POST("createTemp", api.CreateTemp) //创建自动化代码
}
}
-17
View File
@@ -1,17 +0,0 @@
package router
import (
"gin-vue-admin/controller/api"
"github.com/gin-gonic/gin"
)
func InitBaseRouter(Router *gin.RouterGroup) (R gin.IRoutes) {
BaseRouter := Router.Group("base")
{
BaseRouter.POST("regist", api.Regist)
BaseRouter.POST("login", api.Login)
BaseRouter.POST("captcha",api.Captcha)
BaseRouter.GET("captcha/:captchaId",api.CaptchaImg)
}
return BaseRouter
}
-16
View File
@@ -1,16 +0,0 @@
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func InitCasbinRouter(Router *gin.RouterGroup) {
CasbinRouter := Router.Group("casbin").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
{
CasbinRouter.POST("casbinPUpdata", api.CasbinPUpdata)
CasbinRouter.POST("getPolicyPathByAuthorityId", api.GetPolicyPathByAuthorityId)
CasbinRouter.GET("casbinTest/:pathParam", api.CasbinTest)
}
}
-23
View File
@@ -1,23 +0,0 @@
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func InitMenuRouter(Router *gin.RouterGroup) (R gin.IRoutes) {
MenuRouter := Router.Group("menu").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
{
MenuRouter.POST("getMenu", api.GetMenu) //获取菜单树
MenuRouter.POST("getMenuList", api.GetMenuList) // 分页获取基础menu列表
MenuRouter.POST("addBaseMenu", api.AddBaseMenu) // 新增菜单
MenuRouter.POST("getBaseMenuTree", api.GetBaseMenuTree) // 获取用户动态路由
MenuRouter.POST("addMenuAuthority", api.AddMenuAuthority) // 增加menu和角色关联关系
MenuRouter.POST("getMenuAuthority", api.GetMenuAuthority) // 获取指定角色menu
MenuRouter.POST("deleteBaseMenu", api.DeleteBaseMenu) // 删除菜单
MenuRouter.POST("updataBaseMenu", api.UpdataBaseMenu) // 更新菜单
MenuRouter.POST("getBaseMenuById", api.GetBaseMenuById) //根据id获取菜单
}
return MenuRouter
}
-15
View File
@@ -1,15 +0,0 @@
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func InitSystemRouter(Router *gin.RouterGroup) {
UserRouter := Router.Group("system").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
{
UserRouter.POST("getSystemConfig", api.GetSystemConfig) // 获取配置文件内容
UserRouter.POST("setSystemConfig", api.SetSystemConfig) // 设置配置文件内容
}
}
-17
View File
@@ -1,17 +0,0 @@
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func InitUserRouter(Router *gin.RouterGroup) {
UserRouter := Router.Group("user").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
{
UserRouter.POST("changePassword", api.ChangePassword) // 修改密码
UserRouter.POST("uploadHeaderImg", api.UploadHeaderImg) //上传头像
UserRouter.POST("getUserList", api.GetUserList) // 分页获取用户列表
UserRouter.POST("setUserAuthority", api.SetUserAuthority) //设置用户权限
}
}
-43
View File
@@ -1,43 +0,0 @@
{
"casbinconfig": {
"modelPath": "./static/rbacmodel/rbac_model.conf"
},
"jwt": {
"signingKey": "qmPlus"
},
"mysqladmin": {
"username": "root",
"password": "Aa@6447985",
"path": "127.0.0.1:3306",
"dbname": "qmPlus",
"config": "charset=utf8\u0026parseTime=True\u0026loc=Local",
"maxIdleConns": 10,
"maxOpenConns": 100,
"logMode": true
},
"qiniu": {
"accessKey": "25j8dYBZ2wuiy0yhwShytjZDTX662b8xiFguwxzZ",
"secretKey": "pgdbqEsf7ooZh7W3xokP833h3dZ_VecFXPDeG5JY"
},
"redisadmin": {
"addr": "127.0.0.1:6379",
"password": "",
"db": 0
},
"system": {
"useMultipoint": false,
"env": "develop",
"addr": 8888
},
"captcha": {
"keyLong": 6,
"imgWidth": 120,
"imgHeight": 40
},
"log": {
"prefix": "[GIN-VUE-ADMIN]",
"logFile": false,
"stdout": ["DEBUG"],
"file": ["WARNING"]
}
}
-10
View File
@@ -1,10 +0,0 @@
package tools
import (
"fmt"
"strings"
)
func ArrayToString(array []interface{}) string {
return strings.Replace(strings.Trim(fmt.Sprint(array), "[]"), " ", ",", -1)
}
-41
View File
@@ -1,41 +0,0 @@
package tools
import (
"bytes"
"crypto/cipher"
"crypto/des"
)
func padding(src []byte, blocksize int) []byte {
n := len(src)
padnum := blocksize - n%blocksize
pad := bytes.Repeat([]byte{byte(padnum)}, padnum)
dst := append(src, pad...)
return dst
}
func unpadding(src []byte) []byte {
n := len(src)
unpadnum := int(src[n-1])
dst := src[:n-unpadnum]
return dst
}
func EncryptDES(src []byte) []byte {
key := []byte("qimiao66")
block, _ := des.NewCipher(key)
src = padding(src, block.BlockSize())
blockmode := cipher.NewCBCEncrypter(block, key)
blockmode.CryptBlocks(src, src)
return src
}
func DecryptDES(src []byte) []byte {
key := []byte("qimiao66")
block, _ := des.NewCipher(key)
blockmode := cipher.NewCBCDecrypter(block, key)
blockmode.CryptBlocks(src, src)
src = unpadding(src)
return src
}
-14
View File
@@ -1,14 +0,0 @@
package tools
import "os"
func PathExists(path string) (bool, error) {
_, err := os.Stat(path)
if err == nil {
return true, nil
}
if os.IsNotExist(err) {
return false, nil
}
return false, err
}
-38
View File
@@ -1,38 +0,0 @@
// 空值校验工具 仅用于检验空字符串 其余类型请勿使用
package tools
import (
"errors"
"fmt"
"reflect"
)
func HasGap(input interface{}) error {
getType := reflect.TypeOf(input)
getValue := reflect.ValueOf(input)
// 获取方法字段
for i := 0; i < getType.NumField(); i++ {
field := getType.Field(i)
value := getValue.Field(i).Interface()
switch value.(type) {
case string:
if value == "" {
fmt.Printf("%s为空", field.Name)
return errors.New(fmt.Sprintf("%s为空", field.Name))
}
default:
if value == nil {
fmt.Printf("%s为空", field.Name)
return errors.New(fmt.Sprintf("%s为空", field.Name))
}
}
}
// 获取方法
// 1. 先获取interface的reflect.Type,然后通过.NumMethod进行遍历
//for i := 0; i < getType.NumMethod(); i++ {
// m := getType.Method(i)
// fmt.Printf("%s: %v\n", m.Name, m.Type)
//}
return nil
}
-15
View File
@@ -1,15 +0,0 @@
package tools
import "reflect"
// 利用反射将结构体转化为map
func StructToMap(obj interface{}) map[string]interface{}{
obj1 := reflect.TypeOf(obj)
obj2 := reflect.ValueOf(obj)
var data = make(map[string]interface{})
for i := 0; i < obj1.NumField(); i++ {
data[obj1.Field(i).Name] = obj2.Field(i).Interface()
}
return data
}
-118
View File
@@ -1,118 +0,0 @@
package api
import (
"fmt"
"gin-vue-admin/controller/servers"
"gin-vue-admin/model/modelInterface"
// 请自行引入model路径
"github.com/gin-gonic/gin"
)
// @Tags {{.StructName}}
// @Summary 创建{{.StructName}}
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body {{.PackageName}}.{{.StructName}} true "创建{{.StructName}}"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /{{.Abbreviation}}/create{{.StructName}} [post]
func Create{{.StructName}}(c *gin.Context) {
var {{.Abbreviation}} {{.PackageName}}.{{.StructName}}
_ = c.ShouldBindJSON(&{{.Abbreviation}})
err := {{.Abbreviation}}.Create{{.StructName}}()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("创建失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "创建成功", gin.H{})
}
}
// @Tags {{.StructName}}
// @Summary 删除{{.StructName}}
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body {{.PackageName}}.{{.StructName}} true "删除{{.StructName}}"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /{{.Abbreviation}}/delete{{.StructName}} [post]
func Delete{{.StructName}}(c *gin.Context) {
var {{.Abbreviation}} {{.PackageName}}.{{.StructName}}
_ = c.ShouldBindJSON(&{{.Abbreviation}})
err := {{.Abbreviation}}.Delete{{.StructName}}()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("删除失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "创建成功", gin.H{})
}
}
// @Tags {{.StructName}}
// @Summary 更新{{.StructName}}
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body {{.PackageName}}.{{.StructName}} true "更新{{.StructName}}"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /{{.Abbreviation}}/update{{.StructName}} [post]
func Update{{.StructName}}(c *gin.Context) {
var {{.Abbreviation}} {{.PackageName}}.{{.StructName}}
_ = c.ShouldBindJSON(&{{.Abbreviation}})
err,re{{.Abbreviation}} := {{.Abbreviation}}.Update{{.StructName}}()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("更新失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "更新成功", gin.H{
"re{{.Abbreviation}}":re{{.Abbreviation}},
})
}
}
// @Tags {{.StructName}}
// @Summary 用id查询{{.StructName}}
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body {{.PackageName}}.{{.StructName}} true "用id查询{{.StructName}}"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /{{.Abbreviation}}/find{{.StructName}} [post]
func Find{{.StructName}}(c *gin.Context) {
var {{.Abbreviation}} {{.PackageName}}.{{.StructName}}
_ = c.ShouldBindJSON(&{{.Abbreviation}})
err,re{{.Abbreviation}} := {{.Abbreviation}}.FindById()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("查询失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "查询成功", gin.H{
"re{{.Abbreviation}}":re{{.Abbreviation}},
})
}
}
// @Tags {{.StructName}}
// @Summary 分页获取{{.StructName}}列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "分页获取{{.StructName}}列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /{{.Abbreviation}}/get{{.StructName}}List [post]
func Get{{.StructName}}List(c *gin.Context) {
var pageInfo modelInterface.PageInfo
_ = c.ShouldBindJSON(&pageInfo)
err, list, total := new({{.PackageName}}.{{.StructName}}).GetInfoList(pageInfo)
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("获取数据失败,%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "获取数据成功", gin.H{
"{{.PackageName}}List": list,
"total": total,
"page": pageInfo.Page,
"pageSize": pageInfo.PageSize,
})
}
}
-51
View File
@@ -1,51 +0,0 @@
// 自动生成模板{{.StructName}}
package {{.PackageName}}
import (
"gin-vue-admin/controller/servers"
"gin-vue-admin/init/qmsql"
"gin-vue-admin/model/modelInterface"
"github.com/jinzhu/gorm"
)
type {{.StructName}} struct {
gorm.Model {{range .Fields}}
{{.FieldName}} {{.FieldType}} `json:"{{.FieldJson}}"{{if .ColumnName}} gorm:"column:{{.ColumnName}}"{{end}}`{{ end }}
}
// 创建{{.StructName}}
func ({{.Abbreviation}} *{{.StructName}})Create{{.StructName}}()(err error){
err = qmsql.DEFAULTDB.Create({{.Abbreviation}}).Error
return err
}
// 删除{{.StructName}}
func ({{.Abbreviation}} *{{.StructName}})Delete{{.StructName}}()(err error){
err = qmsql.DEFAULTDB.Delete({{.Abbreviation}}).Error
return err
}
// 更新{{.StructName}}
func ({{.Abbreviation}} *{{.StructName}})Update{{.StructName}}()(err error, re{{.Abbreviation}} {{.StructName}}){
err = qmsql.DEFAULTDB.Save({{.Abbreviation}}).Error
return err, *{{.Abbreviation}}
}
// 根据ID查看单条{{.StructName}}
func ({{.Abbreviation}} *{{.StructName}})FindById()(err error,re{{.Abbreviation}} {{.StructName}}){
err = qmsql.DEFAULTDB.Where("id = ?",{{.Abbreviation}}.ID).First(&re{{.Abbreviation}}).Error
return err,re{{.Abbreviation}}
}
// 分页获取{{.StructName}}
func ({{.Abbreviation}} *{{.StructName}})GetInfoList(info modelInterface.PageInfo)(err error, list interface{}, total int){
// 封装分页方法 调用即可 传入 当前的结构体和分页信息
err, db, total := servers.PagingServer({{.Abbreviation}}, info)
if err != nil {
return
} else {
var re{{.StructName}}List []{{.StructName}}
err = db.Find(&re{{.StructName}}List).Error
return err, re{{.StructName}}List, total
}
}
-18
View File
@@ -1,18 +0,0 @@
package router
import (
"gin-vue-admin/controller/api"
"gin-vue-admin/middleware"
"github.com/gin-gonic/gin"
)
func Init{{.StructName}}Router(Router *gin.RouterGroup) {
{{.StructName}}Router := Router.Group("{{.Abbreviation}}").Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
{
{{.StructName}}Router.POST("create{{.StructName}}", api.Create{{.StructName}}) // 新建{{.StructName}}
{{.StructName}}Router.POST("delete{{.StructName}}", api.Delete{{.StructName}}) //删除{{.StructName}}
{{.StructName}}Router.POST("update{{.StructName}}", api.Update{{.StructName}}) //更新{{.StructName}}
{{.StructName}}Router.POST("find{{.StructName}} ", api.Find{{.StructName}}) // 根据ID获取{{.StructName}}
{{.StructName}}Router.POST("get{{.StructName}}List", api.Get{{.StructName}}List) //获取{{.StructName}}列表
}
}
-2
View File
@@ -1,2 +0,0 @@
ENV = 'production'
VUE_APP_BASE_API = '/v1'
-21
View File
@@ -1,21 +0,0 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
-12384
View File
File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

-21
View File
@@ -1,21 +0,0 @@
import service from '@/utils/request'
// @Tags api
// @Summary 分页获取角色列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body modelInterface.PageInfo true "分页获取用户列表"
// @Success 200 {string} json "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /api/getApiList [post]
// {
// page int
// pageSize int
// }
export const createTemp = (data) => {
return service({
url: "/autoCode/createTemp",
method: 'post',
data,
responseType: 'blob'
})
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

@@ -1,32 +0,0 @@
export default {
data() {
return {
page: 1,
total: 10,
pageSize: 10,
tableData: [],
searchInfo: {}
}
},
methods: {
handleSizeChange(val) {
this.pageSize = val
this.getTableData()
},
handleCurrentChange(val) {
this.page = val
this.getTableData()
},
async getTableData(page = this.page, pageSize = this.pageSize) {
const table = await this.listApi({ page, pageSize, ...this.searchInfo })
this.tableData = table.data[this.listKey]
this.total = table.data.total
this.page = table.data.page
this.pageSize = table.data.pageSize
}
},
mounted() {
this.getTableData()
}
}
-850
View File
@@ -1,850 +0,0 @@
/* Document
========================================================================== */
/**
* 1. Correct the line height in all browsers.
* 2. Prevent adjustments of font size after orientation changes in iOS.
*/
html {
line-height: 1.15;
/* 1 */
-webkit-text-size-adjust: 100%;
/* 2 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
body {
margin: 0;
}
/**
* Render the `main` element consistently in IE.
*/
main {
display: block;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box;
/* 1 */
height: 0;
/* 1 */
overflow: visible;
/* 2 */
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* Remove the gray background on active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* 1. Remove the bottom border in Chrome 57-
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none;
/* 1 */
text-decoration: underline;
/* 2 */
text-decoration: underline dotted;
/* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace;
/* 1 */
font-size: 1em;
/* 2 */
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* Remove the border on images inside links in IE 10.
*/
img {
border-style: none;
}
/* Forms
========================================================================== */
/**
* 1. Change the font styles in all browsers.
* 2. Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit;
/* 1 */
font-size: 100%;
/* 1 */
line-height: 1.15;
/* 1 */
margin: 0;
/* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input {
/* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select {
/* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* Correct the padding in Firefox.
*/
fieldset {
padding: 0.35em 0.75em 0.625em;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box;
/* 1 */
color: inherit;
/* 2 */
display: table;
/* 1 */
max-width: 100%;
/* 1 */
padding: 0;
/* 3 */
white-space: normal;
/* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* Remove the default vertical scrollbar in IE 10+.
*/
textarea {
overflow: auto;
}
/**
* 1. Add the correct box sizing in IE 10.
* 2. Remove the padding in IE 10.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box;
/* 1 */
padding: 0;
/* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield;
/* 1 */
outline-offset: -2px;
/* 2 */
}
/**
* Remove the inner padding in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button;
/* 1 */
font: inherit;
/* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}
HTML,
body,
div,
h1,
h2,
h3,
h4,
h5,
h6,
ul,
ol,
dl,
li,
dt,
dd,
p,
blockquote,
pre,
form,
fieldset,
table,
th,
td {
border: none;
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
font-size: 14px;
margin: 0px;
padding: 0px;
}
html,
body {
height: 100%;
width: 100%;
}
address,
caption,
cite,
code,
dfn,
em,
strong,
th,
var {
font-style: normal;
font-weight: normal;
}
a {
text-decoration: none;
}
a:link {
color: #fff;
}
a:visited {
color: #fff;
}
a:hover {
color: #fff;
}
a:active {
color: #fff;
}
input::-ms-clear {
display: none;
}
input::-ms-reveal {
display: none;
}
input {
-webkit-appearance: none;
margin: 0;
outline: none;
padding: 0;
}
input::-webkit-input-placeholder {
color: #ccc;
}
input::-ms-input-placeholder {
color: #ccc;
}
input::-moz-placeholder {
color: #ccc;
}
input[type=submit],
input[type=button] {
cursor: pointer;
}
button[disabled],
input[disabled] {
cursor: default;
}
img {
border: none;
}
ul,
ol,
li {
list-style-type: none;
}
.el-table__body-wrapper{
tr{
td{
.cell{
.el-button+.el-button{
margin-left: 0;
}
}
}
}
}
// navbar
.aside{
.el-scrollbar {
.el-scrollbar__view {
.el-menu-vertical{
background-color: #001529;
}
.el-menu-item:hover i,
.el-menu-item:hover span{
color:#fff;
}
li{
background-color: #001529;
ul{
.el-menu-item{
background-color: #000408;
height: 44px;
line-height: 44px;
}
.is-active{
background-color:#1890ff;
}
}
}
.el-submenu__title:hover{
background-color: #001529;
}
.el-submenu__title:hover i,
.el-submenu__title:hover span{
color:#fff;
}
.el-menu--inline{
border-left: 5px solid #2c3b41;
}
}
}
}
// layout
.layout-cont{
.main-cont{
position: relative;
&.el-main {
background-color: #ecf0f5;
padding: 0;
}
.breadcrumb{
background-color: #fff;
padding: 0 0 15px 15px;
}
}
}
.admin-box {
padding: 15px 20px;
.el-button{
padding: 7px 10px;
}
.el-input__inner{
height: 30px;
line-height: 30px;
}
.el-input__icon{
line-height: 30px;
}
}
.button-box{
background: #fff;
border: 1px solid #ebeef5;
border-bottom: none;
}
.search-term{
background: #fff;
padding: 0 15px;
border-left: 1px solid #ebeef5;
border-right: 1px solid #ebeef5;
}
// table
.has-gutter{
tr{
th{
background-color: #fafafa;
}
}
}
.el-table--striped{
.el-table__body{
tr.el-table__row--striped{
td{
background: #fff!important;
}
}
}
}
.el-table th, .el-table tr{
background-color: #fafafa;
}
.el-pagination{
.btn-prev,
.btn-next{
border: 1px solid #ddd;
border-radius: 4px;
}
.el-pager{
li{
color: #666;
font-size: 12px;
margin: 0 5px;
border: 1px solid #ddd;
border-radius: 4px;
}
}
}
// el-form
.el-form{
background-color: #fff;
padding: 10px 0;
}
.el-row{
padding: 10px 0;
.el-col>label{
line-height: 30px;
text-align: right;
width: 80%;
padding-right: 15px;
display: inline-block;
}
.line{
line-height: 30px;
text-align: center;
}
}
// edit_container
.edit_container{
background-color: #fff;
padding: 15px;
.el-button {
margin: 15px 0;
}
}
.edit{
background-color: #fff;
padding: 15px;
.el-button {
margin: 15px 0;
}
}
// upload-demo
.upload-demo,
.upload{
background-color: #fff;
padding: 15px;
.el-upload-list__item-status-label{
right: 0;
left: 120px;
}
.el-upload__tip{
margin: 10px 0;
}
}
// system
.system{
padding: 15px;
.el-input__inner{
width: 80%;
}
}
// 导航
#app {
.el-container{
position: relative;
height: 100%;
width: 100%;
}
.el-container.mobile.openside {
position: fixed;
top: 0;
}
.hideside{
.aside{
width: 54px!important;
}
}
.el-aside{
-webkit-transition: width .2s;
transition: width .2s;
width: 220px;
background-color: #304156;
height: 100%;
position: fixed;
font-size: 0;
top: 0;
bottom: 0;
left: 0;
z-index: 1001;
overflow: hidden;
}
.mobile.hideside{
.el-aside{
// pointer-events: none;
-webkit-transition-duration: .2s;
transition-duration: .2s;
-webkit-transform: translate3d(-210px,0,0);
transform: translate3d(-220px,0,0);
}
}
.mobile{
.el-aside{
-webkit-transition: -webkit-transform .28s;
transition: -webkit-transform .28s;
transition: transform .28s;
transition: transform .28s,-webkit-transform .28s;
width: 210px!important
}
}
.el-container{
position: relative;
height: 100%;
width: 100%;
.el-aside{
// transition: none;
.aside {
background: #000;
.el-menu{
border-right: none;
}
}
}
}
.main-cont.el-main{
min-height: 100%;
-webkit-transition: margin-left .28s;
transition: margin-left .28s;
margin-left: 220px;
position: relative;
}
.hideside{
.main-cont.el-main{
margin-left: 54px;
}
}
.mobile {
.main-cont.el-main{
margin-left: 0px;
}
}
.openside.mobile{
.shadowBg{
background: #000;
opacity: .3;
width: 100%;
top: 0;
height: 100%;
position: absolute;
z-index: 999;
left: 0;
}
}
}
.el-menu--vertical{
.el-menu{
margin-left: -8px;
background-color:rgb(48,65,86);
.el-menu-item{
background-color:rgb(48,65,86);
}
.el-menu-item:focus,
.el-menu-item:hover{
background-color: #263445;
color: #fff;
}
}
}
// 导航*****
-7
View File
@@ -1,7 +0,0 @@
export const toUpperCase = (str) => {
if (str[0]) {
return str.replace(str[0], str[0].toUpperCase())
} else {
return ""
}
}
@@ -1,93 +0,0 @@
<template>
<div class="container">
<ul class="moon">
<li class="crater"></li>
<li class="crater"></li>
<li class="crater"></li>
</ul>
<ul class="mountain-range">
<li class="mountain"></li>
<li class="mountain"></li>
<li class="mountain"></li>
<li class="mountain"></li>
<li class="mountain"></li>
<li class="mountain"></li>
<li class="mountain"></li>
<li class="mountain"></li>
<li class="mountain"></li>
<li class="mountain"></li>
<li class="mountain"></li>
</ul>
<div class="mountain-range-mask"></div>
<ul class="forest">
<li class="hill"></li>
<li class="hill"></li>
<li class="hill"></li>
</ul>
<ul class="sparkles">
<li class="sparkle one"></li>
<li class="sparkle one"></li>
<li class="sparkle one"></li>
<li class="sparkle one"></li>
<li class="sparkle two"></li>
<li class="sparkle two"></li>
<li class="sparkle two"></li>
<li class="sparkle two"></li>
<li class="sparkle three"></li>
<li class="sparkle three"></li>
<li class="sparkle three"></li>
<li class="sparkle three"></li>
<li class="sparkle four"></li>
<li class="sparkle four"></li>
<li class="sparkle four"></li>
<li class="sparkle four"></li>
<li class="sparkle five"></li>
<li class="sparkle five"></li>
<li class="sparkle five"></li>
<li class="sparkle five"></li>
<li class="sparkle six"></li>
<li class="sparkle six"></li>
<li class="sparkle six"></li>
<li class="sparkle six"></li>
<li class="sparkle seven"></li>
<li class="sparkle seven"></li>
<li class="sparkle seven"></li>
<li class="sparkle seven"></li>
<li class="sparkle eight"></li>
<li class="sparkle eight"></li>
<li class="sparkle eight"></li>
<li class="sparkle eight"></li>
</ul>
<div class="grass">
<div class="pokemon">
<div class="poke" id="bulbasaur">
<div class="ear"></div>
<div class="ear"></div>
<div class="head"></div>
<div class="leg"></div>
<div class="bulba-body"></div>
<div class="bulbs">
<div class="bulb"></div>
</div>
</div>
<div class="poke" id="pikachu">
<div class="ear"></div>
<div class="ear"></div>
<div class="hand"></div>
<div class="pika-body"></div>
<div class="head"></div>
<div class="pika-tail"></div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Animition'
}
</script>
<style lang="scss">
@import '@/style/animition.scss';
</style>
-48
View File
@@ -1,48 +0,0 @@
<template>
<div>
<h2 style="text-align:center">gin-vue-admin by 奇淼 And krank666</h2>
<h2 style="text-align:center;margin:15px">点击动画获取联系方式</h2>
<el-drawer
:visible.sync="drawer"
title="联系方式"
>
<div style="text-align:center;margin-top:30px;">
<img src="http://qmplusimg.henrongyi.top/yx.jpg" width="180" />
<H3>krank666微信</H3>
</div>
<div style="text-align:center;margin-top:30px;">
<img src="http://qmplusimg.henrongyi.top/jjz.jpg" width="180" />
<H3>Mr.奇淼微信</H3>
</div>
</el-drawer>
<div @click="drawer = true">
<Animition />
</div>
<h2 style="text-align:right;margin:40px;">
当前版本号:v0.1.0
</h2>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import Animition from '@/view/dashbord/component/animition.vue'
export default {
name: 'Dashbord',
data() {
return {
drawer: false
}
},
computed: {
...mapGetters('user', ['userInfo'])
},
components: {
Animition
}
}
</script>
<style lang="scss" scoped>
</style>
@@ -1,163 +0,0 @@
<template>
<div>
<div class="search-term">
<el-form :inline="true" :model="searchInfo" class="demo-form-inline">
<el-form-item>
<el-button @click="openDialog" type="primary">新增客户</el-button>
</el-form-item>
</el-form>
</div>
<el-table
:data="tableData"
@selection-change="handleSelectionChange"
border
ref="multipleTable"
stripe
style="width: 100%"
tooltip-effect="dark"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="接入日期" width="180">
<template slot-scope="scope">{{ scope.row.CreatedAt|formatDate }}</template>
</el-table-column>
<el-table-column label="姓名" prop="customerName" width="120"></el-table-column>
<el-table-column label="电话" prop="customerPhoneData" width="120"></el-table-column>
<el-table-column label="接入人ID" prop="sysUserId" width="120"></el-table-column>
<el-table-column label="按钮组">
<template slot-scope="scope">
<el-button @click="updataCustomer(scope.row)" size="small" type="text">变更</el-button>
<el-popover
placement="top"
width="160"
v-model="visible">
<p>确定要删除吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteCustomer(scope.row)">确定</el-button>
</div>
<el-button type="text" size="mini" slot="reference">删除</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-size="pageSize"
:page-sizes="[10, 30, 50, 100]"
:style="{float:'right',padding:'20px'}"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<el-dialog :before-close="closeDialog" :visible.sync="dialogFormVisible" title="新增Api">
<el-form :inline="true" :model="form" label-width="80px">
<el-form-item label="客户名">
<el-input autocomplete="off" v-model="form.customerName"></el-input>
</el-form-item>
<el-form-item label="客户电话">
<el-input autocomplete="off" v-model="form.customerPhoneData"></el-input>
</el-form-item>
</el-form>
<div class="dialog-footer" slot="footer">
<el-button @click="closeDialog">取 消</el-button>
<el-button @click="enterDialog" type="primary">确 定</el-button>
</div>
</el-dialog>
在资源权限中将此角色的资源权限清空 或者不包含创建者的角色 即可屏蔽此客户资源的显示
</div>
</template>
<script>
import {
createExaCustomer,
updataExaCustomer,
deleteExaCustomer,
getExaCustomer,
getExaCustomerList
} from '@/api/customer'
import { formatTimeToStr } from '@/utils/data'
import infoList from '@/components/mixins/infoList'
import { mapGetters } from 'vuex'
export default {
name: 'Customer',
mixins: [infoList],
data(){
return{
listApi: getExaCustomerList,
listKey: 'customer',
dialogFormVisible:false,
visible:false,
type:"",
form:{
customerName:"",
customerPhoneData:""
}
}
},
computed:{
...mapGetters('user', ['token'])
},
filters: {
formatDate: function(time) {
if (time != null && time != '') {
var date = new Date(time)
return formatTimeToStr(date, 'yyyy-MM-dd hh:mm:ss')
} else {
return ''
}
}
},
methods:{
async updataCustomer(row){
const res = await getExaCustomer(row)
this.type = "update"
if(res.success){
this.form = res.data.customer
this.dialogFormVisible = true
}
},
closeDialog(){
this.dialogFormVisible = false
},
async deleteCustomer(row){
this.visible = false
const res = await deleteExaCustomer(row)
if (res.success){
this.getTableData()
}
},
async enterDialog(){
let res
switch (this.type) {
case "create":
res =await createExaCustomer(this.form)
break;
case "update":
res =await updataExaCustomer(this.form)
break;
default:
res =await createExaCustomer(this.form)
break;
}
if(res.success){
this.dialogFormVisible = false
this.getTableData()
}
},
openDialog() {
this.type = "create"
this.dialogFormVisible = true
}
}
}
</script>
<style>
</style>
@@ -1,164 +0,0 @@
<template>
<div v-loading.fullscreen.lock="fullscreenLoading">
<div class="upload">
<el-upload
:action="`${path}/fileUploadAndDownload/upload`"
:before-upload="checkFile"
:headers="{'x-token':token}"
:on-error="uploadError"
:on-success="uploadSuccess"
:show-file-list="false"
>
<el-button size="small" type="primary">点击上传</el-button>
<div class="el-upload__tip" slot="tip">只能上传jpg/png文件,且不超过500kb</div>
</el-upload>
<el-table :data="tableData" border stripe>
<el-table-column label="预览" width="100">
<template slot-scope="scope">
<img :alt="scope.row.alt" :src="scope.row.url" height="80" width="80" />
</template>
</el-table-column>
<el-table-column label="日期" prop="UpdatedAt" width="180">
<template slot-scope="scope">
<div>{{scope.row.UpdatedAt|formatDate}}</div>
</template>
</el-table-column>
<el-table-column label="文件名" prop="name" width="180"></el-table-column>
<el-table-column label="链接" prop="url"></el-table-column>
<el-table-column label="标签" prop="tag" width="100">
<template slot-scope="scope">
<el-tag
:type="scope.row.tag === 'jpg' ? 'primary' : 'success'"
disable-transitions
>{{scope.row.tag}}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="100">
<template slot-scope="scope">
<el-button @click="downloadFile(scope.row)" size="small" type="text">下载</el-button>
<el-button @click="deleteFile(scope.row)" size="small" type="text">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-size="pageSize"
:page-sizes="[10, 30, 50, 100]"
:style="{float:'right',padding:'20px'}"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</div>
</div>
</template>
<script>
const path = process.env.VUE_APP_BASE_API
import { mapGetters } from 'vuex'
import infoList from '@/components/mixins/infoList'
import { getFileList, deleteFile } from '@/api/fileUploadAndDownload'
import { downloadImage } from '@/utils/downloadImg'
import { formatTimeToStr } from '@/utils/data'
export default {
name: 'Upload',
mixins: [infoList],
data() {
return {
fullscreenLoading:false,
listApi: getFileList,
listKey: 'list',
path: path,
tableData: [
{
UpdatedAt: '2019-10-25',
name: '文件名.jpg',
url: 'http://qmplusimg.henrongyi.top/1571321688timg.jpg',
tag: 'jpg'
},
{
UpdatedAt: '2019-10-25',
name: '文件名.jpg',
url: 'http://qmplusimg.henrongyi.top/157162774820191015140921496.gif',
tag: 'gif'
}
]
}
},
computed: {
...mapGetters('user', ['userInfo', 'token'])
},
filters: {
formatDate: function(time) {
if (time != null && time != '') {
var date = new Date(time)
return formatTimeToStr(date, 'yyyy-MM-dd hh:mm:ss')
} else {
return ''
}
}
},
methods: {
async deleteFile(row) {
this.$confirm('此操作将永久文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(async () => {
const res = await deleteFile(row)
if (res.success) {
this.$message({
type: 'success',
message: '删除成功!'
})
this.getTableData()
}
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
checkFile(file) {
this.fullscreenLoading = true
const isJPG = file.type === 'image/jpeg'
const isPng = file.type === 'image/png'
const isLt2M = file.size / 1024 / 1024 < 2
if (!isJPG && !isPng) {
this.$message.error('上传头像图片只能是 JPG或png 格式!')
this.fullscreenLoading = false
}
if (!isLt2M) {
this.$message.error('上传头像图片大小不能超过 2MB!')
this.fullscreenLoading = false
}
return (isPng || isJPG) && isLt2M
},
uploadSuccess(res) {
this.$message({
type: 'success',
message: '上传成功'
})
if (res.success) {
this.getTableData()
}
this.fullscreenLoading = false
},
uploadError() {
this.$message({
type: 'error',
message: '上传失败'
})
this.fullscreenLoading = false
},
downloadFile(row) {
downloadImage(row.url, row.name)
}
}
}
</script>
@@ -1,81 +0,0 @@
<template>
<div>
<el-scrollbar style="height:calc(100vh)">
<el-menu
:class="['el-menu-vertical',!isCollapse&&'noCollapse']"
:collapse="isCollapse"
:collapse-transition="true"
:default-active="active"
@select="selectMenuItem"
active-text-color="#fff"
text-color="rgb(191, 203, 217)"
unique-opened
>
<template v-for="item in asyncRouters[0].children">
<aside-component :key="item.name" :routerInfo="item" v-if="!item.hidden" />
</template>
</el-menu>
</el-scrollbar>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
import AsideComponent from '@/view/layout/aside/asideComponent'
export default {
name: 'Aside',
data() {
return {
active: '',
isCollapse: false
}
},
methods: {
selectMenuItem(index) {
if (index === this.$route.name) return
this.$router.push({ name: index })
}
},
computed: {
...mapGetters('router', ['asyncRouters'])
},
components: {
AsideComponent
},
created() {
this.active = this.$route.name
let screenWidth = document.body.clientWidth
if(screenWidth<1000){
this.isCollapse = !this.isCollapse
}
this.$bus.on('totalCollapse', () => {
this.isCollapse = !this.isCollapse
})
this.$bus.on('collapse', (item) => {
this.isCollapse = item
})
},
beforeDestroy() {
this.$bus.off('totalCollapse')
this.$bus.off('collapse')
}
}
</script>
<style lang="scss">
.el-scrollbar {
.el-scrollbar__view {
height: 100%;
}
}
.menu-info {
.menu-contorl {
line-height: 52px;
font-size: 20px;
display: table-cell;
vertical-align: middle;
}
}
</style>
-309
View File
@@ -1,309 +0,0 @@
<template>
<el-container class="layout-cont">
<el-container :class="[isSider?'openside':'hideside',isMobile ? 'mobile': '']">
<el-row :class="[isShadowBg?'shadowBg':'']" @click.native="changeShadow()"></el-row>
<el-aside class="main-cont main-left">
<Aside class="aside" />
</el-aside>
<!-- 分块滑动功能 -->
<el-main class="main-cont main-right">
<el-header class="header-cont">
<div @click="totalCollapse" class="menu-total">
<i class="el-icon-s-unfold" v-if="isCollapse"></i>
<i class="el-icon-s-fold" v-else></i>
</div>
<h1 class="admin-title">Gin-Vue-Admin</h1>
<div class="fl-right right-box">
<el-dropdown>
<span class="el-dropdown-link">
<img :src="userInfo.headerImg" height="30" width="30" />
{{userInfo.nickName}}
<i class="el-icon-arrow-down"></i>
</span>
<el-dropdown-menu class="dropdown-group" slot="dropdown">
<el-dropdown-item>
<span>
更多信息
<el-badge is-dot />
</span>
</el-dropdown-item>
<el-dropdown-item @click.native="showPassword=true" icon="el-icon-s-custom">修改密码</el-dropdown-item>
<el-dropdown-item @click.native="toPerson" icon="el-icon-s-custom">个人信息</el-dropdown-item>
<el-dropdown-item @click.native="LoginOut" icon="el-icon-table-lamp">登 出</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-dialog
title="修改密码"
:visible.sync="showPassword"
@close="clearPassword"
width="360px"
>
<el-form ref="modifyPwdForm" :model="pwdModify" :rules="rules" label-width="80px">
<el-form-item prop="password" :minlength="6" label="原密码">
<el-input v-model="pwdModify.password" show-password></el-input>
</el-form-item>
<el-form-item prop="newPassword" :minlength="6" label="新密码">
<el-input v-model="pwdModify.newPassword" show-password></el-input>
</el-form-item>
<el-form-item prop="confirmPassword" :minlength="6" label="确认密码">
<el-input v-model="pwdModify.confirmPassword" show-password></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="showPassword=false">取 消</el-button>
<el-button type="primary" @click="savePassword">确 定</el-button>
</div>
</el-dialog>
</div>
</el-header>
<!-- 当前面包屑用路由自动生成可根据需求修改 -->
<!--
:to="{ path: item.path }" 暂时注释不用-->
<el-breadcrumb class="breadcrumb" separator-class="el-icon-arrow-right">
<el-breadcrumb-item
:key="item.path"
v-for="item in matched.slice(1,matched.length)"
>{{item.meta.title}}</el-breadcrumb-item>
</el-breadcrumb>
<transition mode="out-in" name="el-fade-in-linear">
<router-view class="admin-box"></router-view>
</transition>
</el-main>
</el-container>
</el-container>
</template>
<script>
import Aside from '@/view/layout/aside'
import { mapGetters, mapActions } from 'vuex'
import { changePassword } from '@/api/user'
export default {
name: 'Layout',
data() {
return {
isCollapse: false,
isSider: true,
isMobile: false,
isShadowBg: false,
showPassword: false,
pwdModify: {},
rules: {
password: [
{ required: true, message: '请输入密码', trigger: 'blur' },
{ min: 6, message: '最少6个字符', trigger: 'blur' }
],
newPassword: [
{ required: true, message: '请输入新密码', trigger: 'blur' },
{ min: 6, message: '最少6个字符', trigger: 'blur' }
],
confirmPassword: [
{ required: true, message: '请输入确认密码', trigger: 'blur' },
{ min: 6, message: '最少6个字符', trigger: 'blur' },
{
validator: (rule, value, callback) => {
if (value !== this.pwdModify.newPassword) {
callback(new Error('两次密码不一致'))
} else {
callback()
}
},
trigger: 'blur'
}
]
}
}
},
components: {
Aside
},
created() {
let screenWidth = document.body.clientWidth
if (screenWidth < 1000) {
this.isMobile = true
this.isSider = false
this.isCollapse = !this.isCollapse
} else {
this.isMobile = false
}
},
methods: {
...mapActions('user', ['LoginOut']),
totalCollapse() {
this.isCollapse = !this.isCollapse
this.isSider = !this.isCollapse
this.isShadowBg = !this.isCollapse
this.$bus.emit('totalCollapse')
},
toPerson() {
this.$router.push({ name: 'person' })
},
changeShadow() {
this.isShadowBg = !this.isShadowBg
this.isSider = !!this.isCollapse
this.totalCollapse()
},
savePassword() {
this.$refs.modifyPwdForm.validate(valid => {
if (valid) {
changePassword({
username: this.userInfo.userName,
password: this.pwdModify.password,
newPassword: this.pwdModify.newPassword
}).then(() => {
this.$message.success('修改密码成功!')
this.showPassword = false
})
} else {
return false
}
})
},
clearPassword() {
this.pwdModify = {
password: '',
newPassword: '',
confirmPassword: ''
}
this.$refs.modifyPwdForm.clearValidate()
}
},
computed: {
...mapGetters('user', ['userInfo']),
title() {
return this.$route.meta.title || '当前页面'
},
matched() {
return this.$route.matched
}
},
mounted() {
window.onresize = () => {
return (() => {
let screenWidth = document.body.clientWidth
if (!this.screenWidth && this.isSider) {
if (screenWidth < 1000) {
this.isMobile = true
this.isSider = false
this.isCollapse = true
this.$bus.emit('collapse', this.isCollapse)
}
} else {
if (screenWidth < 1000) {
this.isMobile = true
this.isSider = false
this.isCollapse = true
} else {
this.isMobile = false
}
}
})()
}
}
}
</script>
<style lang="scss">
$headerHigh: 52px;
$mainHight: 100vh;
.el-dropdown-link {
cursor: pointer;
}
.dropdown-group {
min-width: 100px;
}
.el-scrollbar__wrap {
padding-bottom: 17px;
}
.layout-cont {
.right-box {
text-align: center;
vertical-align: middle;
img {
vertical-align: middle;
border: 1px solid #ccc;
border-radius: 6px;
}
}
.menu-contorl {
line-height: 52px;
font-size: 20px;
color: #eee;
display: table-cell;
vertical-align: middle;
}
.header-cont {
height: $headerHigh !important;
background: #fff;
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
line-height: $headerHigh;
}
.main-cont {
.breadcrumb {
line-height: 24px;
// padding: 6px;
// border-bottom: 1px solid #eee;
margin-bottom: 6px;
}
&.el-main {
overflow: auto;
// padding: 0px 10px;
// background: #fff;
}
height: $mainHight !important;
overflow: visible;
position: relative;
.menu-total {
// z-index: 5;
// position: absolute;
// top: 10px;
// right: -35px;
margin-left: -10px;
float: left;
margin-top: 10px;
width: 30px;
height: 30px;
line-height: 30px;
font-size: 30px;
// border: 0 solid #ffffff;
// border-radius: 50%;
// background: #fff;
}
.aside {
overflow: auto;
// background: #fff;
&::-webkit-scrollbar {
display: none;
}
}
.el-menu-vertical {
height: 100vh !important;
visibility: auto;
&:not(.el-menu--collapse) {
width: 220px;
}
}
&::-webkit-scrollbar {
display: none;
}
&.main-left {
width: auto !important;
}
&.main-right {
.admin-title {
float: left;
font-size: 16px;
vertical-align: middle;
margin-left: 20px;
img {
vertical-align: middle;
}
&.collapse {
width: 53px;
}
}
}
}
}
</style>
-128
View File
@@ -1,128 +0,0 @@
<template>
<el-container class="login-regist-box">
<vue-particle-line></vue-particle-line>
<el-main class="login-box">
<h1 class="title-1">GIN-VUE-ADMIN</h1>
<el-form :model="loginForm" :rules="rules" ref="loginForm">
<el-form-item prop="username">
<el-input placeholder="请输入用户名" v-model="loginForm.username"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
:type="lock==='lock'?'password':'text'"
placeholder="请输入密码"
v-model="loginForm.password"
>
<i :class="'el-input__icon el-icon-' + lock" @click="changeLock" slot="suffix"></i>
</el-input>
</el-form-item>
<el-form-item style="position:relative">
<el-input
v-model="loginForm.captcha"
name="logVerify"
placeholder="请输入验证码"
maxlength="10"
/>
<img :src="path + picPath" alt="请输入验证码" @click="loginVefify()" class="vPic">
</el-form-item>
<el-form-item>
<el-button @click="submitForm" style="width:100%">登 录</el-button>
</el-form-item>
</el-form>
<h3 class="title-3 fl-right">测试用户:admin 密码:123456</h3>
</el-main>
</el-container>
</template>
<script>
import { mapActions } from 'vuex'
import { captcha } from '@/api/user'
const path = process.env.VUE_APP_BASE_API
export default {
name: 'Login',
data() {
const checkUsername = (rule, value, callback) => {
if (value.length < 5 || value.length > 12) {
return callback(new Error('请输入正确的用户名'))
} else {
callback()
}
}
const checkPassword = (rule, value, callback) => {
if (value.length < 6 || value.length > 12) {
return callback(new Error('请输入正确的密码'))
} else {
callback()
}
}
return {
lock: 'lock',
loginForm: {
username: '',
password: '',
captcha:'',
captchaId: '',
},
rules: {
username: [{ validator: checkUsername, trigger: 'blur' }],
password: [{ validator: checkPassword, trigger: 'blur' }]
},
path:path,
logVerify:'',
picPath:''
}
},
created() {
this.loginVefify()
},
methods: {
...mapActions('user', ['LoginIn']),
async login() {
await this.LoginIn(this.loginForm)
},
async submitForm() {
this.$refs.loginForm.validate(async v => {
if (v) {
await this.login()
} else {
this.$message({
type: 'error',
message: '请正确填写登录信息',
showClose: true
})
return false
}
})
},
changeLock() {
this.lock === 'lock' ? (this.lock = 'unlock') : (this.lock = 'lock')
},
loginVefify() {
captcha({}).then(ele=>{
this.picPath = ele.data.picPath
this.loginForm.captchaId = ele.data.captchaId
})
}
}
}
</script>
<style scoped lang="scss">
.login-regist-box {
background: #fff;
height: 100vh;
.login-box {
width: 40vw;
position: absolute;
left: 50%;
margin-left: -22vw;
top: 25vh;
}
.vPic{
position: absolute;
right: 10px;
bottom: 0px; // 适配ie
}
}
</style>
-121
View File
@@ -1,121 +0,0 @@
<template>
<el-container class="login-regist-box">
<vue-particle-line></vue-particle-line>
<el-main class="login-box">
<h1 class="title-1">GIN-VUE-ADMIN</h1>
<el-form :model="registForm" :rules="rules" ref="registForm">
<el-form-item prop="username">
<el-input placeholder="请输入用户名" v-model="registForm.username"></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
:type="lock==='lock'?'password':'text'"
placeholder="请输入密码"
v-model="registForm.password"
>
<i :class="'el-input__icon el-icon-' + lock" @click="changeLock" slot="suffix"></i>
</el-input>
</el-form-item>
<el-form-item prop="rePassword">
<el-input
:type="lock==='lock'?'password':'text'"
placeholder="请再次输入密码"
v-model="registForm.rePassword"
>
<i :class="'el-input__icon el-icon-' + lock" @click="changeLock" slot="suffix"></i>
</el-input>
</el-form-item>
<el-form-item>
<el-button @click="submitForm" style="width:100%">注 册</el-button>
</el-form-item>
</el-form>
</el-main>
</el-container>
</template>
<script>
import { mapActions } from 'vuex'
import { regist } from '@/api/user'
export default {
name: 'Regist',
data() {
const ratioPassword = (rule, value, callback) => {
if (value != this.registForm.password) {
return callback(new Error('两次密码不同'))
} else {
callback()
}
}
const checkUsername = (rule, value, callback) => {
if (value.length < 5 || value.length > 12) {
return callback(new Error('请输入正确的用户名'))
} else {
callback()
}
}
const checkPassword = (rule, value, callback) => {
if (value.length < 6 || value.length > 12) {
return callback(new Error('请输入正确的密码'))
} else {
callback()
}
}
return {
lock: 'lock',
registForm: {
username: '',
password: '',
rePassword: ''
},
rules: {
username: [{ validator: checkUsername, trigger: 'blur' }],
password: [{ validator: checkPassword, trigger: 'blur' }],
rePassword: [{ validator: ratioPassword, trigger: 'blur' }]
}
}
},
methods: {
...mapActions('user', ['LoginIn']),
async submitForm() {
this.$refs.registForm.validate(async v => {
if (v) {
const res = await regist(this.registForm)
if (res.success) {
this.$message({
type: 'success',
message: '注册成功',
showClose: true
})
await this.LoginIn(this.registForm)
}
} else {
this.$message({
type: 'error',
message: '请正确填写注册信息',
showClose: true
})
return false
}
})
},
changeLock() {
this.lock === 'lock' ? (this.lock = 'unlock') : (this.lock = 'lock')
}
}
}
</script>
<style scoped lang="scss">
.login-regist-box {
background: #fff;
height: 100vh;
.login-box {
width: 40vw;
position: absolute;
left: 50%;
margin-left: -22vw;
top: 25vh;
}
}
</style>
-70
View File
@@ -1,70 +0,0 @@
<template>
<div>
<div class="fl-left left-mg-xs">
<el-upload
:headers="{'x-token':token}"
:on-success="handleAvatarSuccess"
:show-file-list="false"
:action="`${path}/user/uploadHeaderImg`"
class="avatar-uploader"
name="headerImg"
>
<img :src="userInfo.headerImg" class="avatar" v-if="userInfo.headerImg" />
<i class="el-icon-plus avatar-uploader-icon" v-else></i>
</el-upload>
<!-- <el-avatar :size="120" :src="userInfo.headerImg" shape="square"></el-avatar> -->
</div>
<div class="fl-left left-mg-lg">
<div>用户ID:{{userInfo.uuid}}</div>
<div>用户昵称:{{userInfo.nickName}}</div>
<div>用户组:{{userInfo.authority&&userInfo.authority.authorityName}}</div>
</div>
</div>
</template>
<script>
import { mapGetters, mapMutations } from 'vuex'
const path = process.env.VUE_APP_BASE_API
export default {
name: 'Person',
data(){
return {
path:path
}
},
computed: {
...mapGetters('user', ['userInfo', 'token'])
},
methods:{
...mapMutations('user',['ResetUserInfo']),
handleAvatarSuccess(res){
this.ResetUserInfo({headerImg:res.data.user.headerImg})
}
}
}
</script>
<style lang="scss">
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>
@@ -1,203 +0,0 @@
<template>
<div class="authority">
<div class="button-box clearflex">
<el-button @click="addAuthority('0')" type="primary">新增角色</el-button>
</div>
<el-table
:data="tableData"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
border
row-key="ID"
stripe
style="width: 100%"
>
<el-table-column label="id" min-width="180" prop="ID"></el-table-column>
<el-table-column label="角色id" min-width="180" prop="authorityId"></el-table-column>
<el-table-column label="角色名称" min-width="180" prop="authorityName"></el-table-column>
<el-table-column fixed="right" label="操作" min-width="300">
<template slot-scope="scope">
<el-button @click="opdendrawer(scope.row)" size="small" type="text">设置权限</el-button>
<el-button @click="deleteAuth(scope.row)" size="small" type="text">删除角色</el-button>
<el-button @click="addAuthority(scope.row.authorityId)" size="small" type="text">新增子角色</el-button>
</template>
</el-table-column>
</el-table>
<!-- 新增角色弹窗 -->
<el-dialog :visible.sync="dialogFormVisible" title="新增角色">
<el-form :model="form" :rules="rules" ref="authorityForm">
<el-form-item label="父级角色ID" prop="parentId">
<el-input autocomplete="off" disabled v-model="form.parentId"></el-input>
</el-form-item>
<el-form-item label="角色ID" prop="authorityId">
<el-input autocomplete="off" v-model="form.authorityId"></el-input>
</el-form-item>
<el-form-item label="角色姓名" prop="authorityName">
<el-input autocomplete="off" v-model="form.authorityName"></el-input>
</el-form-item>
</el-form>
<div class="dialog-footer" slot="footer">
<el-button @click="closeDialog">取 消</el-button>
<el-button @click="enterDialog" type="primary">确 定</el-button>
</div>
</el-dialog>
<el-drawer :visible.sync="drawer" :with-header="false" size="40%" title="角色配置" v-if="drawer">
<el-tabs class="role-box" type="border-card">
<el-tab-pane label="角色菜单">
<Menus :row="activeRow" />
</el-tab-pane>
<el-tab-pane label="角色api">
<apis :row="activeRow" />
</el-tab-pane>
<el-tab-pane label="资源权限">
<Datas :authority="tableData" :row="activeRow" />
</el-tab-pane>
</el-tabs>
</el-drawer>
</div>
</template>
<script>
// 获取列表内容封装在mixins内部 getTableData方法 初始化已封装完成
import {
getAuthorityList,
deleteAuthority,
createAuthority
} from '@/api/authority'
import Menus from '@/view/superAdmin/authority/components/menus'
import Apis from '@/view/superAdmin/authority/components/apis'
import Datas from '@/view/superAdmin/authority/components/datas'
import infoList from '@/components/mixins/infoList'
export default {
name: 'Authority',
mixins: [infoList],
data() {
return {
listApi: getAuthorityList,
listKey: 'list',
drawer: false,
activeRow: {},
activeUserId: 0,
dialogFormVisible: false,
apiDialogFlag: false,
form: {
authorityId: '',
authorityName: '',
parentId: '0'
},
rules: {
authorityId: [
{ required: true, message: '请输入角色ID', trigger: 'blur' }
],
authorityName: [
{ required: true, message: '请输入角色名', trigger: 'blur' }
],
parentId: [
{ required: true, message: '请选择请求方式', trigger: 'blur' }
]
}
}
},
components: {
Menus,
Apis,
Datas
},
methods: {
opdendrawer(row) {
this.drawer = true
this.activeRow = row
},
// 删除角色
deleteAuth(row) {
this.$confirm('此操作将永久删除该角色, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(async () => {
const res = await deleteAuthority({ authorityId: row.authorityId })
if (res.success) {
this.$message({
type: 'success',
message: '删除成功!'
})
this.getTableData()
}
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 初始化表单
initForm() {
for (const key in this.form) {
this.form[key] = ''
}
},
// 关闭窗口
closeDialog() {
this.initForm()
this.dialogFormVisible = false
this.apiDialogFlag = false
},
// 确定弹窗
async enterDialog() {
if (this.form.authorityId == '0') {
this.$message({
type: 'error',
message: '角色id不能为0'
})
return false
}
this.$refs.authorityForm.validate(async valid => {
if (valid) {
const res = await createAuthority(this.form)
if (res.success) {
this.$message({
type: 'success',
message: '添加成功!'
})
this.getTableData()
this.closeDialog()
}
this.initForm()
this.dialogFormVisible = false
}
})
},
// 增加角色
addAuthority(parentId) {
this.form.parentId = parentId
this.dialogFormVisible = true
}
},
created() {
this.pageSize = 999
}
}
</script>
<style lang="scss">
.authority {
.button-box {
padding: 10px 20px;
.el-button {
float: right;
}
}
}
.role-box {
.el-tabs__content {
height: calc(100vh - 150px);
overflow: auto;
}
}
</style>
@@ -1,238 +0,0 @@
<template>
<div>
<div class="button-box clearflex">
<el-button @click="addMenu('0')" type="primary">新增根菜单</el-button>
</div>
<!-- 由于此处菜单跟左侧列表一一对应所以不需要分页 pageSize默认999 -->
<el-table :data="tableData" border row-key="ID" stripe>
<el-table-column label="ID" min-width="100" prop="ID"></el-table-column>
<el-table-column label="路由Name" min-width="160" prop="name"></el-table-column>
<el-table-column label="是否隐藏" min-width="100" prop="hidden">
<template slot-scope="scope">
<span>{{scope.row.hidden?"隐藏":"显示"}}</span>
</template>
</el-table-column>
<el-table-column label="父节点" min-width="90" prop="parentId"></el-table-column>
<el-table-column label="排序" min-width="70" prop="sort"></el-table-column>
<el-table-column label="文件路径" min-width="360" prop="component"></el-table-column>
<el-table-column label="展示名称" min-width="120" prop="authorityName">
<template slot-scope="scope">
<span>{{scope.row.meta.title}}</span>
</template>
</el-table-column>
<el-table-column label="图标" min-width="140" prop="authorityName">
<template slot-scope="scope">
<span>{{scope.row.meta.icon}}</span>
</template>
</el-table-column>
<el-table-column fixed="right" label="操作" width="300">
<template slot-scope="scope">
<el-button @click="deleteMenu(scope.row.ID)" size="small" type="text">删除菜单</el-button>
<el-button @click="editMenu(scope.row.ID)" size="small" type="text">编辑菜单</el-button>
<el-button @click="addMenu(scope.row.ID)" size="small" type="text">添加子菜单</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog :before-close="handleClose" :visible.sync="dialogFormVisible" title="新增菜单">
<el-form :inline="true" :model="form" :rules="rules" label-width="85px" ref="menuForm">
<el-form-item label="路由name" prop="path">
<el-input autocomplete="off" placeholder="唯一英文字符串" v-model="form.path"></el-input>
</el-form-item>
<el-form-item label="是否隐藏">
<el-select placeholder="是否在列表隐藏" v-model="form.hidden">
<el-option :value="false" label="否"></el-option>
<el-option :value="true" label="是"></el-option>
</el-select>
</el-form-item>
<el-form-item label="父节点Id">
<el-input autocomplete="off" disabled v-model="form.parentId"></el-input>
</el-form-item>
<el-form-item label="文件路径" prop="component">
<el-input autocomplete="off" v-model="form.component"></el-input>
</el-form-item>
<el-form-item label="展示名称" prop="meta.title">
<el-input autocomplete="off" v-model="form.meta.title"></el-input>
</el-form-item>
<el-form-item label="图标">
<el-input autocomplete="off" v-model="form.meta.icon"></el-input>
</el-form-item>
<el-form-item label="排序标记">
<el-input autocomplete="off" v-model="form.sort"></el-input>
</el-form-item>
</el-form>
<div class="warning">新增菜单需要在角色管理内配置权限才可使用</div>
<div class="dialog-footer" slot="footer">
<el-button @click="closeDialog">取 消</el-button>
<el-button @click="enterDialog" type="primary">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
// 获取列表内容封装在mixins内部 getTableData方法 初始化已封装完成
import {
updataBaseMenu,
getMenuList,
addBaseMenu,
deleteBaseMenu,
getBaseMenuById
} from '@/api/menu'
import infoList from '@/components/mixins/infoList'
export default {
name: 'Menus',
mixins: [infoList],
data() {
return {
listApi: getMenuList,
listKey: 'list',
dialogFormVisible: false,
form: {
ID: 0,
path: '',
name: '',
hidden: '',
parentId: '',
component: '',
meta: {
title: '',
icon: ''
}
},
rules: {
path: [{ required: true, message: '请输入菜单name', trigger: 'blur' }],
component: [
{ required: true, message: '请输入文件路径', trigger: 'blur' }
],
'meta.title': [
{ required: true, message: '请输入菜单展示名称', trigger: 'blur' }
]
},
isEdit: false
}
},
methods: {
handleClose(done) {
this.initForm()
done()
},
// 懒加载子菜单
load(tree, treeNode, resolve) {
resolve([
{
id: 31,
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄'
},
{
id: 32,
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1519 弄'
}
])
},
// 删除菜单
deleteMenu(ID) {
this.$confirm('此操作将永久删除所有角色下该菜单, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(async () => {
const res = await deleteBaseMenu({ ID })
if (res.success) {
this.$message({
type: 'success',
message: '删除成功!'
})
this.getTableData()
}
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
// 初始化弹窗内表格方法
initForm() {
this.form = {
path: '',
name: '',
hidden: '',
parentId: '',
component: '',
meta: {
title: '',
icon: ''
}
}
},
// 关闭弹窗
closeDialog() {
this.dialogFormVisible = false
},
// 添加menu
async enterDialog() {
this.$refs.menuForm.validate(async valid => {
if (valid) {
let res
this.form.name = this.form.path
if (this.isEdit) {
res = await updataBaseMenu(this.form)
} else {
res = await addBaseMenu(this.form)
}
if (res.success) {
this.$message({
type: 'success',
message: '添加成功!'
})
this.getTableData()
} else {
this.$message({
type: 'error',
message: '添加失败!'
})
}
this.initForm()
this.dialogFormVisible = false
}
})
},
// 添加菜单方法,id为 0则为添加根菜单
addMenu(id) {
this.form.parentId = String(id)
this.isEdit = false
this.dialogFormVisible = true
},
// 修改菜单方法
async editMenu(id) {
const res = await getBaseMenuById({ id })
this.form = res.data.menu
this.dialogFormVisible = true
this.isEdit = true
}
},
created() {
this.pageSize = 999
}
}
</script>
<style scoped lang="scss">
.button-box {
padding: 10px 20px;
.el-button {
float: right;
}
}
.warning {
color: #dc143c;
}
</style>
@@ -1,203 +0,0 @@
<template>
<div>
<div class="button-box clearflex">
<el-button @click="addUser" type="primary">新增用户</el-button>
</div>
<el-table :data="tableData" border stripe>
<el-table-column label="头像" min-width="50">
<template slot-scope="scope">
<div :style="{'textAlign':'center'}">
<img :src="scope.row.headerImg" height="50" width="50" />
</div>
</template>
</el-table-column>
<el-table-column label="uuid" min-width="250" prop="uuid"></el-table-column>
<el-table-column label="用户名" min-width="150" prop="userName"></el-table-column>
<el-table-column label="昵称" min-width="150" prop="nickName"></el-table-column>
<el-table-column label="用户角色" min-width="150">
<template slot-scope="scope">
<el-select
@change="changeAuthority(scope.row)"
placeholder="请选择"
v-model="scope.row.authority.authorityId"
>
<el-option
:key="item.authorityId"
:label="item.authorityName"
:value="item.authorityId"
v-for="item in authOptions"
></el-option>
</el-select>
</template>
</el-table-column>
</el-table>
<el-pagination
:current-page="page"
:page-size="pageSize"
:page-sizes="[10, 30, 50, 100]"
:style="{float:'right',padding:'20px'}"
:total="total"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
<el-dialog :visible.sync="addUserDialog" custom-class="user-dialog" title="新增用户">
<el-form :rules="rules" ref="userForm" :model="userInfo" >
<el-form-item label="用户名" label-width="80px" prop="username">
<el-input v-model="userInfo.username"></el-input>
</el-form-item>
<el-form-item label="密码" label-width="80px" prop="password">
<el-input v-model="userInfo.password"></el-input>
</el-form-item>
<el-form-item label="别名" label-width="80px" prop="nickName">
<el-input v-model="userInfo.nickName"></el-input>
</el-form-item>
<el-form-item label="头像" label-width="80px">
<el-upload
:headers="{'x-token':token}"
:on-success="handleAvatarSuccess"
:show-file-list="false"
:action="`${path}/fileUploadAndDownload/upload?noSave=1`"
class="avatar-uploader"
name="file"
>
<img :src="userInfo.headerImg" class="avatar" v-if="userInfo.headerImg" />
<i class="el-icon-plus avatar-uploader-icon" v-else></i>
</el-upload>
</el-form-item>
<el-form-item label="用户角色" label-width="80px" prop="authorityId">
<el-select placeholder="请选择" v-model="userInfo.authorityId">
<el-option
:key="item.authorityId"
:label="item.authorityName"
:value="item.authorityId"
v-for="item in authOptions"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div class="dialog-footer" slot="footer">
<el-button @click="closeAddUserDialog">取 消</el-button>
<el-button @click="enterAddUserDialog" type="primary">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
// 获取列表内容封装在mixins内部 getTableData方法 初始化已封装完成
const path = process.env.VUE_APP_BASE_API
import { getUserList, setUserAuthority, regist } from '@/api/user'
import { getAuthorityList } from '@/api/authority'
import infoList from '@/components/mixins/infoList'
import { mapGetters } from 'vuex'
export default {
name: 'Api',
mixins: [infoList],
data() {
return {
listApi: getUserList,
listKey: 'userList',
path:path,
authOptions: [],
addUserDialog: false,
userInfo: {
username: '',
password: '',
nickName: '',
headerImg: '',
authorityId: ''
},
rules: {
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
password: [
{ required: true, message: '请输入用户密码', trigger: 'blur' }
],
nickName: [
{ required: true, message: '请输入用户昵称', trigger: 'blur' }
],
authorityId: [
{ required: true, message: '请选择用户角色', trigger: 'blur' }
]
},
}
},
computed: {
...mapGetters('user', ['token'])
},
methods: {
async enterAddUserDialog() {
this.$refs.userForm.validate(async valid => {
if (valid) {
const res = await regist(this.userInfo)
if (res.success) {
this.$message({ type: 'success', message: '创建成功' })
}
await this.getTableData()
this.closeAddUserDialog()
}
})
},
closeAddUserDialog() {
this.userInfo = {
username: '',
password: '',
nickName: '',
headerImg: '',
authorityId: ''
}
this.addUserDialog = false
},
handleAvatarSuccess(res) {
this.userInfo.headerImg = res.data.file.url
},
addUser() {
this.addUserDialog = true
},
async changeAuthority(row) {
const res = await setUserAuthority({
uuid: row.uuid,
authorityId: row.authority.authorityId
})
if (res.success) {
this.$message({ type: 'success', message: '角色设置成功' })
}
}
},
async created() {
const res = await getAuthorityList({ page: 1, pageSize: 999 })
this.authOptions = res.data.list
}
}
</script>
<style scoped lang="scss">
.button-box {
padding: 10px 20px;
.el-button {
float: right;
}
}
.user-dialog {
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
border: 1px dashed #d9d9d9 !important;
border-radius: 6px;
font-size: 28px;
color: #8c939d;
width: 178px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
}
</style>
@@ -1,82 +0,0 @@
<template>
<div>
<el-form :model="dialogMiddle" ref="fieldDialogFrom" label-width="120px" label-position="left" :rules="rules">
<el-form-item label="Field名称" prop="fieldName">
<el-col :span="6">
<el-input v-model="dialogMiddle.fieldName" autocomplete="off"></el-input>
</el-col>
</el-form-item>
<el-form-item label="FieldJSON" prop="fieldJson">
<el-col :span="6">
<el-input v-model="dialogMiddle.fieldJson" autocomplete="off"></el-input>
</el-col>
</el-form-item>
<el-form-item label="数据库字段名" prop="columnName">
<el-col :span="6">
<el-input v-model="dialogMiddle.columnName" autocomplete="off"></el-input>
</el-col>
</el-form-item>
<el-form-item label="Field数据类型" prop="fieldType">
<el-col :span="8">
<el-select v-model="dialogMiddle.fieldType" placeholder="请选择field数据类型">
<el-option
v-for="item in typeOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-col>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
name:"FieldDialog",
props:{
dialogMiddle:{
type:Object,
default:function(){
return {}
}
}
},
data(){
return{
visible:false,
typeOptions:[
{
label:"字符串",
value:"string"
},
{
label:"整型",
value:"int"
},
{
label:"布尔值",
value:"bool"
},
{
label:"浮点型",
value:"float64"
},
{
label:"时间",
value:"time.Time"
},
],
rules:{
fieldName:[ { required: true, message: '请输入field英文名', trigger: 'blur' }],
fieldJson:[ { required: true, message: '请输入field格式化json', trigger: 'blur' }],
fieldType:[ { required: true, message: '请选择field数据类型', trigger: 'blur' }]
}
}
}
}
</script>
<style lang="scss">
</style>
@@ -1,186 +0,0 @@
<template>
<div>
<!-- 初始版本自动化代码工具 -->
<el-form ref="autoCodeForm" :rules="rules" :model="form" label-width="120px" :inline="true">
<el-form-item label="Struct名称" prop="structName">
<el-input v-model="form.structName" placeholder="首字母自动转换大写"></el-input>
</el-form-item>
<el-form-item label="Struct简称" prop="abbreviation">
<el-input v-model="form.abbreviation"></el-input>
</el-form-item>
<el-form-item label="Package名称" prop="packageName">
<el-input v-model="form.packageName"></el-input>
</el-form-item>
</el-form>
<!-- 组件列表 -->
<div class="button-box clearflex">
<el-button @click="editAndAddField()" type="primary">新增Field</el-button>
</div>
<el-table
:data="form.fields"
border stripe>
<el-table-column
type="index"
label="序列"
width="280">
</el-table-column>
<el-table-column
prop="fieldName"
label="Field名"
width="280">
</el-table-column>
<el-table-column
prop="fieldJson"
label="FieldJson"
width="280">
</el-table-column>
<el-table-column
prop="fieldType"
label="Field数据类型"
width="280">
</el-table-column>
<el-table-column
label="操作">
<template slot-scope="scope">
<el-button type="primary" @click="editAndAddField(scope.row)">编辑</el-button>
<el-popover
placement="top"
width="280"
v-model="scope.row.visible">
<p>这是一段内容这是一段内容确定删除吗?</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteField(scope.$index)">确定</el-button>
</div>
<el-button type="danger" slot="reference">删除</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<!-- 组件列表 -->
<div class="button-box clearflex">
<el-button @click="enterForm" type="primary">生成代码包</el-button>
</div>
<!-- 组件弹窗 -->
<el-dialog title="组件内容" :visible.sync="dialogFlag">
<FieldDialog :dialogMiddle="dialogMiddle" ref="fieldDialog"/>
<div slot="footer" class="dialog-footer">
<el-button @click="closeDialog">取 消</el-button>
<el-button type="primary" @click="enterDialog">确 定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
const fieldTemplate={
fieldName:"",
fieldType:"",
fieldJson:"",
columnName:"",
}
import FieldDialog from "@/view/systemTools/autoCode/component/fieldDialog.vue"
import {toUpperCase} from "@/utils/toUpperCase.js"
import {createTemp} from "@/api/autoCode.js"
export default {
name:"autoCode",
data(){
return{
addFlag:"",
form:{
structName:"",
packageName:"",
abbreviation:"",
fields:[]
},
rules:{
structName:[{required: true, message: '请输入结构体名称', trigger: 'blur'}],
abbreviation:[{required: true, message: '请输入结构体简称', trigger: 'blur'}],
packageName:[{required: true, message: '请输入包名称', trigger: 'blur'}]
},
dialogMiddle:{},
bk:{},
dialogFlag:false
}
},
components:{
FieldDialog
},
methods:{
editAndAddField(item){
this.dialogFlag = true
if(item){
this.addFlag="edit"
this.bk=JSON.parse(JSON.stringify(item))
this.dialogMiddle = item
}else{
this.addFlag="add"
this.dialogMiddle = JSON.parse(JSON.stringify(fieldTemplate))
}
},
enterDialog(){
this.$refs.fieldDialog.$refs.fieldDialogFrom.validate((valid) => {
if (valid) {
this.dialogMiddle.fieldName = toUpperCase(this.dialogMiddle.fieldName)
if(this.addFlag=="add"){
this.form.fields.push(this.dialogMiddle)
}
this.dialogFlag = false
} else {
return false;
}
});
},
closeDialog(){
if(this.addFlag=="edit"){
this.dialogMiddle = this.bk
}
this.dialogFlag = false
},
deleteField(index){
this.form.fields.splice(index,1)
},
async enterForm(){
if(this.form.fields.length<=0){
this.$message({
type:"error",
message:"请填写至少一个field"
})
return false
}
this.$refs.autoCodeForm.validate(async (valid) => {
if (valid) {
this.form.structName = toUpperCase(this.form.structName)
const data = await createTemp(this.form)
const blob = new Blob([data])
const fileName = 'ginvueadmin.zip'
if ('download' in document.createElement('a')) { // 不是IE浏览器
let url = window.URL.createObjectURL(blob)
let link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName)
document.body.appendChild(link)
link.click()
document.body.removeChild(link) // 下载完成移除元素
window.URL.revokeObjectURL(url) // 释放掉blob对象
} else { // IE 10+
window.navigator.msSaveBlob(blob, fileName)
}
} else {
return false;
}
});
}
}
}
</script>
<style scope lang="scss">
.button-box {
padding: 10px 20px;
.el-button {
float: right;
}
}
</style>
@@ -1,14 +0,0 @@
<template>
<div style="height:80vh">
<iframe width="100%" height="100%" src="http://localhost:8888/form-generator/#/" frameborder="0"></iframe>
</div>
</template>
<script>
export default {
name:"FormGenerator"
};
</script>
<style lang="scss">
</style>

Some files were not shown because too many files have changed in this diff Show More