├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── SECURITY.md ├── UPDATE.md ├── bug.ini ├── docker-compose.yaml ├── go ├── .gitignore ├── Dockerfile ├── README.md ├── app │ ├── env │ │ ├── handle.go │ │ └── route.go │ ├── important │ │ ├── handle.go │ │ └── route.go │ ├── level │ │ ├── handle.go │ │ └── route.go │ ├── position │ │ ├── handle.go │ │ └── route.go │ ├── project │ │ ├── handle.go │ │ └── route.go │ ├── status │ │ ├── handle.go │ │ └── route.go │ ├── statusgroup │ │ ├── handle.go │ │ └── route.go │ └── version │ │ ├── handle.go │ │ └── route.go ├── bug.ini.default ├── bug.ini.tpl ├── bug.sql ├── cache │ ├── init.go │ └── perm.go ├── chat │ ├── chat.go │ └── server.go ├── classify │ └── classify.go ├── db │ ├── cachetable.go │ ├── mysqlErr.go │ └── sql.go ├── dockercompose │ ├── git.go │ └── git_test.go ├── encrypt │ ├── encrypt.go │ └── encrypt_test.go ├── entrypoint.sh ├── go.mod ├── go.sum ├── handle │ ├── admin.go │ ├── article.go │ ├── asset.go │ ├── bug.go │ ├── createarticle.go │ ├── dashboard.go │ ├── defaultvalue.go │ ├── doc.go │ ├── email.go │ ├── hook.go │ ├── keys.go │ ├── local.go │ ├── log.go │ ├── login.go │ ├── pass.go │ ├── publiccontroller │ │ ├── env.go │ │ ├── important.go │ │ ├── level.go │ │ ├── manager.go │ │ ├── position.go │ │ ├── project.go │ │ ├── showstatus.go │ │ ├── user.go │ │ ├── usergroup.go │ │ └── version.go │ ├── rolegroup.go │ ├── search.go │ ├── setting.go │ ├── sharefile.go │ ├── showimg.go │ ├── taskcontroller │ │ ├── complete.go │ │ ├── create.go │ │ ├── date_test.go │ │ ├── edit.go │ │ └── rescive.go │ ├── user.go │ └── usercontroller │ │ ├── email │ │ ├── get.go │ │ └── set.go │ │ ├── password.go │ │ └── usergroup │ │ ├── create.go │ │ ├── delete.go │ │ ├── getusers.go │ │ ├── list.go │ │ └── update.go ├── httpserver │ └── server.go ├── internal │ ├── bug │ │ ├── create.go │ │ ├── edit.go │ │ ├── manager.go │ │ ├── pass.go │ │ ├── show.go │ │ ├── status.go │ │ └── task.go │ ├── comment │ │ └── imformation.go │ ├── dashboard │ │ ├── bug.go │ │ └── bug_test.go │ ├── datalog │ │ └── log.go │ ├── defaults │ │ ├── get.go │ │ └── save.go │ ├── email │ │ └── mail.go │ ├── log │ │ └── log.go │ ├── rolegroup │ │ ├── resp.go │ │ └── roles.go │ ├── search │ │ └── mybugs.go │ ├── status │ │ ├── getnames.go │ │ ├── list.go │ │ ├── show.go │ │ └── statusgroup.go │ ├── user │ │ ├── changepassword.go │ │ ├── create.go │ │ ├── resp.go │ │ └── user.go │ └── version │ │ └── add.go ├── jwt │ ├── jwt.go │ └── jwt_test.go ├── mail │ └── mail.go ├── main.go ├── main_test.go ├── midware │ ├── permssion.go │ ├── public.go │ ├── user.go │ └── usermanager.go ├── model │ ├── auth.go │ ├── bugs.go │ ├── bugstatus.go │ ├── default.go │ ├── doc.go │ ├── email.go │ ├── env.go │ ├── header.go │ ├── important.go │ ├── information.go │ ├── init.go │ ├── job.go │ ├── level.go │ ├── log.go │ ├── perm.go │ ├── project.go │ ├── publish.go │ ├── restful.go │ ├── role.go │ ├── rolegroup.go │ ├── roles.go │ ├── sharefile.go │ ├── status.go │ ├── statusgroup.go │ ├── user.go │ ├── usergroup.go │ └── version.go ├── response │ └── response.go ├── routegroup │ ├── admin.go │ ├── api.go │ ├── bug.go │ ├── dashboard.go │ ├── department.go │ ├── document.go │ ├── document │ │ ├── doc.go │ │ └── key.go │ ├── hook.go │ ├── public.go │ ├── search.go │ ├── setting │ │ ├── status.go │ │ ├── statusgroup.go │ │ └── version.go │ ├── settingcenter.go │ ├── share.go │ ├── system.go │ ├── system │ │ ├── defaultvalue.go │ │ ├── email.go │ │ ├── log.go │ │ └── rolegroup.go │ ├── taskmanager.go │ ├── taskmanager │ │ └── create.go │ ├── user.go │ ├── usermanager.go │ └── usermanager │ │ ├── adduser.go │ │ ├── email.go │ │ ├── usergroup.go │ │ └── userlist.go ├── sc.yaml ├── sc_build.yaml ├── startmysql.sh ├── systemd │ └── itflow.service └── utils │ └── port.go ├── mysql └── conf │ └── .gitignore ├── package-lock.json └── vue ├── .editorconfig ├── .env.development ├── .env.staging ├── .eslintignore ├── .eslintrc.js ├── .github ├── FUNDING.yml └── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── question.md ├── .gitignore ├── .travis.yml ├── Dockerfile ├── LICENSE ├── README.es.md ├── README.ja.md ├── README.zh-CN.md ├── babel.config.js ├── build └── index.js ├── jest.config.js ├── jsconfig.json ├── package-copy.json ├── package.js.bak ├── package.json ├── plopfile.js ├── postcss.config.js ├── production.tpl ├── public ├── favicon.ico ├── favicon.icoaaa └── index.html ├── sc_build.yaml ├── src ├── App.vue ├── api │ ├── article.js │ ├── bugs.js │ ├── dashboard.js │ ├── defaultvalue.js │ ├── department.js │ ├── doc.js │ ├── email.js │ ├── env.js │ ├── get.js │ ├── group.js │ ├── header.js │ ├── important.js │ ├── key.js │ ├── level.js │ ├── log.js │ ├── login.js │ ├── position.js │ ├── project.js │ ├── restful.js │ ├── role.js │ ├── rolegroup.js │ ├── search.js │ ├── setting.js │ ├── status.js │ ├── statusgroup.js │ ├── transaction.js │ ├── upload.js │ ├── uploadimg.js │ ├── user.js │ ├── usermanager │ │ └── usergroup.js │ └── version.js ├── assets │ ├── 401_images │ │ └── 401.gif │ ├── 404_images │ │ ├── 404.png │ │ └── 404_cloud.png │ └── custom-theme │ │ ├── fonts │ │ ├── element-icons.ttf │ │ └── element-icons.woff │ │ └── index.css ├── components │ ├── Charts │ │ ├── Keyboard.vue │ │ ├── LineMarker.vue │ │ ├── MixChart.vue │ │ └── mixins │ │ │ └── resize.js │ ├── Hamburger │ │ └── index.vue │ ├── HeaderSearch │ │ └── index.vue │ ├── Pagination │ │ └── index.vue │ ├── RightPanel │ │ └── index.vue │ ├── Sticky │ │ └── index.vue │ └── SvgIcon │ │ └── index.vue ├── icons │ ├── index.js │ ├── svg │ │ ├── 404.svg │ │ ├── add.svg │ │ ├── bug.svg │ │ ├── chart.svg │ │ ├── clipboard.svg │ │ ├── component.svg │ │ ├── dashboard.svg │ │ ├── delete.svg │ │ ├── documentation.svg │ │ ├── download.svg │ │ ├── drag.svg │ │ ├── edit.svg │ │ ├── education.svg │ │ ├── email.svg │ │ ├── example.svg │ │ ├── excel.svg │ │ ├── exit-fullscreen.svg │ │ ├── eye-open.svg │ │ ├── eye.svg │ │ ├── file.svg │ │ ├── folder.svg │ │ ├── form.svg │ │ ├── fullscreen.svg │ │ ├── guide.svg │ │ ├── http.svg │ │ ├── icon.svg │ │ ├── international.svg │ │ ├── language.svg │ │ ├── link.svg │ │ ├── list.svg │ │ ├── lock.svg │ │ ├── message.svg │ │ ├── money.svg │ │ ├── more.svg │ │ ├── moveto.svg │ │ ├── nested.svg │ │ ├── password.svg │ │ ├── pdf.svg │ │ ├── people.svg │ │ ├── peoples.svg │ │ ├── qq.svg │ │ ├── remove.svg │ │ ├── rename.svg │ │ ├── search.svg │ │ ├── setting.svg │ │ ├── shopping.svg │ │ ├── shoppingCard.svg │ │ ├── size.svg │ │ ├── skill.svg │ │ ├── star.svg │ │ ├── tab.svg │ │ ├── table.svg │ │ ├── theme.svg │ │ ├── tree-table.svg │ │ ├── tree.svg │ │ ├── user.svg │ │ ├── wechat.svg │ │ └── zip.svg │ └── svgo.yml ├── layout │ ├── components │ │ ├── AppMain.vue │ │ ├── Navbar.vue │ │ ├── Sidebar │ │ │ ├── FixiOSBug.js │ │ │ ├── Item.vue │ │ │ ├── Link.vue │ │ │ ├── Logo.vue │ │ │ ├── SidebarItem.vue │ │ │ └── index.vue │ │ ├── TagsView │ │ │ ├── ScrollPane.vue │ │ │ └── index.vue │ │ └── index.js │ ├── index.vue │ └── mixin │ │ └── ResizeHandler.js ├── main.js ├── permission.js ├── router │ ├── index.js │ └── modules │ │ ├── bug.js │ │ ├── charts.js │ │ ├── components.js │ │ ├── doc.js │ │ ├── nested.js │ │ ├── setting.js │ │ ├── system.js │ │ ├── table.js │ │ └── user.js ├── settings.js ├── store │ ├── getters.js │ ├── index.js │ └── modules │ │ ├── app.js │ │ ├── permission.js │ │ ├── settings.js │ │ ├── tagsView.js │ │ └── user.js ├── styles │ ├── btn.scss │ ├── element-ui.scss │ ├── element-variables.scss │ ├── index.scss │ ├── mixin.scss │ ├── sidebar.scss │ ├── transition.scss │ └── variables.scss ├── utils │ ├── auth.js │ ├── clipboard.js │ ├── get-page-title.js │ ├── index.js │ ├── open-window.js │ ├── permission.js │ ├── request.js │ ├── scroll-to.js │ └── validate.js └── views │ ├── bug │ ├── allbugs.vue │ ├── components │ │ ├── ArticleDetail.vue │ │ ├── Bug │ │ │ └── Show.vue │ │ ├── Dropdown │ │ │ ├── Comment.vue │ │ │ ├── Platform.vue │ │ │ ├── SourceUrl.vue │ │ │ └── index.js │ │ └── Search.vue │ ├── create.vue │ ├── edit.vue │ ├── mybug.vue │ ├── mytask.vue │ └── show.vue │ ├── charts │ ├── keyboard.vue │ ├── line.vue │ ├── mix-chart.vue │ └── mixChart.vue │ ├── clipboard │ └── index.vue │ ├── dashboard │ ├── admin │ │ ├── components │ │ │ ├── LineChart.vue │ │ │ └── PanelGroup.vue │ │ └── index.vue │ └── index.vue │ ├── doc │ ├── doclist.vue │ └── keys.vue │ ├── login │ ├── auth-redirect.vue │ ├── authredirect.vue │ ├── components │ │ └── SocialSignin.vue │ ├── index.vue │ └── socialsignin.vue │ ├── profile │ ├── components │ │ ├── Account.vue │ │ ├── Activity.vue │ │ ├── Timeline.vue │ │ └── UserCard.vue │ └── index.vue │ ├── restful │ └── doc.vue │ ├── setting │ ├── Important.vue │ ├── Level.vue │ ├── bugGroup_remove.vue │ ├── env.vue │ ├── position.vue │ ├── project.vue │ ├── runos.vue │ ├── status.vue │ └── versionlist.vue │ ├── system │ ├── Log.vue │ ├── bugdustbin.vue │ ├── defaultValue.vue │ ├── email.vue │ └── roleGroup.vue │ └── user │ ├── UserGroup.vue │ ├── adduser.vue │ ├── changeinfo.vue │ ├── changepwd.vue │ ├── email.vue │ ├── headImg.vue │ └── usermanager.vue ├── test.js ├── vue.config.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | go/bin 2 | go/bug.ini 3 | go/*.db 4 | go/.idea 5 | vue/.DS_Store 6 | vue/node_modules/ 7 | vue/dist/ 8 | vue/npm-debug.log* 9 | vue/yarn-debug.log* 10 | vue/yarn-error.log* 11 | vue/**/*.log 12 | vue/test/unit/coverage 13 | vue/test/e2e/reports 14 | vue/selenium-debug.log 15 | # Editor directories and files 16 | vue/.idea 17 | vue/.vscode 18 | vue/*.suo 19 | vue/*.ntvs* 20 | vue/*.njsproj 21 | vue/*.sln 22 | vue/package-lock.json 23 | vue/src/config/config.js 24 | data 25 | 26 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:22-alpine 2 | WORKDIR /data 3 | COPY ./vue /data/ 4 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | 5.1.x | :white_check_mark: | 11 | | 5.0.x | :x: | 12 | | 4.0.x | :white_check_mark: | 13 | | < 4.0 | :x: | 14 | 15 | ## Reporting a Vulnerability 16 | 17 | Use this section to tell people how to report a vulnerability. 18 | 19 | Tell them where to go, how often they can expect to get an update on a 20 | reported vulnerability, what to expect if the vulnerability is accepted or 21 | declined, etc. 22 | -------------------------------------------------------------------------------- /UPDATE.md: -------------------------------------------------------------------------------- 1 | 版本更新可能优先于发布, 从1.0.4版本开始计时, 之前版本都忽略了 2 | 3 | #### v1.1.2 4 | 5 | - 解决完成任务按钮异常问题 6 | - 解决领取任务页面可以多人重复领悟的问题 7 | 8 | 9 | 10 | #### v1.1.1 11 | 12 | - 默认生成状态页和默认值, 可以自己做修改 13 | - 修复我的任务里面, 领取,转交,完成的状态无法更新的问题 14 | 15 | 16 | 17 | #### v1.1.0 18 | 19 | - 取消状态组 20 | - 修复领取时状态没修改 21 | - 修复我的任务能看到不是我的任务 22 | - 修复我的创建乱入问题 23 | - 修复状态不更新的问题, 临时使用刷新解决(非常不好的解决方法) 24 | 25 | 26 | 27 | #### v1.0.6 28 | 29 | - 修复添加版本列表的响应式数据异常 30 | - 版本号移动到底部 31 | - 修复增加职位时, 状态组和角色组没有同步更新的问题 32 | 33 | 34 | 35 | #### v1.0.5 36 | 37 | - 修复创建用户职位依赖 38 | - 重要性页面增加时id没显示, 增加操作提示 39 | - 优先级页面增加时id没显示, 增加操作提示 40 | - 职位页面添加依赖提示 41 | - 环境页面问题修复 42 | - 修复用户列表职位没显示出来 43 | - 权限修复 44 | 45 | ----------------------------------------------------- 46 | 47 | #### v1.0.4 48 | 49 | - 状态组可以选择空, 也表示显示所有 50 | 51 | - 我的任务状态组无法修改, 增加领取操作 52 | - 默认值增加领取任务的默认状态 53 | - 领取时添加完成的时间 54 | 55 | -------------------------------------------------------------------------------- /bug.ini: -------------------------------------------------------------------------------- 1 | # 是否使用了代码,为了获取ip,可能不起作用 2 | httpproxy = true 3 | # 监听地址 4 | listenaddr = :10001 5 | # 存放图片的目录 6 | imgdir = /data/bugimg/ 7 | # 图片显示的地址(用接口的地址) 8 | showbaseurl = http://127.0.0.1:10001/showimg 9 | # 盐值,建议修改,然后用curl http://127.0.0.1:10001/admin/reset?password=123 来修改admin密码 10 | salt = hjkkaksjdhfryuooweqzmbvc 11 | # 共享文件夹根目录 12 | sharedir = /share/ 13 | # 默认管理员id 14 | adminid = 1 15 | # 默认头像地址 16 | defaulthead = 17 | # token 过期时间 18 | expiration = 24h 19 | # 跨域的 20 | cross=* 21 | 22 | # ssl, 使用ssl 23 | [ssl] 24 | on = false 25 | cert = 26 | key = 27 | 28 | [log] 29 | # 日志目录, 不设置就控制台输出 30 | path = 31 | # 日志大小备份一次, 0为不切割大小 32 | size = 0 33 | # 每天备份一次 大小也存在的话,此项优先 ,false为不每天备份一次 34 | everyday = false 35 | 36 | [mysql] 37 | user = root 38 | pwd = "123456" 39 | host = 192.168.48.1 40 | port = 3306 41 | db = itflow 42 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: "3.7" 2 | name: itflow 3 | services: 4 | mysql: 5 | container_name: mysql 6 | image: mysql:5.7.30 7 | environment: 8 | MYSQL_ROOT_PASSWORD: 123456 9 | MYSQL_DATABASE: bug 10 | volumes: 11 | - ./mysql/conf:/etc/mysql/conf.d 12 | - ./mysql/data:/var/lib/mysql 13 | ports: 14 | - 127.0.0.1:3306:3306 15 | restart: always 16 | networks: 17 | - bug_network 18 | front: 19 | container_name: front 20 | command: 'npm run dev' 21 | image: vue 22 | environment: 23 | API_DOMAIN: http://127.0.0.1:10001 24 | volumes: 25 | - E:\\code\\ITflow:/data/dist 26 | networks: 27 | - bug_network 28 | 29 | # backend: 30 | # container_name: backend 31 | # image: vue 32 | # volumes: 33 | # - E:\\code\\ITflow\\go:/data/ 34 | 35 | # networks: 36 | # - bug_network 37 | volumes: 38 | - front 39 | 40 | 41 | -------------------------------------------------------------------------------- /go/.gitignore: -------------------------------------------------------------------------------- 1 | main 2 | main.exe -------------------------------------------------------------------------------- /go/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine 2 | WORKDIR /data 3 | COPY main . 4 | CMD ["./main"] 5 | -------------------------------------------------------------------------------- /go/README.md: -------------------------------------------------------------------------------- 1 | ### bug.ini配置文件说明 2 | ```ini 3 | 4 | 暂时只有下面的环境变量定义 5 | MYSQL_USER 6 | MYSQL_PASSWORD 7 | MYSQL_HOST 8 | MYSQL_PORT 9 | MYSQL_DB 10 | ADMINID 11 | SHOW_URL 12 | ACAO 13 | 14 | - 安装之前请确保安装了go>=1.16并配置了环境变量 15 | - 确保安装了mysql >= 5.7 16 | 17 | # 是否使用了代码,为了获取ip,可能不起作用 18 | httpproxy = true 19 | # 监听地址 20 | listenaddr = :10001 21 | # 存放图片的目录 22 | imgdir = /data/bugimg/ 23 | # 图片显示的地址(用接口的地址) 24 | showbaseurl = http://127.0.0.1:10001/showimg/ 25 | # 盐值,建议修改,然后用curl http://127.0.0.1:10001/admin/reset?password=123 来修改admin密码 26 | salt = hjkkaksjdhfryuooweqzmbvc 27 | # 共享文件夹根目录(已经废弃) 28 | sharedir = /share/ 29 | # 默认管理员id 30 | adminid = 1 31 | # 默认头像地址 32 | defaulthead = 33 | # token 过期时间 34 | expiration = 120m 35 | debug=true 36 | 37 | # ssl, 使用ssl 38 | [ssl] 39 | on = false 40 | cert = 41 | key = 42 | 43 | [log] 44 | # 日志目录, 不设置就控制台输出 45 | path = log/bug.log 46 | # 日志大小备份一次, 0为不切割大小 47 | size = 0 48 | # 每天备份一次 大小也存在的话,此项优先 ,false为不每天备份一次 49 | everyday = false 50 | 51 | [mysql] 52 | user = test 53 | pwd = "123456" 54 | host = 192.168.50.250 55 | port = 3306 56 | db = itflow 57 | 58 | [scs] 59 | domain=http://127.0.0.1:11111 60 | path = D:\myproject\ITflow\go 61 | 62 | ``` 63 | -------------------------------------------------------------------------------- /go/app/env/route.go: -------------------------------------------------------------------------------- 1 | package env 2 | 3 | import ( 4 | "itflow/model" 5 | 6 | "github.com/hyahm/xmux" 7 | ) 8 | 9 | // Env 环境路由 10 | var Env *xmux.RouteGroup 11 | 12 | func init() { 13 | Env = xmux.NewRouteGroup().AddPageKeys("env") 14 | 15 | Env.Post("/env/list", Read) 16 | 17 | Env.Post("/env/add", Create).BindJson(&model.Env{}) 18 | Env.Post("/env/update", Update).BindJson(&model.Env{}) 19 | Env.Get("/env/delete", Delete) 20 | } 21 | -------------------------------------------------------------------------------- /go/app/important/route.go: -------------------------------------------------------------------------------- 1 | package important 2 | 3 | import ( 4 | "itflow/model" 5 | 6 | "github.com/hyahm/xmux" 7 | ) 8 | 9 | var Important *xmux.RouteGroup 10 | 11 | func init() { 12 | Important = xmux.NewRouteGroup().AddPageKeys("important") 13 | 14 | Important.Post("/important/get", Read) 15 | 16 | Important.Post("/important/add", Create).BindJson(&model.Important{}) 17 | 18 | Important.Get("/important/del", Delete) 19 | 20 | Important.Post("/important/update", Update).BindJson(&model.Important{}) 21 | 22 | // Important.Post("/get/importants", GetImportants) 23 | 24 | } 25 | -------------------------------------------------------------------------------- /go/app/level/route.go: -------------------------------------------------------------------------------- 1 | package level 2 | 3 | import ( 4 | "itflow/model" 5 | 6 | "github.com/hyahm/xmux" 7 | ) 8 | 9 | var Level *xmux.RouteGroup 10 | 11 | func init() { 12 | Level = xmux.NewRouteGroup().AddPageKeys("level") 13 | 14 | Level.Post("/level/get", Read) 15 | 16 | Level.Post("/level/add", Create).BindJson(&model.Level{}) 17 | 18 | Level.Get("/level/del", Delete) 19 | 20 | Level.Post("/level/update", Update).BindJson(&model.Level{}) 21 | } 22 | -------------------------------------------------------------------------------- /go/app/position/route.go: -------------------------------------------------------------------------------- 1 | package position 2 | 3 | import ( 4 | "itflow/model" 5 | 6 | "github.com/hyahm/xmux" 7 | ) 8 | 9 | var Position *xmux.RouteGroup 10 | 11 | func init() { 12 | Position = xmux.NewRouteGroup().AddPageKeys("position") 13 | 14 | Position.Post("/position/list", Read) 15 | Position.Post("/position/add", Create).BindJson(&model.Job{}) 16 | 17 | Position.Get("/position/del", Delete) 18 | 19 | Position.Post("/position/update", Update).BindJson(&model.Job{}) 20 | 21 | // Position.Post("/get/positions", handle.GetPositions).AddModule(midware.UserPerm) 22 | } 23 | -------------------------------------------------------------------------------- /go/app/project/route.go: -------------------------------------------------------------------------------- 1 | package project 2 | 3 | import ( 4 | "itflow/model" 5 | 6 | "github.com/hyahm/xmux" 7 | ) 8 | 9 | //Project 项目路由 10 | var Project *xmux.RouteGroup 11 | 12 | func init() { 13 | Project = xmux.NewRouteGroup().AddPageKeys("project") 14 | Project.Post("/project/list", Read) 15 | 16 | Project.Post("/project/add", Create).BindJson(&model.Project{}) 17 | 18 | Project.Post("/project/update", Update).BindJson(&model.Project{}) 19 | 20 | Project.Get("/project/delete", Delete) 21 | 22 | Project.Post("/get/project", ProjectKeys) 23 | // Project.Post("/get/myproject", handle.GetMyProject).ApiDescribe("获取自己权限的项目名") 24 | } 25 | -------------------------------------------------------------------------------- /go/app/status/route.go: -------------------------------------------------------------------------------- 1 | package status 2 | 3 | import ( 4 | "itflow/model" 5 | 6 | "github.com/hyahm/xmux" 7 | ) 8 | 9 | // Status 状态路由组 10 | var Status *xmux.RouteGroup 11 | 12 | func init() { 13 | Status = xmux.NewRouteGroup().AddPageKeys("status") 14 | 15 | Status.Post("/status/list", Read) 16 | 17 | Status.Post("/status/add", Create).BindJson(&model.Status{}) 18 | 19 | Status.Get("/status/remove", Delete) 20 | 21 | Status.Post("/status/update", Update).BindJson(&model.Status{}) 22 | 23 | } 24 | -------------------------------------------------------------------------------- /go/app/statusgroup/route.go: -------------------------------------------------------------------------------- 1 | package statusgroup 2 | 3 | import ( 4 | "itflow/model" 5 | 6 | "github.com/hyahm/xmux" 7 | ) 8 | 9 | // StatusGroup 状态组路由 10 | var StatusGroup *xmux.RouteGroup 11 | 12 | func init() { 13 | StatusGroup = xmux.NewRouteGroup().AddPageKeys("statusgroup") 14 | 15 | StatusGroup.Post("/statusgroup/add", Create).BindJson(&model.StatusGroup{}) 16 | 17 | StatusGroup.Post("/statusgroup/edit", Update).BindJson(&model.StatusGroup{}) 18 | StatusGroup.Post("/statusgroup/list", Read) 19 | 20 | StatusGroup.Get("/statusgroup/remove", Delete) 21 | StatusGroup.Post("/statusgroup/keyname", GetStatusGroupName) 22 | } 23 | -------------------------------------------------------------------------------- /go/app/version/route.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | import ( 4 | "itflow/model" 5 | 6 | "github.com/hyahm/xmux" 7 | ) 8 | 9 | // Version bug版本 10 | var Version *xmux.RouteGroup 11 | 12 | func init() { 13 | // 所有路由同一格式, 第一行是pattern, method, bind 14 | // 第二行是中间件 如果没有中间件就下移 15 | // 第三行是api的主处理, ApiCreateGroup, ApiDelGroup 16 | // 请求头 17 | // 后面是api接口的次要处理 18 | // 最后是错误码 19 | Version = xmux.NewRouteGroup().AddPageKeys("version") 20 | Version.Post("/version/add", Create).BindJson(&model.Version{}) 21 | 22 | Version.Post("/version/list", Read) 23 | 24 | Version.Get("/version/remove", Delete) 25 | 26 | Version.Post("/get/version", GetVersion) 27 | 28 | Version.Post("/version/update", Update).BindJson(&model.Version{}) 29 | } 30 | -------------------------------------------------------------------------------- /go/bug.ini.default: -------------------------------------------------------------------------------- 1 | # 是否使用了代码,为了获取ip,可能不起作用 2 | httpproxy = true 3 | # 监听地址 4 | listenaddr = :10001 5 | # 存放图片的目录 6 | imgdir = /data/bugimg/ 7 | # 图片显示的地址(用接口的地址) 8 | showbaseurl = http://127.0.0.1:10001/showimg/ 9 | # 盐值,建议修改,然后用curl http://127.0.0.1:10001/admin/reset?password=123 来修改admin密码 10 | salt = hjkkaksjdhfryuooweqzmbvc 11 | # 默认管理员id 12 | adminid = 1 13 | # 默认头像地址 14 | defaulthead = 15 | # 跨域字段 16 | cross = * 17 | # token 过期时间 18 | expiration = 120m 19 | 20 | # ssl, 使用ssl 21 | [ssl] 22 | on = false 23 | cert = 24 | key = 25 | 26 | [log] 27 | # 日志目录, 不设置就控制台输出 28 | path = 29 | # 日志大小备份一次, 0为不切割大小 30 | size = 0 31 | # 每天备份一次 大小也存在的话,此项优先 ,false为不每天备份一次 32 | everyday = false 33 | 34 | [mysql] 35 | user = root 36 | pwd = "123456" 37 | host = 127.0.0.1 38 | port = 3306 39 | db = itflow 40 | -------------------------------------------------------------------------------- /go/bug.ini.tpl: -------------------------------------------------------------------------------- 1 | # 是否使用了代码,为了获取ip,可能不起作用 2 | httpproxy = true 3 | # 监听地址 4 | listenaddr = :10001 5 | # 存放图片的目录 6 | imgdir = /data/bugimg/ 7 | # 图片显示的地址(用接口的地址) 8 | showbaseurl = http://127.0.0.1:10001/showimg/ 9 | # 盐值,建议修改,然后用curl http://127.0.0.1:10001/admin/reset?password=123 来修改admin密码 10 | salt = hjkkaksjdhfryuooweqzmbvc 11 | 12 | # 默认管理员id 13 | adminid = 1 14 | # 默认头像地址 15 | defaulthead = 16 | # 跨域字段 17 | cross = * 18 | # token 过期时间 19 | expiration = 120m 20 | 21 | # ssl, 使用ssl 22 | [ssl] 23 | on = false 24 | cert = 25 | key = 26 | 27 | [log] 28 | # 日志目录, 不设置就控制台输出 29 | path = {{ .LOG_PATH }} 30 | # 日志大小备份一次, 0为不切割大小 31 | size = 0 32 | # 每天备份一次 大小也存在的话,此项优先 ,false为不每天备份一次 33 | everyday = false 34 | 35 | [mysql] 36 | user = {{ .MYSQL_USER }} 37 | pwd = {{ .MYSQL_PASSWORD }} 38 | host = {{ .MYSQL_HOST }} 39 | port = {{ .MYSQL_PORT }} 40 | db = {{ .MYSQL_DB }} 41 | -------------------------------------------------------------------------------- /go/cache/init.go: -------------------------------------------------------------------------------- 1 | package cache 2 | 3 | import ( 4 | "os" 5 | "strconv" 6 | "time" 7 | 8 | "github.com/hyahm/goconfig" 9 | "github.com/hyahm/golog" 10 | ) 11 | 12 | // 生成初始化本地缓存 13 | 14 | var ( 15 | // CacheRoleRid map[string]int64 16 | ImgDir string 17 | PrivateKey string 18 | ShowBaseUrl string 19 | Salt string 20 | Expirontion time.Duration 21 | // ShareDir string 22 | ) 23 | 24 | type UG struct { 25 | Ugid int64 26 | Name string 27 | Uids string 28 | } 29 | 30 | // cached 31 | var ( 32 | CacheRoleID map[int64]PageInfo 33 | DEADLINE time.Duration 34 | SUPERID int64 35 | ) 36 | 37 | func LoadConfig() { 38 | var err error 39 | SUPERID, err = strconv.ParseInt(goconfig.ReadEnv("ADMINID"), 10, 64) 40 | if err != nil { 41 | SUPERID = goconfig.ReadInt64("adminid", 1) 42 | } 43 | 44 | ImgDir = goconfig.ReadString("imgdir", "/data/bugimg/") 45 | err = os.MkdirAll(ImgDir, 0755) 46 | if err != nil { 47 | panic(err) 48 | } 49 | ShowBaseUrl = goconfig.ReadEnv("SHOW_URL", 50 | goconfig.ReadWithEndSlash("showbaseurl", " http://127.0.0.1:10001/showimg/")) 51 | Salt = goconfig.ReadEnv("SALT", goconfig.ReadString("salt", "hjkkaksjdhfryuooweqzmbvc")) 52 | // ShareDir = goconfig.ReadString("sharedir", "/share/") 53 | // // 创建共享文件夹 54 | // err = os.MkdirAll(ShareDir, 0755) 55 | // if err != nil { 56 | // panic(err) 57 | // } 58 | 59 | // CacheRoleRid = make(map[string]int64, 0) 60 | 61 | Expirontion = goconfig.ReadDuration("expiration", 120*time.Minute) 62 | golog.Info("cookie过期时间为:", Expirontion) 63 | 64 | // 添加一个admin 用户的权限,默认全是1 65 | 66 | } 67 | -------------------------------------------------------------------------------- /go/cache/perm.go: -------------------------------------------------------------------------------- 1 | package cache 2 | 3 | // 增删改查顺序 4 | var PermissionList = []string{"Read", "Create", "Update", "Delete"} 5 | 6 | // 索引对应 7 | var PermissionMap = map[string]int{ 8 | "Read": 0, 9 | "Create": 1, 10 | "Update": 2, 11 | "Delete": 3, 12 | } 13 | 14 | // 获取所有用户对应权限 15 | 16 | type PageInfo struct { 17 | Name string 18 | Info string 19 | } 20 | -------------------------------------------------------------------------------- /go/chat/chat.go: -------------------------------------------------------------------------------- 1 | package chat 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "log" 7 | "net" 8 | "os" 9 | ) 10 | 11 | func Chat() { 12 | conn, err := net.Dial("tcp", "127.0.0.1:7000") 13 | if err != nil { 14 | panic(err) 15 | } 16 | ch := make(chan bool) 17 | go userRead(conn) 18 | go userWrite(conn) 19 | <-ch 20 | } 21 | 22 | func userRead(conn net.Conn) { 23 | for { 24 | output := bufio.NewScanner(conn) 25 | for output.Scan() { 26 | fmt.Println(output.Text()) 27 | } 28 | } 29 | 30 | } 31 | 32 | func userWrite(conn net.Conn) { 33 | for { 34 | inputReader := bufio.NewReader(os.Stdin) 35 | input, err := inputReader.ReadString('\n') 36 | if err != nil { 37 | log.Println(err) 38 | } 39 | conn.Write([]byte(input)) 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /go/chat/server.go: -------------------------------------------------------------------------------- 1 | package chat 2 | 3 | import ( 4 | "bufio" 5 | "fmt" 6 | "log" 7 | "net" 8 | ) 9 | 10 | type client chan<- string 11 | 12 | var ( 13 | entering = make(chan client) 14 | leaving = make(chan client) 15 | messages = make(chan string) 16 | ) 17 | 18 | func broadcaster() { 19 | clients := make(map[client]bool) 20 | 21 | for { 22 | select { 23 | case msg := <-messages: 24 | for cli := range clients { 25 | cli <- msg 26 | } 27 | case cli := <-entering: 28 | clients[cli] = true 29 | 30 | case cli := <-leaving: 31 | delete(clients, cli) 32 | close(cli) 33 | } 34 | } 35 | } 36 | 37 | func main() { 38 | listener, err := net.Listen("tcp", ":7000") 39 | if err != nil { 40 | panic(err) 41 | } 42 | go broadcaster() 43 | for { 44 | conn, err := listener.Accept() 45 | if err != nil { 46 | log.Println(err) 47 | continue 48 | } 49 | go handleConn(conn) 50 | } 51 | } 52 | 53 | func handleConn(conn net.Conn) { 54 | ch := make(chan string) 55 | go clientWriter(conn, ch) 56 | 57 | who := conn.RemoteAddr().String() 58 | 59 | ch <- "you are " + who 60 | messages <- who + " has arrived" 61 | entering <- ch 62 | input := bufio.NewScanner(conn) 63 | 64 | for input.Scan() { 65 | messages <- who + ": " + input.Text() 66 | } 67 | 68 | leaving <- ch 69 | messages <- who + " has left" 70 | conn.Close() 71 | } 72 | 73 | func clientWriter(conn net.Conn, ch <-chan string) { 74 | for msg := range ch { 75 | fmt.Fprintln(conn, msg) 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /go/classify/classify.go: -------------------------------------------------------------------------------- 1 | package classify 2 | 3 | type Classify string 4 | 5 | const ( 6 | Login Classify = "login" 7 | User Classify = "user" 8 | Bug Classify = "bug" 9 | Version Classify = "version" 10 | Project Classify = "project" 11 | Env Classify = "env" 12 | StatusGroup Classify = "statusgroup" 13 | Role Classify = "role" 14 | Status Classify = "status" 15 | UserGroup Classify = "usergroup" 16 | Important Classify = "important" 17 | Level Classify = "level" 18 | Position Classify = "position" 19 | ) 20 | 21 | func (c Classify) String() string { 22 | return string(c) 23 | } 24 | 25 | var CLASSIFY = []string{ 26 | "login", "user", "statusgroup", "role", 27 | "bug", "version", "status", "usergroup", 28 | "project", "env", "important", "level", "position", 29 | } 30 | -------------------------------------------------------------------------------- /go/db/cachetable.go: -------------------------------------------------------------------------------- 1 | package db 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | 7 | "github.com/hyahm/cachetable" 8 | ) 9 | 10 | const ( 11 | TOKEN = "Token" 12 | NICKNAME = "NickName" 13 | ID = "Id" 14 | ) 15 | 16 | type Token struct { 17 | Token string 18 | NickName string 19 | Id int64 20 | } 21 | 22 | var Table *cachetable.Table 23 | var ct cachetable.CT 24 | 25 | func InitCacheTable() { 26 | ct = cachetable.NewCT() 27 | ct.Load(".token.db", &Token{}) 28 | err := ct.CreateTable(TOKEN, &Token{}) 29 | if err != nil { 30 | if err != cachetable.ExsitErr { 31 | panic(err) 32 | } 33 | 34 | } 35 | 36 | Table, _ = ct.Use(TOKEN) 37 | Table.SetKeys(TOKEN) 38 | 39 | go ct.Clean(time.Second * 10) 40 | } 41 | 42 | func SaveCacheTable() error { 43 | fmt.Println("save db") 44 | return ct.Save(".token.db") 45 | } 46 | -------------------------------------------------------------------------------- /go/db/mysqlErr.go: -------------------------------------------------------------------------------- 1 | package db 2 | 3 | import "errors" 4 | 5 | var DuplicateErr = errors.New("名称重复") 6 | -------------------------------------------------------------------------------- /go/encrypt/encrypt.go: -------------------------------------------------------------------------------- 1 | // include rsa md5 sha1 encrypt 2 | package encrypt 3 | 4 | import ( 5 | "crypto/md5" 6 | "crypto/rand" 7 | "crypto/rsa" 8 | "crypto/sha1" 9 | "crypto/x509" 10 | "encoding/base64" 11 | "encoding/pem" 12 | "errors" 13 | "fmt" 14 | "io" 15 | "strconv" 16 | "time" 17 | ) 18 | 19 | func PwdEncrypt(str string, salt string) string { 20 | return Sha1(Md5(str + salt)) 21 | 22 | } 23 | 24 | func Md5(s string) string { 25 | m := md5.New() 26 | io.WriteString(m, s) 27 | return fmt.Sprintf("%x", m.Sum(nil)) 28 | } 29 | 30 | func Sha1(s string) string { 31 | sha := sha1.New() 32 | io.WriteString(sha, s) 33 | return fmt.Sprintf("%x", sha.Sum(nil)) 34 | } 35 | 36 | // 37 | func Token(nickname string, salt string) string { 38 | 39 | str := rangeTime() + nickname + salt 40 | 41 | return PwdEncrypt(str, salt) 42 | 43 | } 44 | 45 | func rangeTime() string { 46 | t := time.Now().UnixNano() 47 | return strconv.FormatInt(t, 10) 48 | } 49 | 50 | func RsaDecrypt(pwd string, privatekey string, b64 bool) ([]byte, error) { 51 | if privatekey == "" { 52 | return nil, errors.New("私钥不能为空") 53 | } 54 | mm := []byte(pwd) 55 | if b64 { 56 | mm, _ = base64.StdEncoding.DecodeString(pwd) 57 | } 58 | 59 | block, _ := pem.Decode([]byte(privatekey)) 60 | if block == nil { 61 | return nil, errors.New("private key error!") 62 | } 63 | 64 | priv, err := x509.ParsePKCS1PrivateKey(block.Bytes) 65 | 66 | if err != nil { 67 | return nil, err 68 | } 69 | return rsa.DecryptPKCS1v15(rand.Reader, priv, mm) 70 | } 71 | -------------------------------------------------------------------------------- /go/encrypt/encrypt_test.go: -------------------------------------------------------------------------------- 1 | package encrypt 2 | 3 | import "testing" 4 | 5 | func TestSha1(t *testing.T) { 6 | p1 := PwdEncrypt("aaaa", "777777") 7 | t.Log(p1) 8 | } 9 | -------------------------------------------------------------------------------- /go/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | cat > bug.conf << EOF 3 | [http] 4 | # 是否使用了代码,为了获取ip,可能不起作用 5 | httpproxy=true 6 | 7 | [bug] 8 | # 监听地址 9 | listenaddr=${PORT:-:10001} 10 | # 存放图片的目录 11 | imgdir=/data/bugimg 12 | # 图片显示的地址 13 | showbaseurl=${IMG_SERVER_URI:-http://127.0.0.1:10001}/showimg 14 | # 私钥 15 | privatekeyfile=pri.key 16 | # 盐值,建议修改,然后用curl http://ip:10001/admin/reset?password=123 来修改root密码 17 | salt=hjkkaksjdhfryuooweqzmbvc 18 | # token 过期时间 19 | redisexpiration=120 20 | # 共享文件夹根目录 21 | sharedir=/share 22 | # 排除记录这些ip日志 23 | exclude=[] 24 | # api文档 25 | apihelp=false 26 | # 项目名 27 | apiname=itflow 28 | # ssl, 使用ssl 29 | ssl = false 30 | certfile= 31 | keyfile= 32 | 33 | [redis] 34 | redispwd =${REDIS_PWD:-__@picker-redis} 35 | redishost=${REDIS_HOST:-172.17.0.1:6379} 36 | redisdb=${REDIS_DB:-0} 37 | 38 | [mysql] 39 | mysqluser=${MYSQL_USER:-cander} 40 | mysqlpwd=${MYSQL_PWD:-rF7oJBKopxiLJYyW2XJ&h&tyHX95D4} 41 | mysqlhost=${MYSQL_HOST:-hyahm.com} 42 | mysqlport=${MYSQL_PORT:-3306} 43 | mysqldb=${MYSQL_DB:-project} 44 | sqldriver=${DRIVER:-mysql} 45 | 46 | [log] 47 | # 日志目录 48 | logpath=/data/log 49 | # 日志大小备份一次, 0为不切割大小 50 | logsize=0 51 | # 每天备份一次 大小也存在的话,此项优先 ,false为不每天备份一次 52 | logeveryday=false 53 | EOF 54 | 55 | exec "$@" 56 | -------------------------------------------------------------------------------- /go/go.mod: -------------------------------------------------------------------------------- 1 | module itflow 2 | 3 | go 1.16 4 | 5 | require ( 6 | github.com/go-git/go-git/v5 v5.4.2 7 | github.com/go-sql-driver/mysql v1.6.0 8 | github.com/hyahm/cachetable v0.0.0-20200707100838-5dd5455ce3d5 9 | github.com/hyahm/goconfig v0.0.0-20220416013428-af75691b369c 10 | github.com/hyahm/golog v0.0.0-20220331081316-c10def14fc7d 11 | github.com/hyahm/gomysql v0.0.0-20220418070505-2884f7f111e8 12 | github.com/hyahm/xmux v0.0.0-20220501155105-5491749854b4 13 | golang.org/x/crypto v0.35.0 14 | gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect 15 | gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df 16 | gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect 17 | ) 18 | -------------------------------------------------------------------------------- /go/handle/admin.go: -------------------------------------------------------------------------------- 1 | package handle 2 | 3 | import ( 4 | "itflow/cache" 5 | "itflow/encrypt" 6 | "itflow/model" 7 | "itflow/response" 8 | "net/http" 9 | "strings" 10 | 11 | "github.com/hyahm/golog" 12 | "github.com/hyahm/xmux" 13 | ) 14 | 15 | func Reset(w http.ResponseWriter, r *http.Request) { 16 | addr := strings.Split(r.RemoteAddr, ":") 17 | if addr[0] != "127.0.0.1" { 18 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 19 | xmux.GetInstance(r).Response.(*response.Response).Msg = "only 127.0.0.1 cat request" 20 | return 21 | } 22 | password := r.FormValue("password") 23 | user := model.User{} 24 | 25 | enpassword := encrypt.PwdEncrypt(password, cache.Salt) 26 | 27 | err := user.UpdateAdminPassword(enpassword) 28 | if err != nil { 29 | golog.Error(err) 30 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 31 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 32 | return 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /go/handle/asset.go: -------------------------------------------------------------------------------- 1 | package handle 2 | 3 | import ( 4 | "errors" 5 | "itflow/classify" 6 | "itflow/db" 7 | "strings" 8 | "time" 9 | ) 10 | 11 | var NotFoundToken = errors.New("not found token") 12 | 13 | // func sortpermlist(permlist []string) []string { 14 | // l := len(cache.CacheSidStatus) 15 | 16 | // newlist := make([]string, 0) 17 | // for i := 0; i < l; i++ { 18 | // for _, v := range permlist { 19 | // if cache.CacheSidStatus[cache.StatusId(i)].ToString() == v { 20 | // newlist = append(newlist, v) 21 | // } 22 | // } 23 | // } 24 | // return newlist 25 | // } 26 | 27 | // 插入到log表中 28 | func InsertLog(classify classify.Classify, content string, ipaddr string) error { 29 | logsql := "insert into log(exectime,classify,content,ip) values(?,?,?,?)" 30 | ip := strings.Split(ipaddr, ":")[0] 31 | if ip != "127.0.0.1" { 32 | result := db.Mconn.Insert(logsql, time.Now().Unix(), classify, content, ip) 33 | if result.Err != nil { 34 | return result.Err 35 | } 36 | } 37 | 38 | return nil 39 | } 40 | -------------------------------------------------------------------------------- /go/handle/createarticle.go: -------------------------------------------------------------------------------- 1 | package handle 2 | 3 | import ( 4 | "net/http" 5 | //"strings" 6 | ) 7 | 8 | type projectList struct { 9 | ProjectList []string `json:"projectlist"` 10 | Code int `json:"code"` 11 | } 12 | 13 | func GetProject(w http.ResponseWriter, r *http.Request) { 14 | 15 | // pl := &projectList{} 16 | 17 | // // for _, v := range cache.CachePidProject { 18 | // // pl.ProjectList = append(pl.ProjectList, v.ToString()) 19 | // // } 20 | // send, _ := json.Marshal(pl) 21 | // w.Write(send) 22 | // return 23 | 24 | } 25 | 26 | // func GetMyProject(w http.ResponseWriter, r *http.Request) { 27 | // myproject := &project.MyProject{ 28 | // Name: make([]string, 0), 29 | // } 30 | // uid := xmux.GetInstance(r).Get("uid").(int64) 31 | 32 | // w.Write(myproject.Get(uid)) 33 | // return 34 | 35 | // } 36 | -------------------------------------------------------------------------------- /go/handle/defaultvalue.go: -------------------------------------------------------------------------------- 1 | package handle 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | 10 | "github.com/hyahm/xmux" 11 | ) 12 | 13 | func DefaultStatus(w http.ResponseWriter, r *http.Request) { 14 | 15 | //如果是管理员的话,所有的都可以 16 | xmux.GetInstance(r).Response.(*response.Response).Data = model.Default 17 | } 18 | 19 | func DefaultSave(w http.ResponseWriter, r *http.Request) { 20 | 21 | sl := xmux.GetInstance(r).Data.(*model.DefaultValue) 22 | err := sl.Update() 23 | if err != nil { 24 | golog.Error(err) 25 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 26 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 27 | return 28 | } 29 | model.Default.Created = sl.Created 30 | model.Default.Completed = sl.Completed 31 | model.Default.Pass = sl.Pass 32 | model.Default.Receive = sl.Receive 33 | } 34 | -------------------------------------------------------------------------------- /go/handle/local.go: -------------------------------------------------------------------------------- 1 | package handle 2 | 3 | import ( 4 | "itflow/db" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func GetExpire(w http.ResponseWriter, r *http.Request) { 13 | token := xmux.Var(r)["token"] 14 | golog.Info(token) 15 | filter, err := db.Table.Filter("Token", token) 16 | if err != nil { 17 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 18 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 19 | return 20 | } 21 | time := filter.TTL() 22 | xmux.GetInstance(r).Response.(*response.Response).UpdateTime = int64(time) 23 | } 24 | -------------------------------------------------------------------------------- /go/handle/publiccontroller/env.go: -------------------------------------------------------------------------------- 1 | package publiccontroller 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func GetEnvKeyName(w http.ResponseWriter, r *http.Request) { 13 | pkns, err := model.GetAllEnv() 14 | if err != nil { 15 | golog.Error(err) 16 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 17 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 18 | return 19 | } 20 | xmux.GetInstance(r).Response.(*response.Response).Data = pkns 21 | } 22 | -------------------------------------------------------------------------------- /go/handle/publiccontroller/important.go: -------------------------------------------------------------------------------- 1 | package publiccontroller 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func GetImportantKeyName(w http.ResponseWriter, r *http.Request) { 13 | pkns, err := model.GetAllImportant() 14 | if err != nil { 15 | golog.Error(err) 16 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 17 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 18 | return 19 | } 20 | 21 | xmux.GetInstance(r).Response.(*response.Response).Data = pkns 22 | } 23 | -------------------------------------------------------------------------------- /go/handle/publiccontroller/level.go: -------------------------------------------------------------------------------- 1 | package publiccontroller 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func GetLevelKeyName(w http.ResponseWriter, r *http.Request) { 13 | pkns, err := model.GetLevelKeyNameByUid() 14 | if err != nil { 15 | golog.Error(err) 16 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 17 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 18 | return 19 | } 20 | xmux.GetInstance(r).Response.(*response.Response).Data = pkns 21 | } 22 | -------------------------------------------------------------------------------- /go/handle/publiccontroller/manager.go: -------------------------------------------------------------------------------- 1 | package publiccontroller 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func GetManagerKeyName(w http.ResponseWriter, r *http.Request) { 13 | uid := xmux.GetInstance(r).Get("uid").(int64) 14 | 15 | kns, err := model.GetManagerKeyName(uid) 16 | if err != nil { 17 | golog.Error(err) 18 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 19 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 20 | return 21 | } 22 | xmux.GetInstance(r).Response.(*response.Response).Data = kns 23 | } 24 | -------------------------------------------------------------------------------- /go/handle/publiccontroller/position.go: -------------------------------------------------------------------------------- 1 | package publiccontroller 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func GetPositionKeyName(w http.ResponseWriter, r *http.Request) { 13 | uid := xmux.GetInstance(r).Get("uid").(int64) 14 | pkns, err := model.GetJobKeyNameByUid(uid) 15 | if err != nil { 16 | golog.Error(err) 17 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 18 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 19 | return 20 | } 21 | xmux.GetInstance(r).Response.(*response.Response).Data = pkns 22 | } 23 | -------------------------------------------------------------------------------- /go/handle/publiccontroller/project.go: -------------------------------------------------------------------------------- 1 | package publiccontroller 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func GetProjectKeyName(w http.ResponseWriter, r *http.Request) { 13 | uid := xmux.GetInstance(r).Get("uid").(int64) 14 | pkns, err := model.GetProjectKeyName(uid) 15 | if err != nil { 16 | golog.Error(err) 17 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 18 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 19 | return 20 | } 21 | xmux.GetInstance(r).Response.(*response.Response).Data = pkns 22 | } 23 | -------------------------------------------------------------------------------- /go/handle/publiccontroller/showstatus.go: -------------------------------------------------------------------------------- 1 | package publiccontroller 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func ShowStatus(w http.ResponseWriter, r *http.Request) { 13 | // 获取显示的状态id 14 | // sl := xmux.GetInstance(r).Data.(*status.Status) 15 | 16 | uid := xmux.GetInstance(r).Get("uid").(int64) 17 | ss, err := model.GetShowStatus(uid) 18 | if err != nil { 19 | golog.Error(err) 20 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 21 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 22 | return 23 | } 24 | xmux.GetInstance(r).Response.(*response.Response).Data = ss 25 | } 26 | -------------------------------------------------------------------------------- /go/handle/publiccontroller/user.go: -------------------------------------------------------------------------------- 1 | package publiccontroller 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func GetUserKeyNameByProject(w http.ResponseWriter, r *http.Request) { 13 | rvkn := xmux.GetInstance(r).Data.(*RequestProject) 14 | vkns, err := model.GetUserKeyNameByProjectId(rvkn.ProjectId) 15 | if err != nil { 16 | golog.Error(err) 17 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 18 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 19 | return 20 | } 21 | xmux.GetInstance(r).Response.(*response.Response).Data = vkns 22 | } 23 | 24 | // 获取用户信息 25 | func GetUserKeyName(w http.ResponseWriter, r *http.Request) { 26 | uid := xmux.GetInstance(r).Get("uid").(int64) 27 | 28 | kns, err := model.GetUserKeyName(uid) 29 | if err != nil { 30 | golog.Error(err) 31 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 32 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 33 | return 34 | } 35 | xmux.GetInstance(r).Response.(*response.Response).Data = kns 36 | } 37 | -------------------------------------------------------------------------------- /go/handle/publiccontroller/usergroup.go: -------------------------------------------------------------------------------- 1 | package publiccontroller 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func GetUserGroupKeyName(w http.ResponseWriter, r *http.Request) { 13 | pkns, err := model.GetUserGroupKeyNameByUid() 14 | if err != nil { 15 | golog.Error(err) 16 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 17 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 18 | return 19 | } 20 | xmux.GetInstance(r).Response.(*response.Response).Data = pkns 21 | } 22 | -------------------------------------------------------------------------------- /go/handle/publiccontroller/version.go: -------------------------------------------------------------------------------- 1 | package publiccontroller 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | type RequestProject struct { 13 | ProjectId int64 `json:"project_id"` 14 | } 15 | 16 | func GetVersionKeyNameByProject(w http.ResponseWriter, r *http.Request) { 17 | rvkn := xmux.GetInstance(r).Data.(*RequestProject) 18 | 19 | vkns, err := model.GetVersionKeyNameByProjectId(rvkn.ProjectId) 20 | if err != nil { 21 | golog.Error(err) 22 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 23 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 24 | return 25 | } 26 | 27 | xmux.GetInstance(r).Response.(*response.Response).Data = vkns 28 | 29 | } 30 | -------------------------------------------------------------------------------- /go/handle/sharefile.go: -------------------------------------------------------------------------------- 1 | package handle 2 | -------------------------------------------------------------------------------- /go/handle/showimg.go: -------------------------------------------------------------------------------- 1 | package handle 2 | 3 | import ( 4 | "io" 5 | "itflow/cache" 6 | "net/http" 7 | "os" 8 | "path/filepath" 9 | 10 | "github.com/hyahm/golog" 11 | "github.com/hyahm/xmux" 12 | ) 13 | 14 | func ShowImg(w http.ResponseWriter, r *http.Request) { 15 | 16 | name := xmux.Var(r)["imgname"] 17 | file, err := os.Open(filepath.Join(cache.ImgDir, name)) 18 | if err != nil { 19 | golog.Error(err) 20 | return 21 | } 22 | defer file.Close() 23 | io.Copy(w, file) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /go/handle/taskcontroller/complete.go: -------------------------------------------------------------------------------- 1 | package taskcontroller 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | "time" 8 | 9 | "github.com/hyahm/golog" 10 | "github.com/hyahm/xmux" 11 | ) 12 | 13 | func Complete(w http.ResponseWriter, r *http.Request) { 14 | 15 | if model.Default.Completed <= 0 { 16 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 17 | xmux.GetInstance(r).Response.(*response.Response).Msg = "no permission" 18 | return 19 | } 20 | // 需要 21 | bug := xmux.GetInstance(r).Data.(*model.Bug) 22 | uid := xmux.GetInstance(r).Get("uid").(int64) 23 | bug.Sid = model.Default.Completed 24 | bug.UpdateTime = time.Now().Unix() 25 | bug.Uid = uid 26 | 27 | // 判断是否有默认值 28 | err := bug.UpdateStatus() 29 | if err != nil { 30 | golog.Error(err) 31 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 32 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 33 | return 34 | } 35 | 36 | // res := response.Response{ 37 | // UserIds: bug.Uids, 38 | // } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /go/handle/taskcontroller/date_test.go: -------------------------------------------------------------------------------- 1 | package taskcontroller 2 | 3 | import ( 4 | "testing" 5 | "time" 6 | ) 7 | 8 | func TestDate(t *testing.T) { 9 | t.Log(time.Unix(time.Now().Unix(), 0).Format("2006-01-02 15:04:05")) 10 | } 11 | -------------------------------------------------------------------------------- /go/handle/taskcontroller/edit.go: -------------------------------------------------------------------------------- 1 | package taskcontroller 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | // 通过id 过去 bug 13 | func Get(w http.ResponseWriter, r *http.Request) { 14 | id := r.FormValue("id") 15 | uid := xmux.GetInstance(r).Get("uid").(int64) 16 | bug, err := model.GetBugById(id, uid) 17 | if err != nil { 18 | golog.Error(err) 19 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 20 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 21 | return 22 | } 23 | xmux.GetInstance(r).Response.(*response.Response).Data = bug 24 | 25 | } 26 | -------------------------------------------------------------------------------- /go/handle/user.go: -------------------------------------------------------------------------------- 1 | package handle 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func UserKeyName(w http.ResponseWriter, r *http.Request) { 13 | // 获取用户keyvalue 14 | uid := xmux.GetInstance(r).Get("uid").(int64) 15 | kns, err := model.GetUserKeyName(uid) 16 | if err != nil { 17 | golog.Error(err) 18 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 19 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 20 | return 21 | } 22 | xmux.GetInstance(r).Response.(*response.Response).Data = kns 23 | } 24 | -------------------------------------------------------------------------------- /go/handle/usercontroller/email/get.go: -------------------------------------------------------------------------------- 1 | package email 2 | 3 | import ( 4 | "itflow/db" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/xmux" 9 | ) 10 | 11 | func Get(w http.ResponseWriter, r *http.Request) { 12 | // errorcode := &response.Response{} 13 | 14 | id := xmux.GetInstance(r).Get("uid") 15 | var email string 16 | err := db.Mconn.GetOne("select email from user where id=?", id).Scan(&email) 17 | if err != nil { 18 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 19 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 20 | return 21 | } 22 | xmux.GetInstance(r).Response.(*response.Response).Data = email 23 | } 24 | -------------------------------------------------------------------------------- /go/handle/usercontroller/email/set.go: -------------------------------------------------------------------------------- 1 | package email 2 | 3 | import ( 4 | "io/ioutil" 5 | "itflow/db" 6 | "itflow/response" 7 | "net/http" 8 | 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func Set(w http.ResponseWriter, r *http.Request) { 13 | id := xmux.GetInstance(r).Get("uid") 14 | b, err := ioutil.ReadAll(r.Body) 15 | if err != nil { 16 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 17 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 18 | return 19 | } 20 | result := db.Mconn.Update("update user set email=? where id=?", string(b), id) 21 | if result.Err != nil { 22 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 23 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 24 | return 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /go/handle/usercontroller/password.go: -------------------------------------------------------------------------------- 1 | package usercontroller 2 | 3 | import ( 4 | "itflow/cache" 5 | "itflow/encrypt" 6 | "itflow/model" 7 | "itflow/response" 8 | "net/http" 9 | 10 | "github.com/hyahm/golog" 11 | "github.com/hyahm/xmux" 12 | ) 13 | 14 | type ChangePasswod struct { 15 | Oldpassword string `json:"oldpassword"` 16 | Newpassword string `json:"newpassword"` 17 | } 18 | 19 | func ChangePassword(w http.ResponseWriter, r *http.Request) { 20 | uid := xmux.GetInstance(r).Get("uid").(int64) 21 | getuser := xmux.GetInstance(r).Data.(*ChangePasswod) 22 | oldpassword := encrypt.PwdEncrypt(getuser.Oldpassword, cache.Salt) 23 | newpassword := encrypt.PwdEncrypt(getuser.Newpassword, cache.Salt) 24 | user := model.User{ 25 | ID: uid, 26 | Password: newpassword, 27 | } 28 | err := user.UpdatePassword(oldpassword) 29 | if err != nil { 30 | golog.Error(err) 31 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 32 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 33 | return 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /go/handle/usercontroller/usergroup/create.go: -------------------------------------------------------------------------------- 1 | package usergroup 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func Create(w http.ResponseWriter, r *http.Request) { 13 | // 可以获取所有用户组 14 | ug := xmux.GetInstance(r).Data.(*model.UserGroup) 15 | ug.Uid = xmux.GetInstance(r).Get("uid").(int64) 16 | err := ug.Create() 17 | if err != nil { 18 | golog.Error(err) 19 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 20 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 21 | return 22 | } 23 | xmux.GetInstance(r).Response.(*response.Response).ID = ug.Id 24 | } 25 | -------------------------------------------------------------------------------- /go/handle/usercontroller/usergroup/delete.go: -------------------------------------------------------------------------------- 1 | package usergroup 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func Delete(w http.ResponseWriter, r *http.Request) { 13 | id := r.FormValue("id") 14 | uid := xmux.GetInstance(r).Get("uid").(int64) 15 | ug := model.UserGroup{ 16 | Uid: uid, 17 | } 18 | err := ug.Delete((id)) 19 | if err != nil { 20 | golog.Error(err) 21 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 22 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 23 | return 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /go/handle/usercontroller/usergroup/getusers.go: -------------------------------------------------------------------------------- 1 | package usergroup 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func GetAllUserKeyName(w http.ResponseWriter, r *http.Request) { 13 | vkns, err := model.GetAllUserKeyName() 14 | if err != nil { 15 | golog.Error(err) 16 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 17 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 18 | return 19 | } 20 | xmux.GetInstance(r).Response.(*response.Response).Data = vkns 21 | } 22 | -------------------------------------------------------------------------------- /go/handle/usercontroller/usergroup/list.go: -------------------------------------------------------------------------------- 1 | package usergroup 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func List(w http.ResponseWriter, r *http.Request) { 13 | // 可以获取所有用户组 14 | uid := xmux.GetInstance(r).Get("uid").(int64) 15 | usergroups, err := model.GetUserGroupList(uid) 16 | if err != nil { 17 | golog.Error(err) 18 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 19 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 20 | return 21 | } 22 | xmux.GetInstance(r).Response.(*response.Response).Data = usergroups 23 | 24 | } 25 | -------------------------------------------------------------------------------- /go/handle/usercontroller/usergroup/update.go: -------------------------------------------------------------------------------- 1 | package usergroup 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func Update(w http.ResponseWriter, r *http.Request) { 13 | // 可以获取所有用户组 14 | uid := xmux.GetInstance(r).Get("uid").(int64) 15 | ug := xmux.GetInstance(r).Data.(*model.UserGroup) 16 | ug.Uid = uid 17 | err := ug.Update() 18 | if err != nil { 19 | golog.Error(err) 20 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 21 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 22 | return 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /go/internal/bug/edit.go: -------------------------------------------------------------------------------- 1 | package bug 2 | 3 | // func (reb *EditBug) ToResp(b *model.Bug) error { 4 | // // 将获取的数据转为可以存表的数据 5 | 6 | // reb.Id = b.ID 7 | 8 | // reb.Content = b.Content 9 | // reb.Title = b.Title 10 | 11 | // var ok bool 12 | // reb.Level = cache.LevelId(b.LevelId).Name() 13 | // if reb.Level == "" { 14 | // return errors.New("没有找到level key") 15 | // } 16 | // reb.Projectname = b.ProjectId.Name() 17 | // if reb.Projectname == "" { 18 | // return errors.New("没有找到project key") 19 | // } 20 | // // 21 | // if reb.Envname, ok = cache.CacheEidEnv[b.EnvId]; !ok { 22 | // return errors.New("没有找到env key") 23 | // } 24 | // // 25 | // if reb.Important, ok = cache.CacheIidImportant[b.ImportanceId]; !ok { 26 | // return errors.New("没有找到important key") 27 | // } 28 | // if reb.Version, ok = cache.CacheVidVersion[b.VersionId]; !ok { 29 | // return errors.New("没有找到version key") 30 | // } 31 | 32 | // reb.Selectusers = b.OprateUsers.UsersIdToRealName() 33 | // return nil 34 | // } 35 | -------------------------------------------------------------------------------- /go/internal/bug/manager.go: -------------------------------------------------------------------------------- 1 | package bug 2 | 3 | type BugManager struct { 4 | Page int `json:"page"` 5 | Limit int `json:"limit"` 6 | Id int `json:"id"` 7 | Title string `json:"title"` 8 | Author string `json:"author"` 9 | } 10 | -------------------------------------------------------------------------------- /go/internal/bug/pass.go: -------------------------------------------------------------------------------- 1 | package bug 2 | 3 | type PassBug struct { 4 | Id int64 `json:"id" type:"string" need:"是" default:"" information:"bug的id"` 5 | Date int64 `json:"date" type:"string" need:"是" default:"" information:"提交事件"` 6 | Remark string `json:"remark" type:"string" need:"是" default:"" information:"说明"` 7 | SelectUsers []string `json:"selectusers" type:"string" need:"是" default:"" information:"转交的任务"` 8 | Status string `json:"status" type:"string" need:"是" default:"" information:"转交后的状态"` 9 | User string `json:"user" type:"string" need:"是" default:"" information:"处理人"` 10 | ProjectName string `json:"projectname" type:"string" need:"是" default:"" information:"项目名"` 11 | Code int `json:"code" type:"int" need:"是" default:"" information:"错误码"` 12 | } 13 | -------------------------------------------------------------------------------- /go/internal/bug/show.go: -------------------------------------------------------------------------------- 1 | package bug 2 | 3 | import ( 4 | "encoding/json" 5 | "itflow/internal/comment" 6 | 7 | "github.com/hyahm/golog" 8 | ) 9 | 10 | type RespShowBug struct { 11 | Status string `json:"status"` 12 | Title string `json:"title"` 13 | Content string `json:"content"` 14 | Id int64 `json:"id"` 15 | Selectusers []string `json:"selectuser"` 16 | Important string `json:"important"` 17 | Level string `json:"level"` 18 | Projectname string `json:"projectname"` 19 | Envname string `json:"envname"` 20 | Version string `json:"version"` 21 | Code int `json:"code"` 22 | Msg string `json:"msg,omitempty"` 23 | Comments []*comment.Informations `json:"comments,omitempty"` 24 | Url []string `json:"url,omitempty"` 25 | Typ int `json:"typ"` 26 | } 27 | 28 | func (rsb *RespShowBug) Marshal() []byte { 29 | send, err := json.Marshal(rsb) 30 | if err != nil { 31 | golog.Error(err) 32 | } 33 | return send 34 | } 35 | 36 | func (rsb *RespShowBug) Error(msg string) []byte { 37 | rsb.Code = 1 38 | rsb.Msg = msg 39 | return rsb.Marshal() 40 | } 41 | 42 | func (rsb *RespShowBug) ErrorE(err error) []byte { 43 | return rsb.Error(err.Error()) 44 | } 45 | -------------------------------------------------------------------------------- /go/internal/bug/status.go: -------------------------------------------------------------------------------- 1 | package bug 2 | 3 | // type ReqStatus struct { 4 | // Id int64 `json:"id" type:"int" need:"是" default:"0" information:"无效"` 5 | // Name string `json:"name" type:"string" need:"是" default:"" information:"状态的名称"` 6 | // } 7 | 8 | // type ListStatus struct { 9 | // StatusList []string `json:"statuslist,omitempty" type:"array" need:"否" information:"状态列表"` 10 | // Code int `json:"code" type:"int" need:"是" information:"状态码"` 11 | // } 12 | 13 | // // 添加状态管理返回的错误 14 | // type ResponeStatus struct { 15 | // Id int64 `json:"id" type:"int" need:"是" default:"0" information:"返回插入的id"` 16 | // Code int `json:"code" type:"int" need:"是" default:"" information:"状态码"` 17 | // Msg string `json:"msg" type:"string" need:"否" default:"" information:"错误信息"` 18 | // } 19 | 20 | // func (rs *ResponeStatus) Success() []byte { 21 | 22 | // send, _ := json.Marshal(rs) 23 | // return send 24 | // } 25 | 26 | type ChangeStatus struct { 27 | Id int `json:"id"` 28 | Status string `json:"status"` 29 | Code int `json:"code"` 30 | } 31 | -------------------------------------------------------------------------------- /go/internal/bug/task.go: -------------------------------------------------------------------------------- 1 | package bug 2 | 3 | type SearchParam struct { 4 | Page int `json:"page"` 5 | Limit int `json:"limit"` 6 | Level string `json:"level"` 7 | Project string `json:"project"` 8 | Title string `json:"title"` 9 | Status []string `json:"status"` 10 | } 11 | -------------------------------------------------------------------------------- /go/internal/comment/imformation.go: -------------------------------------------------------------------------------- 1 | package comment 2 | 3 | type Informations struct { 4 | User string `json:"user"` 5 | Date int64 `json:"date"` 6 | Info string `json:"info"` 7 | } 8 | -------------------------------------------------------------------------------- /go/internal/dashboard/bug_test.go: -------------------------------------------------------------------------------- 1 | package dashboard 2 | 3 | import "testing" 4 | 5 | func TestCount(t *testing.T) { 6 | GetCount() 7 | } 8 | -------------------------------------------------------------------------------- /go/internal/datalog/log.go: -------------------------------------------------------------------------------- 1 | package datalog 2 | -------------------------------------------------------------------------------- /go/internal/defaults/get.go: -------------------------------------------------------------------------------- 1 | package defaults 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/hyahm/golog" 7 | ) 8 | 9 | type RespDefaultStatus struct { 10 | Created string `json:"created"` 11 | Completed string `json:"completed"` 12 | Code int `json:"code"` 13 | Msg string `json:"msg,omitempty"` 14 | } 15 | 16 | func (rds *RespDefaultStatus) Marshal() []byte { 17 | send, err := json.Marshal(rds) 18 | if err != nil { 19 | golog.Error(err) 20 | } 21 | return send 22 | } 23 | 24 | func (rds *RespDefaultStatus) Error(msg string) []byte { 25 | rds.Code = 1 26 | rds.Msg = msg 27 | return rds.Marshal() 28 | } 29 | 30 | func (rds *RespDefaultStatus) ErrorE(err error) []byte { 31 | return rds.Error(err.Error()) 32 | } 33 | -------------------------------------------------------------------------------- /go/internal/defaults/save.go: -------------------------------------------------------------------------------- 1 | package defaults 2 | -------------------------------------------------------------------------------- /go/internal/email/mail.go: -------------------------------------------------------------------------------- 1 | package email 2 | 3 | type Email struct { 4 | Host string `json:"host"` 5 | Enable bool `json:"enable"` 6 | Id int64 `json:"id"` 7 | Port int `json:"port"` 8 | EmailAddr string `json:"email"` 9 | Nickname string `json:"nickname"` 10 | Password string `json:"password"` 11 | To string `json:"to"` 12 | Code int `json:"code"` 13 | Msg int `json:"msg,omitempty"` 14 | } 15 | -------------------------------------------------------------------------------- /go/internal/rolegroup/resp.go: -------------------------------------------------------------------------------- 1 | package rolegroup 2 | 3 | // type RespRoleGroup struct { 4 | // RoleList []*ReqRoleGroup `json:"rolelist" type:"array" need:"是" information:"角色组成员"` 5 | // Code int `json:"code" type:"array" need:"是" information:"错误码"` 6 | // Msg string `json:"msg,omitempty" type:"array" need:"否" information:"错误信息"` 7 | // } 8 | 9 | // func (rrg *RespRoleGroup) Marshal() []byte { 10 | // send, _ := json.Marshal(rrg) 11 | // return send 12 | // } 13 | 14 | // func (rrg *RespRoleGroup) ErrorE(err error) []byte { 15 | // rrg.Code = 1 16 | // rrg.Msg = err.Error() 17 | // return rrg.Marshal() 18 | // } 19 | 20 | // func (rrg *RespRoleGroup) Error(msg string) []byte { 21 | // rrg.Code = 1 22 | // rrg.Msg = msg 23 | // return rrg.Marshal() 24 | // } 25 | -------------------------------------------------------------------------------- /go/internal/search/mybugs.go: -------------------------------------------------------------------------------- 1 | package search 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "strings" 7 | ) 8 | 9 | var ErrorNoStatus = errors.New("没选择状态,返回空数组") 10 | 11 | type ReqMyBugFilter struct { 12 | Page int `json:"page"` 13 | Limit int `json:"limit"` 14 | LevelId int64 `json:"level_id"` 15 | ProjectId int64 `json:"project_id"` 16 | Title string `json:"title"` 17 | ShowsStatus []int64 `json:"showstatus"` 18 | Condition []string 19 | Args []interface{} 20 | } 21 | 22 | func (rmf *ReqMyBugFilter) GetUsefulCondition(uid int64) (string, []interface{}) { 23 | // 获取需要拼接的sql条件语句, 参数 24 | // 确定前面已经有了where 或者on 25 | if rmf.LevelId > 0 { 26 | // 判断这个值是否存在 27 | rmf.Condition = append(rmf.Condition, " lid=? ") 28 | rmf.Args = append(rmf.Args, rmf.LevelId) 29 | 30 | } 31 | if rmf.Title != "" { 32 | rmf.Condition = append(rmf.Condition, " title like ? ") 33 | rmf.Args = append(rmf.Args, "%"+rmf.Title+"%") 34 | } 35 | 36 | if rmf.ProjectId > 0 { 37 | // 判断这个值是否存在 38 | rmf.Condition = append(rmf.Condition, " pid=? ") 39 | rmf.Args = append(rmf.Args, rmf.ProjectId) 40 | } 41 | if len(rmf.ShowsStatus) > 0 { 42 | ss := make([]string, 0) 43 | for _, v := range rmf.ShowsStatus { 44 | ss = append(ss, fmt.Sprintf("%d", v)) 45 | } 46 | rmf.Condition = append(rmf.Condition, fmt.Sprintf(" sid in (%s)", strings.Join(ss, ","))) 47 | } 48 | 49 | return strings.Join(rmf.Condition, " and"), rmf.Args 50 | } 51 | -------------------------------------------------------------------------------- /go/internal/status/getnames.go: -------------------------------------------------------------------------------- 1 | package status 2 | 3 | import ( 4 | "encoding/json" 5 | "itflow/model" 6 | ) 7 | 8 | type RespGetNames struct { 9 | StatusList []string `json:"statuslist"` 10 | Code int `json:"code"` 11 | Msg string `json:"msg"` 12 | } 13 | 14 | func (rgn *RespGetNames) Marshal() []byte { 15 | if rgn == nil { 16 | return nil 17 | } 18 | send, _ := json.Marshal(rgn) 19 | return send 20 | } 21 | 22 | func GetNames() []byte { 23 | resp := &RespGetNames{} 24 | st := &model.Status{} 25 | var err error 26 | resp.StatusList, err = st.Names() 27 | if err != nil { 28 | resp.Msg = err.Error() 29 | resp.Code = 1 30 | return resp.Marshal() 31 | } 32 | return resp.Marshal() 33 | } 34 | -------------------------------------------------------------------------------- /go/internal/status/list.go: -------------------------------------------------------------------------------- 1 | package status 2 | -------------------------------------------------------------------------------- /go/internal/status/show.go: -------------------------------------------------------------------------------- 1 | package status 2 | 3 | type ChangeStatus struct { 4 | Status []string `json:"status"` 5 | Code int `json:"code"` 6 | } 7 | -------------------------------------------------------------------------------- /go/internal/status/statusgroup.go: -------------------------------------------------------------------------------- 1 | package status 2 | 3 | import ( 4 | "itflow/db" 5 | "strings" 6 | 7 | "github.com/hyahm/golog" 8 | ) 9 | 10 | type StatusGroup struct { 11 | Id int64 `json:"id" type:"int" need:"是" default:"0" information:"无效"` 12 | StatusList []string `json:"checklist, omitempty" type:"array" need:"是" default:"[]" information:"状态名列表"` 13 | Name string `json:"name" type:"int" need:"是" default:"0" information:"状态组名"` 14 | } 15 | 16 | func (status *StatusGroup) GetIds() (string, error) { 17 | rows, err := db.Mconn.GetRowsIn("select id from status where name in (?)", 18 | status.StatusList) 19 | 20 | if err != nil { 21 | golog.Error(err) 22 | return "", err 23 | } 24 | ids := make([]string, 0) 25 | for rows.Next() { 26 | var id string 27 | err = rows.Scan(&id) 28 | if err != nil { 29 | golog.Info(err) 30 | continue 31 | } 32 | ids = append(ids, id) 33 | } 34 | rows.Close() 35 | return strings.Join(ids, ","), nil 36 | } 37 | -------------------------------------------------------------------------------- /go/internal/user/changepassword.go: -------------------------------------------------------------------------------- 1 | package user 2 | 3 | type ResetPassword struct { 4 | Id int `json:"id"` 5 | Password string `json:"newpassword"` 6 | } 7 | -------------------------------------------------------------------------------- /go/internal/user/create.go: -------------------------------------------------------------------------------- 1 | package user 2 | 3 | type GetAddUser struct { 4 | Nickname string `json:"nickname"` 5 | Email string `json:"email"` 6 | Password string `json:"password"` 7 | Role []string `json:"role"` 8 | RealName string `json:"realname"` 9 | RoleGroup string `json:"rolegroup"` 10 | StatusGroup string `json:"statusgroup"` 11 | Position string `json:"position"` // 普通用户就是真,管理员就假 12 | } 13 | -------------------------------------------------------------------------------- /go/internal/user/resp.go: -------------------------------------------------------------------------------- 1 | package user 2 | 3 | import ( 4 | "encoding/json" 5 | 6 | "github.com/hyahm/golog" 7 | ) 8 | 9 | type RespLogin struct { 10 | ID int64 `json:"id"` 11 | UserName string `json:"username" type:"string" need:"否" default:"" information:"用户名"` 12 | Token string `json:"token" type:"string" need:"否" default:"" information:"token"` 13 | } 14 | 15 | func (rl *RespLogin) Marshal() []byte { 16 | send, err := json.Marshal(rl) 17 | if err != nil { 18 | golog.Error(err) 19 | 20 | } 21 | return send 22 | } 23 | 24 | func (rl *RespLogin) Error(msg string) []byte { 25 | return rl.Marshal() 26 | } 27 | 28 | func (rl *RespLogin) ErrorE(err error) []byte { 29 | return rl.Error(err.Error()) 30 | } 31 | -------------------------------------------------------------------------------- /go/internal/version/add.go: -------------------------------------------------------------------------------- 1 | package version 2 | 3 | // type RespVersion struct { 4 | // Id int64 `json:"id"` 5 | // Name string `json:"name"` 6 | // Project string `json:"project"` 7 | // RunEnv string `json:"runenv"` 8 | // Url string `json:"url"` 9 | // BakUrl string `json:"bakurl"` 10 | // Date int64 `json:"date"` 11 | // } 12 | 13 | // type VersionList struct { 14 | // VersionList []*RespVersion `json:"versionlist"` 15 | // Code int `json:"code"` 16 | // Msg string `json:"msg"` 17 | // } 18 | 19 | // func (vl *VersionList) Marshal() []byte { 20 | // send, err := json.Marshal(vl) 21 | // if err != nil { 22 | // golog.Error(err) 23 | // } 24 | // return send 25 | // } 26 | // func (vl *VersionList) Error(msg string) []byte { 27 | // vl.Code = 1 28 | // vl.Msg = msg 29 | // return vl.Marshal() 30 | // } 31 | // func (vl *VersionList) ErrorE(err error) []byte { 32 | // return vl.Error(err.Error()) 33 | // } 34 | -------------------------------------------------------------------------------- /go/jwt/jwt_test.go: -------------------------------------------------------------------------------- 1 | package jwt 2 | 3 | import "testing" 4 | 5 | func TestJwt(t *testing.T) { 6 | } 7 | -------------------------------------------------------------------------------- /go/mail/mail.go: -------------------------------------------------------------------------------- 1 | package mail 2 | 3 | import ( 4 | "crypto/tls" 5 | "strings" 6 | 7 | "gopkg.in/gomail.v2" 8 | ) 9 | 10 | func TestMail(host, username string, password string, port int, touser, nickname string) error { 11 | d := gomail.NewDialer(host, port, username, password) 12 | d.TLSConfig = &tls.Config{InsecureSkipVerify: true} 13 | if nickname == "" { 14 | nickname = strings.Split(username, "@")[0] 15 | } 16 | m := gomail.NewMessage() 17 | m.SetHeader("From", username) 18 | m.SetHeader("To", strings.Split(touser, ",")...) 19 | m.SetAddressHeader("Cc", username, nickname) 20 | m.SetHeader("Subject", "验证您的邮箱是否能收到邮件") 21 | m.SetBody("text/html", "恭喜, 您的邮箱可以使用") 22 | // m.Attach("/home/Alex/lolcat.jpg") 23 | return d.DialAndSend(m) 24 | } 25 | -------------------------------------------------------------------------------- /go/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | _ "embed" 5 | "flag" 6 | "itflow/cache" 7 | "itflow/db" 8 | "itflow/httpserver" 9 | "itflow/model" 10 | "log" 11 | "os" 12 | 13 | "github.com/hyahm/goconfig" 14 | "github.com/hyahm/golog" 15 | ) 16 | 17 | //go:embed bug.ini.default 18 | var configBytes []byte 19 | 20 | //go:embed bug.sql 21 | var bugsql string 22 | 23 | func main() { 24 | var make bool 25 | var conf string 26 | flag.BoolVar(&make, "c", false, "生成默认配置文件到当前路径") 27 | flag.StringVar(&conf, "f", "bug.ini", "默认配置文件路径") 28 | 29 | flag.Parse() 30 | if make { 31 | err := os.WriteFile(conf, configBytes, 0644) 32 | if err != nil { 33 | log.Fatal(err) 34 | } 35 | log.Println(("配置文件已生成")) 36 | os.Exit(0) 37 | } 38 | defer golog.Sync() 39 | 40 | // 初始化配置文件 41 | goconfig.InitConf(conf) 42 | if goconfig.ReadBool("debug", false) { 43 | golog.Level = golog.DEBUG 44 | } else { 45 | golog.InitLogger(goconfig.ReadEnv("LOG_PATH", goconfig.ReadString("log.path", "")), 46 | goconfig.ReadInt64("log.size", 0), 47 | goconfig.ReadBool("log.everyday", false)) 48 | } 49 | 50 | golog.Format = "{{ .Ctime }} - [{{ .Level }}] - {{.Msg}}" 51 | // //初始化mysql 52 | db.InitMysql(bugsql) 53 | // // // 初始化缓存表 54 | // db.InitCacheTable() 55 | cache.LoadConfig() 56 | model.InitCache() 57 | // // // 初始化日志 58 | 59 | httpserver.RunHttp() 60 | } 61 | 62 | // 5 3 18 63 | -------------------------------------------------------------------------------- /go/main_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bytes" 5 | "encoding/json" 6 | "fmt" 7 | "testing" 8 | ) 9 | 10 | type Jsonstr string 11 | 12 | func (js Jsonstr) Json() (string, error) { 13 | 14 | b := make([]byte, 2048) 15 | buf := bytes.NewBuffer(b) 16 | err := json.Indent(buf, []byte(js), "", " ") 17 | if err != nil { 18 | return "", err 19 | } 20 | return buf.String(), nil 21 | } 22 | 23 | func TestJson(t *testing.T) { 24 | fmt.Println(8&7 == 0) 25 | // var a Jsonstr = `{"loglist":[{"id":26,"exectime":1588840365,"classify":"login","content":"","ip":"127.0.0.1"},{"id":25,"exectime":1588840233,"classify":"login","content":"","ip":"127.0.0.1"},{"id":24,"exectime":1588837232,"classify":"login","content":"","ip":"127.0.0.1"},{"id":23,"exectime":1588837002,"classify":"login","content":"","ip":"127.0.0.1"},{"id":22,"exectime":1588833133,"classify":"login","content":"","ip":"127.0.0.1"},{"id":21,"exectime":1588833047,"classify":"login","content":"","ip":"127.0.0.1"}],"code":0, "count":100}` 26 | // j, err := a.Json() 27 | // if err != nil { 28 | // t.Fatal(err) 29 | // } 30 | // t.Logf(j) 31 | } 32 | -------------------------------------------------------------------------------- /go/midware/permssion.go: -------------------------------------------------------------------------------- 1 | package midware 2 | 3 | import ( 4 | "itflow/cache" 5 | "itflow/model" 6 | "itflow/response" 7 | "net/http" 8 | 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | const ( 13 | SELECT = 1 14 | REMOVE = 2 15 | UPDATE = 4 16 | CREATE = 8 17 | ) 18 | 19 | // 状态码是2 20 | func CheckSetDefault(w http.ResponseWriter, r *http.Request) bool { 21 | // 检查是否设置全了默认值, 否则无法打开bug任务管理菜单 22 | if model.Default.Completed == 0 || 23 | model.Default.Created == 0 || 24 | model.Default.Pass == 0 || 25 | model.Default.Receive == 0 { 26 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 27 | xmux.GetInstance(r).Response.(*response.Response).Msg = "必须先让管理员设置默认值" 28 | return true 29 | } 30 | return false 31 | } 32 | 33 | func MustBeSuperAdmin(w http.ResponseWriter, r *http.Request) bool { 34 | uid := xmux.GetInstance(r).Get("uid").(int64) 35 | if uid != cache.SUPERID { 36 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 37 | xmux.GetInstance(r).Response.(*response.Response).Msg = "没有权限" 38 | return true 39 | } 40 | return false 41 | } 42 | -------------------------------------------------------------------------------- /go/midware/user.go: -------------------------------------------------------------------------------- 1 | package midware 2 | 3 | // 专门赋予管理层的用户权限 4 | // func UserPerm(w http.ResponseWriter, r *http.Request) bool { 5 | // errorcode := &response.Response{} 6 | // uid := xmux.GetInstance(r).Get("uid").(int64) 7 | // if uid == cache.SUPERID { 8 | // return false 9 | // } 10 | // var manager_count int 11 | 12 | // err := db.Mconn.GetOne("select count(id) from jobs where hypo=(select jid from user where id=?)", uid).Scan(&manager_count) 13 | // if err == nil && manager_count > 0 { 14 | // return false 15 | // } 16 | // golog.Error(err) 17 | // errorcode.Msg = "没有权限" 18 | // w.Write(errorcode.Success()) 19 | // return true 20 | // } 21 | -------------------------------------------------------------------------------- /go/midware/usermanager.go: -------------------------------------------------------------------------------- 1 | package midware 2 | 3 | import ( 4 | "itflow/model" 5 | "itflow/response" 6 | "net/http" 7 | 8 | "github.com/hyahm/golog" 9 | "github.com/hyahm/xmux" 10 | ) 11 | 12 | func JobAuth(w http.ResponseWriter, r *http.Request) bool { 13 | uid := xmux.GetInstance(r).Get("uid").(int64) 14 | // 根据uid 获取 job_id 15 | jid, err := model.GetJobIdByUid(uid) 16 | if err != nil { 17 | golog.Error(err) 18 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 19 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 20 | return true 21 | } 22 | // jobs: 能管理的这些职位 23 | jobs, err := model.GetJobIdsByJobId(jid) 24 | if err != nil { 25 | golog.Error(err) 26 | xmux.GetInstance(r).Response.(*response.Response).Code = 1 27 | xmux.GetInstance(r).Response.(*response.Response).Msg = err.Error() 28 | return true 29 | } 30 | // 31 | xmux.GetInstance(r).Set("jobs", jobs) 32 | return false 33 | } 34 | -------------------------------------------------------------------------------- /go/model/bugstatus.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type Table_buggroup struct { 4 | Id int64 `json:"id"` 5 | Name string `json:"name"` 6 | Sids string `json:"sids"` 7 | } 8 | 9 | type Table_status struct { 10 | Id int64 `json:"id"` 11 | Name string `json:"name"` 12 | } 13 | 14 | type List_StatusName struct { 15 | StatusList []string `json:"statuslist"` 16 | Code int `json:"code"` 17 | } 18 | -------------------------------------------------------------------------------- /go/model/default.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "itflow/db" 5 | ) 6 | 7 | type DefaultValue struct { 8 | Created int64 `json:"created" db:"created,default"` // statusid`json:"created"` 9 | Completed int64 `json:"completed" db:"completed,default"` // statusid 10 | Pass int64 `json:"pass" db:"pass,default"` // statusid 11 | Receive int64 `json:"receive" db:"receive,default"` // statusid 12 | 13 | } 14 | 15 | func (dv *DefaultValue) Update() error { 16 | result := db.Mconn.UpdateInterface(dv, "update defaultvalue set $set") 17 | return result.Err 18 | } 19 | 20 | func GetDefaultValue() (DefaultValue, error) { 21 | dv := DefaultValue{} 22 | result := db.Mconn.Select(&dv, "select * from defaultvalue") 23 | return dv, result.Err 24 | } 25 | -------------------------------------------------------------------------------- /go/model/email.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | type Email struct { 4 | Host string `json:"host" db:"host"` 5 | Enable bool `json:"enable" db:"enable"` 6 | Id int64 `json:"id" db:"id,default""` 7 | Port int `json:"port" db:"port"` 8 | Email string `json:"email" db:"email"` 9 | Password string `json:"password" db:"password"` 10 | NickName string `json:"nickname" db:"nickname"` 11 | } 12 | -------------------------------------------------------------------------------- /go/model/env.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "itflow/db" 5 | 6 | "github.com/hyahm/golog" 7 | ) 8 | 9 | type Env struct { 10 | ID int64 `json:"id" db:"id,default"` 11 | Name string `json:"name" db:"name"` 12 | } 13 | 14 | // 获取的就是表的所有字段 15 | func GetAllEnv() ([]Env, error) { 16 | envs := make([]Env, 0) 17 | result := db.Mconn.Select(&envs, "select * from environment") 18 | return envs, result.Err 19 | } 20 | 21 | func (env *Env) Create() error { 22 | result := db.Mconn.InsertInterfaceWithID(env, "insert into environment($key) values($value)") 23 | if result.Err != nil { 24 | golog.Error(result.Err) 25 | return result.Err 26 | } 27 | env.ID = result.LastInsertId 28 | return nil 29 | } 30 | 31 | func (env *Env) Update() error { 32 | result := db.Mconn.UpdateInterface(env, "update environment set $set where id=?", env.ID) 33 | return result.Err 34 | } 35 | 36 | func DeleteEnv(id interface{}) error { 37 | result := db.Mconn.Delete("delete from environment where id=?", id) 38 | return result.Err 39 | } 40 | -------------------------------------------------------------------------------- /go/model/header.go: -------------------------------------------------------------------------------- 1 | package model 2 | -------------------------------------------------------------------------------- /go/model/important.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "itflow/db" 5 | 6 | "github.com/hyahm/golog" 7 | ) 8 | 9 | type Important struct { 10 | Id int64 `json:"id" db:"id,default"` 11 | Name string `json:"name" db:"name"` 12 | } 13 | 14 | // 获取的就是表的所有字段 15 | func GetAllImportant() ([]Important, error) { 16 | importants := make([]Important, 0) 17 | result := db.Mconn.Select(&importants, "select * from importants") 18 | return importants, result.Err 19 | } 20 | 21 | func (important *Important) Create() error { 22 | result := db.Mconn.InsertInterfaceWithID(important, "insert into importants($key) values($value)") 23 | if result.Err != nil { 24 | golog.Error(result.Err) 25 | return result.Err 26 | } 27 | important.Id = result.LastInsertId 28 | return nil 29 | } 30 | 31 | func (important *Important) Update() error { 32 | result := db.Mconn.UpdateInterface(important, "update importants set $set where id=?", important.Id) 33 | return result.Err 34 | } 35 | 36 | func DeleteImportant(id interface{}) error { 37 | result := db.Mconn.Delete("delete from importants where id=?", id) 38 | return result.Err 39 | } 40 | -------------------------------------------------------------------------------- /go/model/information.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "itflow/db" 5 | "itflow/internal/comment" 6 | 7 | "github.com/hyahm/golog" 8 | ) 9 | 10 | type Information struct { 11 | ID int64 `json:"id" db:"id,default"` 12 | Uid int64 `json:"uid" db:"uid"` 13 | Bid int64 `json:"bid" db:"bid"` 14 | Info string `json:"info" db:"info"` 15 | Time int64 `json:"time" db:"time"` 16 | } 17 | 18 | func NewInformationsByBid(bid interface{}, cms []*comment.Informations) error { 19 | // sl.Comments = make([]*comment.Informations, len(cc)) 20 | getinfosql := "select u.realname,info,time from informations as i join user as u on bid=? and u.id=i.uid" 21 | rows, err := db.Mconn.GetRows(getinfosql, bid) 22 | if err != nil { 23 | golog.Error(err) 24 | return err 25 | } 26 | for rows.Next() { 27 | im := &comment.Informations{} 28 | // var uid int64 29 | rows.Scan(&im.User, &im.Info, &im.Date) 30 | // im.User = cache.CacheUidRealName[uid] 31 | cms = append(cms, im) 32 | } 33 | rows.Close() 34 | return nil 35 | } 36 | 37 | func (info *Information) Insert() error { 38 | result := db.Mconn.InsertInterfaceWithoutID(info, "insert into informations($key) values($value)") 39 | return result.Err 40 | } 41 | -------------------------------------------------------------------------------- /go/model/level.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "itflow/db" 5 | 6 | "github.com/hyahm/golog" 7 | ) 8 | 9 | type Level struct { 10 | Id int64 `json:"id" db:"id,default"` 11 | Name string `json:"name" db:"name"` 12 | } 13 | 14 | func GetLevelKeyNameByUid() ([]KeyName, error) { 15 | rows, err := db.Mconn.GetRows("select id,name from level") 16 | if err != nil { 17 | return nil, err 18 | } 19 | defer rows.Close() 20 | kns := make([]KeyName, 0) 21 | for rows.Next() { 22 | kn := KeyName{} 23 | err = rows.Scan(&kn.ID, &kn.Name) 24 | if err != nil { 25 | golog.Error(err) 26 | continue 27 | } 28 | kns = append(kns, kn) 29 | } 30 | return kns, nil 31 | } 32 | 33 | func (level *Level) Create() error { 34 | result := db.Mconn.InsertInterfaceWithID(level, "insert into level($key) values($value)") 35 | if result.Err != nil { 36 | golog.Error(result.Err) 37 | return result.Err 38 | } 39 | level.Id = result.LastInsertId 40 | return nil 41 | } 42 | 43 | func (level *Level) Update() error { 44 | result := db.Mconn.UpdateInterface(level, "update level set $set where id=?", level.Id) 45 | return result.Err 46 | } 47 | 48 | func DeleteLevel(id interface{}) error { 49 | result := db.Mconn.Delete("delete from level where id=?", id) 50 | return result.Err 51 | } 52 | -------------------------------------------------------------------------------- /go/model/log.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "itflow/db" 5 | ) 6 | 7 | type Log struct { 8 | Id int64 `json:"id" db:"id"` 9 | Exectime int64 `json:"exectime" db:"exectime"` 10 | Classify string `json:"classify" db:"classify"` 11 | Ip string `json:"ip" db:"ip"` 12 | Uid int64 `json:"uid" db:"uid"` 13 | Action string `json:"action" db:"action"` 14 | } 15 | 16 | func (log *Log) Insert() error { 17 | result := db.Mconn.InsertInterfaceWithoutID(log, "insert into log($key) values($value)") 18 | return result.Err 19 | } 20 | -------------------------------------------------------------------------------- /go/model/publish.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "database/sql" 5 | "itflow/db" 6 | ) 7 | 8 | // keyvalue 值 9 | type KeyName struct { 10 | ID int64 `json:"id"` 11 | Name string `json:"name"` 12 | } 13 | 14 | func GetUserKeyName(uid int64) ([]KeyName, error) { 15 | var rows *sql.Rows 16 | var err error 17 | 18 | rows, err = db.Mconn.GetRows("select id,nickname from user") 19 | if err != nil { 20 | return nil, err 21 | } 22 | 23 | defer rows.Close() 24 | kns := make([]KeyName, 0) 25 | for rows.Next() { 26 | kn := KeyName{} 27 | err = rows.Scan(&kn.ID, &kn.Name) 28 | if err != nil { 29 | continue 30 | } 31 | kns = append(kns, kn) 32 | } 33 | return kns, nil 34 | } 35 | -------------------------------------------------------------------------------- /go/model/restful.go: -------------------------------------------------------------------------------- 1 | package model 2 | -------------------------------------------------------------------------------- /go/model/role.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | import ( 4 | "itflow/db" 5 | ) 6 | 7 | type Role struct { 8 | Id int64 `json:"id,omitempty" db:"id,default"` 9 | Role string `json:"role" db:"role,default"` 10 | Info string `json:"info" db:"info,default"` 11 | } 12 | 13 | func AllRole() ([]Role, error) { 14 | roles := make([]Role, 0) 15 | 16 | result := db.Mconn.Select(&roles, "select * from roles") 17 | return roles, result.Err 18 | } 19 | -------------------------------------------------------------------------------- /go/model/roles.go: -------------------------------------------------------------------------------- 1 | package model 2 | 3 | // 页面的权限表, 由开发者管理 4 | type Roles struct { 5 | Id int64 `json:"id"` 6 | Role string `json:"role"` 7 | } 8 | -------------------------------------------------------------------------------- /go/model/sharefile.go: -------------------------------------------------------------------------------- 1 | package model 2 | -------------------------------------------------------------------------------- /go/routegroup/admin.go: -------------------------------------------------------------------------------- 1 | package routegroup 2 | 3 | import ( 4 | "itflow/handle" 5 | "itflow/midware" 6 | 7 | "github.com/hyahm/xmux" 8 | ) 9 | 10 | // Admin 管理员组 11 | var Admin *xmux.RouteGroup 12 | 13 | func init() { 14 | Admin = xmux.NewRouteGroup() 15 | 16 | Admin.Get("/admin/reset", handle.Reset).DelModule(midware.CheckToken) 17 | 18 | // Admin.Post("/info/update", handle.UpdateInfo).BindJson(&user.UserInfo{}) 19 | 20 | } 21 | -------------------------------------------------------------------------------- /go/routegroup/api.go: -------------------------------------------------------------------------------- 1 | package routegroup 2 | -------------------------------------------------------------------------------- /go/routegroup/bug.go: -------------------------------------------------------------------------------- 1 | package routegroup 2 | 3 | import ( 4 | "itflow/handle" 5 | "itflow/internal/bug" 6 | "itflow/internal/search" 7 | 8 | "github.com/hyahm/xmux" 9 | ) 10 | 11 | // Bug bug相关操作的路由组 12 | var Bug *xmux.RouteGroup 13 | 14 | func init() { 15 | Bug = xmux.NewRouteGroup() 16 | 17 | /// ------- 18 | Bug.Post("/bug/pass", handle.PassBug).BindJson(&handle.RequestPass{}) 19 | 20 | Bug.Post("/bug/mybugs", handle.GetMyBugs).BindJson(&search.ReqMyBugFilter{}) 21 | 22 | Bug.Get("/bug/close", handle.CloseBug) 23 | Bug.Post("/bug/changestatus", handle.ChangeBugStatus).BindJson(&bug.ChangeStatus{}) 24 | 25 | Bug.Get("/bug/show", handle.BugShow) 26 | 27 | Bug.Get("/bug/resume", handle.ResumeBug) 28 | 29 | Bug.Post("/get/permstatus", handle.GetPermStatus) 30 | 31 | Bug.Get("/bug/delete", handle.DeleteBug) 32 | Bug.Post("/get/group", handle.GetGroup) 33 | Bug.Post("/get/task/typ", handle.GetTaskTyp) 34 | } 35 | -------------------------------------------------------------------------------- /go/routegroup/dashboard.go: -------------------------------------------------------------------------------- 1 | package routegroup 2 | 3 | import ( 4 | "itflow/handle" 5 | 6 | "github.com/hyahm/xmux" 7 | ) 8 | 9 | // DashBoard 主页上的 10 | var DashBoard *xmux.RouteGroup 11 | 12 | func init() { 13 | DashBoard = xmux.NewRouteGroup() 14 | DashBoard.Post("/dashboard/bugcount", handle.BugCount) 15 | 16 | DashBoard.Post("/dashboard/projectcount", handle.ProjectCount) 17 | DashBoard.Post("/dashboard/usercount", handle.UserCount) 18 | } 19 | -------------------------------------------------------------------------------- /go/routegroup/department.go: -------------------------------------------------------------------------------- 1 | package routegroup 2 | 3 | import ( 4 | "github.com/hyahm/xmux" 5 | ) 6 | 7 | // Department 部门路由组 8 | var Department *xmux.RouteGroup 9 | 10 | func init() { 11 | Department = xmux.NewRouteGroup() 12 | 13 | // Department.Post("/department/add", handle.AddBugGroup). 14 | // BindJson(&status.StatusGroup{}) 15 | 16 | // Department.Post("/department/edit", handle.EditBugGroup). 17 | // BindJson(&status.StatusGroup{}) 18 | // // Department.Post("/department/list", handle.BugGroupList) 19 | // Department.Get("/department/remove", handle.BugGroupDel) 20 | } 21 | -------------------------------------------------------------------------------- /go/routegroup/document.go: -------------------------------------------------------------------------------- 1 | package routegroup 2 | 3 | import ( 4 | "itflow/routegroup/document" 5 | 6 | "github.com/hyahm/xmux" 7 | ) 8 | 9 | var Document *xmux.RouteGroup 10 | 11 | func init() { 12 | Document = xmux.NewRouteGroup() 13 | Document.AddGroup(document.Key) 14 | Document.AddGroup(document.Doc) 15 | 16 | // Department.Post("/department/add", handle.AddBugGroup). 17 | // BindJson(&status.StatusGroup{}) 18 | 19 | // Department.Post("/department/edit", handle.EditBugGroup). 20 | // BindJson(&status.StatusGroup{}) 21 | // // Department.Post("/department/list", handle.BugGroupList) 22 | // Department.Get("/department/remove", handle.BugGroupDel) 23 | } 24 | -------------------------------------------------------------------------------- /go/routegroup/document/doc.go: -------------------------------------------------------------------------------- 1 | package document 2 | 3 | import ( 4 | "itflow/handle" 5 | "itflow/midware" 6 | 7 | "github.com/hyahm/xmux" 8 | ) 9 | 10 | var Doc *xmux.RouteGroup 11 | 12 | func init() { 13 | Doc = xmux.NewRouteGroup() 14 | Doc.Post("/doc/list", handle.DocList) 15 | Doc.Get("/doc/check/name", handle.Name) 16 | // Doc.Post("/doc/create", handle.DocCreate).BindJson(&model.Doc{}) 17 | Doc.Get("/docs/{name}/{all:path}", handle.ProxyDoc).DelModule(midware.CheckToken) 18 | Doc.Get("/doc/update", handle.DocUpdate) 19 | } 20 | -------------------------------------------------------------------------------- /go/routegroup/document/key.go: -------------------------------------------------------------------------------- 1 | package document 2 | 3 | import ( 4 | "itflow/handle" 5 | "itflow/model" 6 | 7 | "github.com/hyahm/xmux" 8 | ) 9 | 10 | var Key *xmux.RouteGroup 11 | 12 | func init() { 13 | Key = xmux.NewRouteGroup() 14 | Key.Post("/keys/list", handle.KeyList) 15 | Key.Post("/keys/add", handle.AddKey).BindJson(&model.Auth{}) 16 | Key.Get("/keys/delete", handle.DeleteKey) 17 | Key.Get("/keys/check/name", handle.CheckKeyName) 18 | Key.Post("/keys/get/me", handle.GetMykeys) 19 | } 20 | -------------------------------------------------------------------------------- /go/routegroup/hook.go: -------------------------------------------------------------------------------- 1 | package routegroup 2 | 3 | import ( 4 | "itflow/handle" 5 | "itflow/midware" 6 | 7 | "github.com/hyahm/xmux" 8 | ) 9 | 10 | var Hook *xmux.RouteGroup 11 | 12 | func init() { 13 | Hook = xmux.NewRouteGroup() 14 | Hook.Post("/gitlab/{name}", handle.Gitlab).DelModule(midware.CheckToken) 15 | Hook.Post("/gitee/{name}", handle.Gitee).DelModule(midware.CheckToken) 16 | Hook.Post("/github/{name}", handle.Github).DelModule(midware.CheckToken) 17 | Hook.Post("/random/hook", handle.RandomHook) 18 | } 19 | -------------------------------------------------------------------------------- /go/routegroup/public.go: -------------------------------------------------------------------------------- 1 | package routegroup 2 | 3 | import ( 4 | "itflow/handle" 5 | "itflow/handle/publiccontroller" 6 | "itflow/model" 7 | 8 | "github.com/hyahm/xmux" 9 | ) 10 | 11 | // RoleGroup 角色组路由 12 | var Public *xmux.RouteGroup 13 | 14 | func init() { 15 | Public = xmux.NewRouteGroup() 16 | // 我的project 17 | Public.Post("/project/keyname", publiccontroller.GetProjectKeyName) 18 | Public.Post("/version/keyname/byproject", publiccontroller.GetVersionKeyNameByProject).BindJson(publiccontroller.RequestProject{}) 19 | // 根据项目获取用户 20 | Public.Post("/user/keyname/byproject", publiccontroller.GetUserKeyNameByProject).BindJson(publiccontroller.RequestProject{}) 21 | // 获取用户 22 | Public.Post("/user/keyname", publiccontroller.GetUserKeyName) 23 | // 获取运行环境 24 | Public.Post("/env/keyname", publiccontroller.GetEnvKeyName) 25 | // 获取有限级别 26 | Public.Post("/level/keyname", publiccontroller.GetLevelKeyName) 27 | // 获取重要性 28 | Public.Post("/important/keyname", publiccontroller.GetImportantKeyName) 29 | // 职位 30 | Public.Post("/position/keyname", publiccontroller.GetPositionKeyName) 31 | // 管理者的信息 32 | Public.Post("/manager/keyname", publiccontroller.GetManagerKeyName) 33 | 34 | // 用户组 35 | Public.Post("/usergroup/keyname", publiccontroller.GetUserGroupKeyName) 36 | // 获取用户信息, 所有页面都会用到 37 | Public.Get("/user/info", handle.UserInfo) 38 | // 获取自己能管理的bug状态 39 | Public.Post("/get/status", handle.GetStatus) 40 | // 获取自己先择显示的状态 41 | Public.Post("/status/show", publiccontroller.ShowStatus) 42 | // 修改显示的状态的bug 43 | Bug.Post("/status/save", handle.ChangeShowStatus).BindJson(&model.User{}) 44 | 45 | } 46 | -------------------------------------------------------------------------------- /go/routegroup/search.go: -------------------------------------------------------------------------------- 1 | package routegroup 2 | 3 | import ( 4 | "itflow/handle" 5 | "itflow/internal/search" 6 | "itflow/midware" 7 | 8 | "github.com/hyahm/xmux" 9 | ) 10 | 11 | // Search 搜索相关 12 | var Search *xmux.RouteGroup 13 | 14 | func init() { 15 | Search = xmux.NewRouteGroup().AddModule(midware.CheckSetDefault) 16 | 17 | Search.Post("/search/allbugs", handle.SearchAllBugs).BindJson(&search.ReqMyBugFilter{}) 18 | Search.Post("/search/mybugs", handle.SearchMyBugs).BindJson(&search.ReqMyBugFilter{}) 19 | 20 | Search.Post("/search/mytasks", handle.SearchMyTasks).BindJson(&search.ReqMyBugFilter{}) 21 | 22 | Search.Post("/search/bugmanager", handle.SearchBugManager).BindJson(&search.ReqMyBugFilter{}) 23 | } 24 | -------------------------------------------------------------------------------- /go/routegroup/setting/status.go: -------------------------------------------------------------------------------- 1 | package setting 2 | -------------------------------------------------------------------------------- /go/routegroup/setting/statusgroup.go: -------------------------------------------------------------------------------- 1 | package setting 2 | -------------------------------------------------------------------------------- /go/routegroup/setting/version.go: -------------------------------------------------------------------------------- 1 | package setting 2 | -------------------------------------------------------------------------------- /go/routegroup/settingcenter.go: -------------------------------------------------------------------------------- 1 | package routegroup 2 | 3 | import ( 4 | "itflow/app/env" 5 | "itflow/app/important" 6 | "itflow/app/level" 7 | "itflow/app/position" 8 | "itflow/app/project" 9 | "itflow/app/status" 10 | "itflow/app/statusgroup" 11 | "itflow/app/version" 12 | "itflow/midware" 13 | 14 | "github.com/hyahm/xmux" 15 | ) 16 | 17 | var SettingCenter *xmux.RouteGroup 18 | 19 | func init() { 20 | SettingCenter = xmux.NewRouteGroup().AddPageKeys("admin").AddModule(midware.CheckRole) 21 | 22 | SettingCenter.AddGroup(position.Position) 23 | SettingCenter.AddGroup(env.Env) 24 | SettingCenter.AddGroup(important.Important) 25 | SettingCenter.AddGroup(level.Level) 26 | SettingCenter.AddGroup(project.Project) 27 | SettingCenter.AddGroup(status.Status) 28 | SettingCenter.AddGroup(statusgroup.StatusGroup) 29 | SettingCenter.AddGroup(version.Version) 30 | } 31 | -------------------------------------------------------------------------------- /go/routegroup/share.go: -------------------------------------------------------------------------------- 1 | package routegroup 2 | 3 | import ( 4 | "github.com/hyahm/xmux" 5 | ) 6 | 7 | // Share 废弃 8 | var Share *xmux.RouteGroup 9 | 10 | func init() { 11 | Share = xmux.NewRouteGroup() 12 | // Share.Get("/share/list", handle.ShareList) 13 | // Share.Post("/share/upload", handle.ShareUpload) 14 | // Share.Post("/share/mkdir", handle.ShareMkdir).BindJson(&model.Data_sharefile{}) 15 | // Share.Get("/share/remove", handle.ShareRemove) 16 | // Share.Post("/share/rename", handle.ShareRename).BindJson(&model.Data_sharefile{}) 17 | // //router.HandleFunc("/share/down", handle.ShareDownload) 18 | // Share.Get("/share/down", handle.ShareShow) 19 | } 20 | -------------------------------------------------------------------------------- /go/routegroup/system.go: -------------------------------------------------------------------------------- 1 | package routegroup 2 | 3 | import ( 4 | "itflow/midware" 5 | "itflow/routegroup/system" 6 | 7 | "github.com/hyahm/xmux" 8 | ) 9 | 10 | var SystemSetting *xmux.RouteGroup 11 | 12 | func init() { 13 | SystemSetting = xmux.NewRouteGroup().AddPageKeys("admin").AddModule(midware.MustBeSuperAdmin) 14 | // 默认状态页面 15 | SystemSetting.AddGroup(system.DefaultValue) 16 | // 邮箱设置页面 17 | SystemSetting.AddGroup(system.Email) 18 | // 日志页面 19 | SystemSetting.AddGroup(system.Log).AddPageKeys("log").DelModule(midware.MustBeSuperAdmin).AddModule(midware.CheckRole) 20 | // 角色页面 21 | SystemSetting.AddGroup(system.RoleGroup) 22 | } 23 | -------------------------------------------------------------------------------- /go/routegroup/system/defaultvalue.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "itflow/handle" 5 | "itflow/midware" 6 | "itflow/model" 7 | 8 | "github.com/hyahm/xmux" 9 | ) 10 | 11 | // DefaultValue 默认值 12 | var DefaultValue *xmux.RouteGroup 13 | 14 | func init() { 15 | DefaultValue = xmux.NewRouteGroup().DelModule(midware.MustBeSuperAdmin) 16 | 17 | DefaultValue.Post("/default/status", handle.DefaultStatus) 18 | DefaultValue.Post("/default/save", handle.DefaultSave).BindJson(&model.DefaultValue{}) 19 | 20 | } 21 | -------------------------------------------------------------------------------- /go/routegroup/system/email.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "itflow/handle" 5 | "itflow/internal/email" 6 | 7 | "github.com/hyahm/xmux" 8 | ) 9 | 10 | // Email 邮件相关路由组 11 | var Email *xmux.RouteGroup 12 | 13 | func init() { 14 | Email = xmux.NewRouteGroup() 15 | 16 | Email.Post("/email/test", handle.TestEmail).BindJson(&email.Email{}) 17 | Email.Post("/email/save", handle.SaveEmail).BindJson(&email.Email{}) 18 | Email.Post("/email/get", handle.GetEmail) 19 | 20 | } 21 | -------------------------------------------------------------------------------- /go/routegroup/system/log.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "itflow/handle" 5 | "itflow/internal/log" 6 | 7 | "github.com/hyahm/xmux" 8 | ) 9 | 10 | // Log 日志路由 11 | var Log *xmux.RouteGroup 12 | 13 | func init() { 14 | Log = xmux.NewRouteGroup() 15 | 16 | Log.Post("/search/log", handle.SearchLog).BindJson(&log.SearchLog{}) 17 | 18 | Log.Post("/log/classify", handle.LogClassify) 19 | 20 | // Log.Post("/log/list", handle.LogList).BindJson(&log.SearchLog{}) 21 | } 22 | -------------------------------------------------------------------------------- /go/routegroup/system/rolegroup.go: -------------------------------------------------------------------------------- 1 | package system 2 | 3 | import ( 4 | "itflow/handle" 5 | 6 | "github.com/hyahm/xmux" 7 | ) 8 | 9 | // RoleGroup 角色组路由 10 | var RoleGroup *xmux.RouteGroup 11 | 12 | func init() { 13 | RoleGroup = xmux.NewRouteGroup() 14 | 15 | RoleGroup.Post("/rolegroup/add", handle.AddRoleGroup).BindJson(&handle.RequestRoleGroup{}) 16 | RoleGroup.Post("/rolegroup/edit", handle.EditRoleGroup).BindJson(&handle.RequestRoleGroup{}) 17 | 18 | RoleGroup.Post("/rolegroup/list", handle.RoleGroupList) 19 | 20 | RoleGroup.Post("/rolegroup/get", handle.GetRoleGroupName) 21 | 22 | RoleGroup.Get("/rolegroup/remove", handle.RoleGroupDel) 23 | 24 | RoleGroup.Get("/roles/get", handle.GetRoles) 25 | // 获取编辑组的权限 26 | RoleGroup.Get("/rolegroup/perm/get", handle.GetRoleGroupPerm) 27 | 28 | // RoleGroup.Post("/rolegroup/template", handle.RoleTemplate) 29 | 30 | // RoleGroup.Pattern("/rolegroup/name").Get(handle.GetRoleGroup) 31 | } 32 | -------------------------------------------------------------------------------- /go/routegroup/taskmanager.go: -------------------------------------------------------------------------------- 1 | package routegroup 2 | 3 | import ( 4 | "itflow/handle/taskcontroller" 5 | "itflow/model" 6 | 7 | "github.com/hyahm/xmux" 8 | ) 9 | 10 | var TaskManager *xmux.RouteGroup 11 | 12 | func init() { 13 | TaskManager = xmux.NewRouteGroup() 14 | // 创建bug页面 15 | TaskManager.Post("/bug/create", taskcontroller.Create).BindJson(&model.Bug{}) 16 | TaskManager.Get("/bug/edit", taskcontroller.Get) 17 | TaskManager.Post("/bug/update", taskcontroller.Update).BindJson(&model.Bug{}) 18 | TaskManager.Post("/bug/receive", taskcontroller.Receive).BindJson(&model.Bug{}) 19 | 20 | TaskManager.Post("/bug/complete", taskcontroller.Complete).BindJson(&model.Bug{}) 21 | // 1630339320 22 | } 23 | -------------------------------------------------------------------------------- /go/routegroup/taskmanager/create.go: -------------------------------------------------------------------------------- 1 | package taskmanager 2 | 3 | import ( 4 | "github.com/hyahm/xmux" 5 | ) 6 | 7 | var CreateBugPage *xmux.RouteGroup 8 | 9 | func init() { 10 | CreateBugPage = xmux.NewRouteGroup() 11 | // 添加用户操作 12 | 13 | } 14 | -------------------------------------------------------------------------------- /go/routegroup/user.go: -------------------------------------------------------------------------------- 1 | package routegroup 2 | 3 | import ( 4 | "itflow/handle" 5 | "itflow/internal/user" 6 | "itflow/midware" 7 | 8 | "github.com/hyahm/xmux" 9 | ) 10 | 11 | // User 用户操作 12 | var User *xmux.RouteGroup 13 | 14 | func init() { 15 | User = xmux.NewRouteGroup() 16 | User.Post("/user/login", handle.Login).BindJson(&user.Login{}). 17 | DelModule(midware.CheckToken) 18 | User.Post("/user/logout", handle.LoginOut) 19 | User.Post("/get/user", handle.GetUser) 20 | 21 | User.Post("/is/admin", handle.IsAdmin) 22 | } 23 | -------------------------------------------------------------------------------- /go/routegroup/usermanager.go: -------------------------------------------------------------------------------- 1 | package routegroup 2 | 3 | import ( 4 | "itflow/handle" 5 | "itflow/handle/usercontroller" 6 | "itflow/internal/user" 7 | "itflow/midware" 8 | "itflow/model" 9 | "itflow/routegroup/usermanager" 10 | 11 | "github.com/hyahm/xmux" 12 | ) 13 | 14 | // UserManager 用户管理 15 | var UserManager *xmux.RouteGroup 16 | 17 | func init() { 18 | UserManager = xmux.NewRouteGroup() 19 | 20 | // 用户组页面 21 | UserManager.AddGroup(usermanager.UserGroupPage) 22 | 23 | // 修改密码页面 24 | UserManager.Post("/password/reset", handle.ResetPwd).BindJson(&user.ResetPassword{}) 25 | // 修改邮箱页面 26 | UserManager.AddGroup(usermanager.UpdateEmailPage) 27 | // 上传头像页面 28 | UserManager.Post("/upload/headimg", handle.UploadHeadImg) 29 | // 修改密码页面 30 | UserManager.Post("/password/update", usercontroller.ChangePassword).BindJson(&usercontroller.ChangePasswod{}) 31 | // 用户列表管理页面 32 | UserManager.AddGroup(usermanager.UserListPage) 33 | // 用户创建 34 | // 添加用户操作 35 | UserManager.Post("/user/create", handle.Create). 36 | BindJson(&model.User{}).AddPageKeys("admin", "user").AddModule(midware.CheckRole) 37 | 38 | } 39 | -------------------------------------------------------------------------------- /go/routegroup/usermanager/adduser.go: -------------------------------------------------------------------------------- 1 | package usermanager 2 | 3 | import ( 4 | "github.com/hyahm/xmux" 5 | ) 6 | 7 | var AddUserPage *xmux.RouteGroup 8 | 9 | func init() { 10 | AddUserPage = xmux.NewRouteGroup() 11 | 12 | } 13 | -------------------------------------------------------------------------------- /go/routegroup/usermanager/email.go: -------------------------------------------------------------------------------- 1 | package usermanager 2 | 3 | import ( 4 | "itflow/handle/usercontroller/email" 5 | 6 | "github.com/hyahm/xmux" 7 | ) 8 | 9 | var UpdateEmailPage *xmux.RouteGroup 10 | 11 | func init() { 12 | UpdateEmailPage = xmux.NewRouteGroup() 13 | // 获取自己的邮箱 14 | UpdateEmailPage.Post("/my/email", email.Get) 15 | // 修改邮箱 16 | UpdateEmailPage.Post("/email/update", email.Set) 17 | } 18 | -------------------------------------------------------------------------------- /go/routegroup/usermanager/usergroup.go: -------------------------------------------------------------------------------- 1 | package usermanager 2 | 3 | import ( 4 | "itflow/handle/usercontroller/usergroup" 5 | "itflow/model" 6 | 7 | "github.com/hyahm/xmux" 8 | ) 9 | 10 | var UserGroupPage *xmux.RouteGroup 11 | 12 | func init() { 13 | UserGroupPage = xmux.NewRouteGroup() 14 | // 获取所有用户的信息关系 15 | UserGroupPage.Post("/alluser/keyname", usergroup.GetAllUserKeyName) 16 | // 获取所有用户组 17 | UserGroupPage.Post("/usergroup/list", usergroup.List) 18 | // 修改所有用户组 19 | UserGroupPage.Post("/usergroup/update", usergroup.Update).BindJson(&model.UserGroup{}) 20 | // // 增加所有用户组 21 | UserGroupPage.Post("/usergroup/create", usergroup.Create).BindJson(&model.UserGroup{}) 22 | // // 删除所有用户组 23 | UserGroupPage.Get("/usergroup/delete", usergroup.Delete) 24 | 25 | } 26 | -------------------------------------------------------------------------------- /go/routegroup/usermanager/userlist.go: -------------------------------------------------------------------------------- 1 | package usermanager 2 | 3 | import ( 4 | "itflow/handle" 5 | "itflow/midware" 6 | "itflow/model" 7 | 8 | "github.com/hyahm/xmux" 9 | ) 10 | 11 | var UserListPage *xmux.RouteGroup 12 | 13 | func init() { 14 | UserListPage = xmux.NewRouteGroup().AddModule(midware.JobAuth).AddPageKeys("admin", "user").AddModule(midware.CheckRole) 15 | // 获取所有用户 16 | UserListPage.Post("/user/list", handle.Read) 17 | // 删除用户 18 | UserListPage.Get("/user/remove", handle.Delete) 19 | // 禁用用户 20 | UserListPage.Get("/user/disable", handle.DisableUser) 21 | // 用户信息修改 22 | UserListPage.Post("/user/update", handle.Update).BindJson(model.User{}) 23 | } 24 | -------------------------------------------------------------------------------- /go/sc.yaml: -------------------------------------------------------------------------------- 1 | - name: itflow_api 2 | env: 3 | MYSQL_USER: root 4 | MYSQL_PASSWORD: 123456 5 | MYSQL_HOST: 127.0.0.1 6 | MYSQL_PORT: 3306 7 | MYSQL_DB: itflow 8 | LOG_PATH: log/itflow.log 9 | preStart: 10 | - path: bug.ini 11 | template: bug.ini.tpl 12 | - path: main 13 | install: go build main.go 14 | command: ./main 15 | update: go build main.go -------------------------------------------------------------------------------- /go/sc_build.yaml: -------------------------------------------------------------------------------- 1 | # scs 通过docker打包 scsctl install -f sc_build_centos.yaml 2 | # 打包并运行, 自动生成默认配置文件, 第一次配置文件有问题,肯定失败,修改配置文件后 scsctl start 即可启动 3 | - name: itflow_go 4 | env: 5 | # linux | windows | darwin, 设置打包后对应的系统 6 | GOOS: darwin 7 | # 国内设置代理 8 | GOPROXY: https://goproxy.cn 9 | # 部分配置文件 10 | LOG_PATH: log/itflow.log 11 | MYSQL_USER: root 12 | MYSQL_PASSWORD: 123456 13 | MYSQL_HOST: 127.0.0.1 14 | MYSQL_PORT: 3306 15 | MYSQL_DB: test 16 | SCS_TPL_OUT: '{{ if eq .OS "windows" }}main.exe{{ else }}main{{ end}}' 17 | preStart: 18 | - path: bug.ini 19 | template: bug.ini.tpl 20 | - command: docker 21 | install: yum -y install docker && systemctl start docker 22 | - path: "{{ .SCS_TPL_OUT }}" 23 | install: docker container run -i -e GOOS="{{ .GOOS }}" -e GOPROXY="{{ .GOPROXY }}" -v {{ .PROJECT_HOME }}:/opt/build --rm golang:1.17.6 /bin/bash -c "cd /opt/build; go build -o {{ .SCS_TPL_OUT }} main.go" 24 | command: ./{{ .SCS_TPL_OUT }} 25 | -------------------------------------------------------------------------------- /go/startmysql.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | # docker 安装mysql 4 | # linux 建议用host网络 5 | docker run --restart=always --name mysql -v /data/mysql:/var/lib/mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql:5.7.30 -------------------------------------------------------------------------------- /go/systemd/itflow.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=ITflow bug 管理系统 3 | After=network.target 4 | After=network-online.target 5 | Wants=network-online.target 6 | 7 | [Service] 8 | WorkingDirectory=/bin/file/path 9 | ExecStart=/bin/file/path /etc/bug.ini 10 | ExecStop=/bin/kill -s QUIT $MAINPID 11 | Type=simple 12 | 13 | [Install] 14 | WantedBy=multi-user.target -------------------------------------------------------------------------------- /go/utils/port.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "fmt" 5 | "net" 6 | ) 7 | 8 | func CheckPort(port int) error { 9 | l, err := net.Listen("tcp", fmt.Sprintf(":%d", port)) 10 | if err != nil { 11 | return err 12 | } 13 | defer l.Close() 14 | return nil 15 | } 16 | -------------------------------------------------------------------------------- /mysql/conf/.gitignore: -------------------------------------------------------------------------------- 1 | # ignore all except .gitignore file 2 | * 3 | !.gitignore -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "requires": true, 3 | "lockfileVersion": 1, 4 | "dependencies": { 5 | "axios": { 6 | "version": "0.21.1", 7 | "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", 8 | "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", 9 | "requires": { 10 | "follow-redirects": "^1.10.0" 11 | } 12 | }, 13 | "follow-redirects": { 14 | "version": "1.13.2", 15 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.2.tgz", 16 | "integrity": "sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA==" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /vue/.editorconfig: -------------------------------------------------------------------------------- 1 | # https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | end_of_line = lf 9 | insert_final_newline = true 10 | trim_trailing_whitespace = true 11 | 12 | [*.md] 13 | insert_final_newline = false 14 | trim_trailing_whitespace = false 15 | -------------------------------------------------------------------------------- /vue/.env.development: -------------------------------------------------------------------------------- 1 | # just a flag 2 | ENV = 'development' 3 | 4 | # base api 5 | VUE_APP_BASE_API = 'http://127.0.0.1:10001' 6 | VUE_APP_USERNAME = 'admin' 7 | VUE_APP_PASSWORD = 'admin' 8 | 9 | 10 | -------------------------------------------------------------------------------- /vue/.env.staging: -------------------------------------------------------------------------------- 1 | NODE_ENV = production 2 | 3 | # just a flag 4 | ENV = 'staging' 5 | 6 | # base api 7 | VUE_APP_BASE_API = '/stage-api' 8 | 9 | -------------------------------------------------------------------------------- /vue/.eslintignore: -------------------------------------------------------------------------------- 1 | build/*.js 2 | src/assets 3 | public 4 | dist 5 | -------------------------------------------------------------------------------- /vue/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | patreon: panjiachen 4 | custom: https://panjiachen.github.io/vue-element-admin-site/donate 5 | -------------------------------------------------------------------------------- /vue/.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report(报告问题) 3 | about: Create a report to help us improve 4 | --- 5 | 10 | 11 | 12 | ## Bug report(问题描述) 13 | 14 | #### Steps to reproduce(问题复现步骤) 15 | 20 | 21 | #### Screenshot or Gif(截图或动态图) 22 | 23 | 24 | #### Link to minimal reproduction(最小可在线还原demo) 25 | 26 | 29 | 30 | #### Other relevant information(格外信息) 31 | - Your OS: 32 | - Node.js version: 33 | - vue-element-admin version: 34 | -------------------------------------------------------------------------------- /vue/.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request(新功能建议) 3 | about: Suggest an idea for this project 4 | --- 5 | 6 | ## Feature request(新功能建议) 7 | 8 | -------------------------------------------------------------------------------- /vue/.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question(提问) 3 | about: Asking questions about use 4 | --- 5 | 6 | ## Question(提问) 7 | 8 | 15 | 16 | #### Steps to reproduce(问题复现步骤) 17 | 22 | 23 | #### Screenshot or Gif(截图或动态图) 24 | 25 | 26 | #### Link to minimal reproduction(最小可在线还原demo) 27 | 28 | 31 | 32 | #### Other relevant information(格外信息) 33 | - Your OS: 34 | - Node.js version: 35 | - vue-element-admin version: 36 | -------------------------------------------------------------------------------- /vue/.gitignore: -------------------------------------------------------------------------------- 1 | .env.production -------------------------------------------------------------------------------- /vue/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 10 3 | script: npm run test 4 | notifications: 5 | email: false 6 | -------------------------------------------------------------------------------- /vue/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:22-alpine 2 | WORKDIR /data 3 | COPY . /data 4 | -------------------------------------------------------------------------------- /vue/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017-present PanJiaChen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vue/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app 4 | '@vue/cli-plugin-babel/preset' 5 | ], 6 | 'env': { 7 | 'development': { 8 | // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require(). 9 | // This plugin can significantly increase the speed of hot updates, when you have a large number of pages. 10 | // https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html 11 | 'plugins': ['dynamic-import-node'] 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /vue/build/index.js: -------------------------------------------------------------------------------- 1 | const { run } = require('runjs') 2 | const chalk = require('chalk') 3 | const config = require('../vue.config.js') 4 | const rawArgv = process.argv.slice(2) 5 | const args = rawArgv.join(' ') 6 | 7 | if (process.env.npm_config_preview || rawArgv.includes('--preview')) { 8 | const report = rawArgv.includes('--report') 9 | 10 | run(`vue-cli-service build ${args}`) 11 | 12 | const port = 9526 13 | const publicPath = config.publicPath 14 | 15 | var connect = require('connect') 16 | var serveStatic = require('serve-static') 17 | const app = connect() 18 | 19 | app.use( 20 | publicPath, 21 | serveStatic('./dist', { 22 | index: ['index.html', '/'] 23 | }) 24 | ) 25 | 26 | app.listen(port, function () { 27 | console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) 28 | if (report) { 29 | console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) 30 | } 31 | 32 | }) 33 | } else { 34 | run(`vue-cli-service build ${args}`) 35 | } 36 | -------------------------------------------------------------------------------- /vue/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | moduleFileExtensions: ['js', 'jsx', 'json', 'vue'], 3 | transform: { 4 | '^.+\\.vue$': 'vue-jest', 5 | '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 6 | 'jest-transform-stub', 7 | '^.+\\.jsx?$': 'babel-jest' 8 | }, 9 | moduleNameMapper: { 10 | '^@/(.*)$': '/src/$1' 11 | }, 12 | snapshotSerializers: ['jest-serializer-vue'], 13 | testMatch: [ 14 | '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' 15 | ], 16 | collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'], 17 | coverageDirectory: '/tests/unit/coverage', 18 | // 'collectCoverage': true, 19 | 'coverageReporters': [ 20 | 'lcov', 21 | 'text-summary' 22 | ], 23 | testURL: 'http://localhost/' 24 | } 25 | -------------------------------------------------------------------------------- /vue/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": "./", 4 | "paths": { 5 | "@/*": ["src/*"] 6 | } 7 | }, 8 | "exclude": ["node_modules", "dist"] 9 | } -------------------------------------------------------------------------------- /vue/plopfile.js: -------------------------------------------------------------------------------- 1 | const viewGenerator = require('./plop-templates/view/prompt') 2 | const componentGenerator = require('./plop-templates/component/prompt') 3 | const storeGenerator = require('./plop-templates/store/prompt.js') 4 | 5 | module.exports = function(plop) { 6 | plop.setGenerator('view', viewGenerator) 7 | plop.setGenerator('component', componentGenerator) 8 | plop.setGenerator('store', storeGenerator) 9 | } 10 | -------------------------------------------------------------------------------- /vue/postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /vue/production.tpl: -------------------------------------------------------------------------------- 1 | # just a flag 2 | ENV = 'production' 3 | 4 | # base api 5 | VUE_APP_BASE_API = '{{ .API_DOMAIN }}' 6 | VUE_APP_USERNAME = '' 7 | VUE_APP_PASSWORD = '' 8 | -------------------------------------------------------------------------------- /vue/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyahm/ITflow/692a9c34d4c33e37cd7fbe6d8f19615bd8b3bc40/vue/public/favicon.ico -------------------------------------------------------------------------------- /vue/public/favicon.icoaaa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyahm/ITflow/692a9c34d4c33e37cd7fbe6d8f19615bd8b3bc40/vue/public/favicon.icoaaa -------------------------------------------------------------------------------- /vue/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | <%= webpackConfig.name %> 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /vue/sc_build.yaml: -------------------------------------------------------------------------------- 1 | # scs: https://github.com/hyahm/scs 2 | # scs 通过docker打包 scsctl install -f sc_build_centos.yaml 3 | - name: build_vue 4 | env: 5 | API_DOMAIN: http://127.0.0.1:10001 6 | preStart: 7 | - path: .env.production 8 | template: production.tpl 9 | - command: docker 10 | install: yum -y install docker && systemctl start docker 11 | command: docker container run -i -v {{ .PROJECT_HOME }}:/opt/vue --rm node:14.17.5 /bin/bash -c "cd /opt/vue; npm i && npm run build" 12 | -------------------------------------------------------------------------------- /vue/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /vue/src/api/article.js: -------------------------------------------------------------------------------- 1 | import request from "@/utils/request"; 2 | 3 | export function fetchList(query) { 4 | return request({ 5 | url: "/article/list", 6 | method: "get", 7 | params: query 8 | }); 9 | } 10 | 11 | export function fetchArticle(id) { 12 | return request({ 13 | url: "/article/detail", 14 | method: "get", 15 | params: { id } 16 | }); 17 | } 18 | 19 | export function testtest(data) { 20 | return request({ 21 | url: "/test/test", 22 | method: "post", 23 | data 24 | }); 25 | } 26 | 27 | export function fetchPv(pv) { 28 | return request({ 29 | url: "/article/pv", 30 | method: "get", 31 | params: { pv } 32 | }); 33 | } 34 | 35 | export function createArticle(data) { 36 | return request({ 37 | url: "/article/create", 38 | method: "post", 39 | data 40 | }); 41 | } 42 | 43 | export function updateArticle(data) { 44 | return request({ 45 | url: "/article/update", 46 | method: "post", 47 | data 48 | }); 49 | } 50 | -------------------------------------------------------------------------------- /vue/src/api/dashboard.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function getlist() { 4 | return request({ 5 | url: '/dashboard/usercount', 6 | method: 'post' 7 | }) 8 | } 9 | 10 | export function fetchArticle(id) { 11 | return request({ 12 | url: '/article/detail', 13 | method: 'get', 14 | params: { id } 15 | }) 16 | } 17 | 18 | export function fetchPv(pv) { 19 | return request({ 20 | url: '/article/pv', 21 | method: 'get', 22 | params: { pv } 23 | }) 24 | } 25 | 26 | export function getprojectlist() { 27 | return request({ 28 | url: '/dashboard/projectcount', 29 | method: 'post' 30 | }) 31 | } 32 | 33 | export function getBugCount() { 34 | return request({ 35 | url: '/dashboard/bugcount', 36 | method: 'post' 37 | }) 38 | } 39 | -------------------------------------------------------------------------------- /vue/src/api/defaultvalue.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function defaultValue() { 4 | return request({ 5 | url: '/default/status', 6 | method: 'post' 7 | }) 8 | } 9 | 10 | export function important() { 11 | return request({ 12 | url: '/default/important', 13 | method: 'post' 14 | }) 15 | } 16 | 17 | export function level() { 18 | return request({ 19 | url: '/default/level', 20 | method: 'post' 21 | }) 22 | } 23 | 24 | export function save(data) { 25 | return request({ 26 | url: '/default/save', 27 | method: 'post', 28 | data: data 29 | }) 30 | } 31 | -------------------------------------------------------------------------------- /vue/src/api/department.js: -------------------------------------------------------------------------------- 1 | import request from "@/utils/request"; 2 | 3 | // export function departmentList() { 4 | // return request({ 5 | // url: '/department/list', 6 | // method: 'post' 7 | // }) 8 | // } 9 | 10 | export function addDepartment(data) { 11 | return request({ 12 | url: "/department/add", 13 | method: "post", 14 | data: data 15 | }); 16 | } 17 | 18 | export function editDepartment(data) { 19 | return request({ 20 | url: "/department/edit", 21 | method: "post", 22 | data: data 23 | }); 24 | } 25 | 26 | export function removeDepartment(id) { 27 | return request({ 28 | url: "/department/remove", 29 | method: "get", 30 | params: { id } 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /vue/src/api/email.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function testEmail(data) { 4 | return request({ 5 | url: '/email/test', 6 | method: 'post', 7 | data 8 | }) 9 | } 10 | 11 | export function saveEmail(data) { 12 | return request({ 13 | url: '/email/save', 14 | method: 'post', 15 | data 16 | }) 17 | } 18 | 19 | export function getEmailStatus() { 20 | return request({ 21 | url: '/email/get', 22 | method: 'post' 23 | }) 24 | } 25 | 26 | -------------------------------------------------------------------------------- /vue/src/api/env.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function getEnvName() { 4 | return request({ 5 | url: '/env/list', 6 | method: 'post' 7 | }) 8 | } 9 | 10 | export function addEnvName(data) { 11 | return request({ 12 | url: '/env/add', 13 | method: 'post', 14 | data 15 | }) 16 | } 17 | 18 | export function updateEnvName(data) { 19 | return request({ 20 | url: '/env/update', 21 | method: 'post', 22 | data 23 | }) 24 | } 25 | 26 | export function deleteEnvName(id) { 27 | return request({ 28 | url: '/env/delete', 29 | method: 'get', 30 | params: { id } 31 | }) 32 | } 33 | 34 | -------------------------------------------------------------------------------- /vue/src/api/header.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function headerList() { 4 | return request({ 5 | url: '/header/list', 6 | method: 'post' 7 | }) 8 | } 9 | 10 | export function headerDel(id) { 11 | return request({ 12 | url: '/header/del', 13 | method: 'get', 14 | params: { id } 15 | }) 16 | } 17 | 18 | export function headerUpdate(data) { 19 | return request({ 20 | url: '/header/update', 21 | method: 'post', 22 | data: data 23 | }) 24 | } 25 | 26 | export function headerAdd(data) { 27 | return request({ 28 | url: '/header/add', 29 | method: 'post', 30 | data: data 31 | }) 32 | } 33 | 34 | export function headerGet() { 35 | return request({ 36 | url: '/header/get', 37 | method: 'post' 38 | }) 39 | } 40 | 41 | -------------------------------------------------------------------------------- /vue/src/api/important.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function getImportant() { 4 | return request({ 5 | url: '/important/get', 6 | method: 'post' 7 | }) 8 | } 9 | 10 | export function addImportant(data) { 11 | return request({ 12 | url: '/important/add', 13 | method: 'post', 14 | data: data 15 | }) 16 | } 17 | 18 | export function delImportant(id) { 19 | return request({ 20 | url: '/important/del', 21 | method: 'get', 22 | params: { id } 23 | }) 24 | } 25 | 26 | export function updateImportant(data) { 27 | return request({ 28 | url: '/important/update', 29 | method: 'post', 30 | data: data 31 | }) 32 | } 33 | -------------------------------------------------------------------------------- /vue/src/api/key.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function fetchList() { 4 | return request({ 5 | url: '/keys/list', 6 | method: 'post' 7 | }) 8 | } 9 | 10 | 11 | export function addKey(data) { 12 | return request({ 13 | url: '/keys/add', 14 | method: 'post', 15 | data 16 | }) 17 | } 18 | 19 | export function delKey(id) { 20 | return request({ 21 | url: "/keys/delete", 22 | method: 'get', 23 | params: { id } 24 | }) 25 | } 26 | 27 | 28 | export function checkName(name) { 29 | return request({ 30 | url: '/keys/check/name', 31 | method: 'get', 32 | params: { name } 33 | }) 34 | } 35 | 36 | 37 | export function getMykeys() { 38 | return request({ 39 | url: '/keys/get/me', 40 | method: 'post' 41 | }) 42 | } -------------------------------------------------------------------------------- /vue/src/api/level.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function getLevels() { 4 | return request({ 5 | url: '/level/get', 6 | method: 'post' 7 | }) 8 | } 9 | 10 | export function addLevel(data) { 11 | return request({ 12 | url: '/level/add', 13 | method: 'post', 14 | data: data 15 | }) 16 | } 17 | 18 | export function delLevel(id) { 19 | return request({ 20 | url: '/level/del', 21 | method: 'get', 22 | params: { id } 23 | }) 24 | } 25 | 26 | export function updateLevel(data) { 27 | return request({ 28 | url: '/level/update', 29 | method: 'post', 30 | data: data 31 | }) 32 | } 33 | -------------------------------------------------------------------------------- /vue/src/api/log.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function getLog(data) { 4 | return request({ 5 | url: '/log/list', 6 | method: 'post', 7 | data: data 8 | }) 9 | } 10 | 11 | export function searchLog(data) { 12 | return request({ 13 | url: '/search/log', 14 | method: 'post', 15 | data: data 16 | }) 17 | } 18 | 19 | export function logClassify() { 20 | return request({ 21 | url: '/log/classify', 22 | method: 'post' 23 | }) 24 | } 25 | -------------------------------------------------------------------------------- /vue/src/api/login.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function loginByUsername(data) { 4 | return request({ 5 | url: '/login/login', 6 | method: 'post', 7 | data: data 8 | }) 9 | } 10 | 11 | export function logout() { 12 | return request({ 13 | url: '/login/logout', 14 | method: 'post' 15 | }) 16 | } 17 | 18 | -------------------------------------------------------------------------------- /vue/src/api/position.js: -------------------------------------------------------------------------------- 1 | import request from "@/utils/request"; 2 | 3 | export function PositionsList() { 4 | return request({ 5 | url: "/position/list", 6 | method: "post" 7 | }); 8 | } 9 | 10 | export function getPositions() { 11 | return request({ 12 | url: "/get/positions", 13 | method: "post" 14 | }); 15 | } 16 | 17 | export function getPositionKeyName() { 18 | return request({ 19 | url: "/position/keyname", 20 | method: "post" 21 | }); 22 | } 23 | 24 | export function getManagerKeyName() { 25 | return request({ 26 | url: "/manager/keyname", 27 | method: "post" 28 | }); 29 | } 30 | 31 | export function addPosition(data) { 32 | return request({ 33 | url: "/position/add", 34 | method: "post", 35 | data: data 36 | }); 37 | } 38 | 39 | export function delPosition(id) { 40 | return request({ 41 | url: "/position/del", 42 | method: "get", 43 | params: { id } 44 | }); 45 | } 46 | 47 | export function updatePosition(data) { 48 | return request({ 49 | url: "/position/update", 50 | method: "post", 51 | data: data 52 | }); 53 | } 54 | 55 | 56 | -------------------------------------------------------------------------------- /vue/src/api/project.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function getProjectName() { 4 | return request({ 5 | url: '/project/list', 6 | method: 'post' 7 | }) 8 | } 9 | 10 | export function addProjectName(data) { 11 | return request({ 12 | url: '/project/add', 13 | method: 'post', 14 | data 15 | }) 16 | } 17 | 18 | export function updateProjectName(data) { 19 | return request({ 20 | url: '/project/update', 21 | method: 'post', 22 | data 23 | }) 24 | } 25 | 26 | export function deleteProjectName(id) { 27 | return request({ 28 | url: '/project/delete', 29 | method: 'get', 30 | params: { id } 31 | }) 32 | } 33 | 34 | -------------------------------------------------------------------------------- /vue/src/api/role.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function getRoles() { 4 | return request({ 5 | url: '/roles/get', 6 | method: 'get' 7 | }) 8 | } 9 | 10 | export function addRole(data) { 11 | return request({ 12 | url: '/rolegroup/add', 13 | method: 'post', 14 | data 15 | }) 16 | } 17 | 18 | 19 | export function getRoleGroupPerm(id) { 20 | return request({ 21 | url: `/rolegroup/perm/get?id=${id}`, 22 | method: 'get' 23 | }) 24 | } 25 | 26 | export function editRole(data) { 27 | return request({ 28 | url: '/rolegroup/edit', 29 | method: 'post', 30 | data 31 | }) 32 | } 33 | 34 | export function getPermTemplate(data) { 35 | return request({ 36 | url: '/rolegroup/template', 37 | method: 'post', 38 | data 39 | }) 40 | } 41 | 42 | export function removeRole(id) { 43 | return request({ 44 | url: '/rolegroup/remove', 45 | method: 'get', 46 | params: { id } 47 | }) 48 | } 49 | 50 | export function roleList() { 51 | return request({ 52 | url: `/rolegroup/list`, 53 | method: 'post' 54 | }) 55 | } 56 | 57 | export function roleGroupName() { 58 | return request({ 59 | url: `/role/list`, 60 | method: 'post' 61 | }) 62 | } 63 | -------------------------------------------------------------------------------- /vue/src/api/rolegroup.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function getRoleGroup() { 4 | return request({ 5 | url: '/rolegroup/get', 6 | method: 'post' 7 | }) 8 | } 9 | 10 | export function addRole(data) { 11 | return request({ 12 | url: '/role/add', 13 | method: 'post', 14 | data 15 | }) 16 | } 17 | 18 | export function editRole(id, data) { 19 | return request({ 20 | url: '/role/edit', 21 | method: 'post', 22 | data 23 | }) 24 | } 25 | 26 | -------------------------------------------------------------------------------- /vue/src/api/search.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function searchMyBugs(data) { 4 | return request({ 5 | url: '/search/mybugs', 6 | method: 'post', 7 | data: data 8 | }) 9 | } 10 | 11 | export function searchAllBugs(data) { 12 | return request({ 13 | url: '/search/allbugs', 14 | method: 'post', 15 | data: data 16 | }) 17 | } 18 | 19 | export function userSearch(name) { 20 | return request({ 21 | url: '/search/user', 22 | method: 'get', 23 | params: { name } 24 | }) 25 | } 26 | 27 | export function bugFilter(data) { 28 | return request({ 29 | url: '/search/bugmanager', 30 | method: 'post', 31 | data: data 32 | }) 33 | } 34 | 35 | export function searchMyTasks(data) { 36 | return request({ 37 | url: '/search/mytasks', 38 | method: 'post', 39 | data: data 40 | }) 41 | } 42 | -------------------------------------------------------------------------------- /vue/src/api/setting.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function createuser(data) { 4 | return request({ 5 | url: '/setting/createuser', 6 | method: 'post', 7 | data: data 8 | }) 9 | } 10 | 11 | export function getroles(data) { 12 | return request({ 13 | url: '/setting/getroles', 14 | method: 'post', 15 | data: data 16 | }) 17 | } 18 | 19 | export function chpwd(data) { 20 | return request({ 21 | url: '/setting/chpwd', 22 | method: 'post', 23 | data: data 24 | }) 25 | } 26 | 27 | export function getuserlist() { 28 | return request({ 29 | url: '/setting/userlist', 30 | method: 'post' 31 | }) 32 | } 33 | 34 | export function resetpwd(id) { 35 | return request({ 36 | url: '/setting/resetpwd', 37 | method: 'get', 38 | params: { id } 39 | }) 40 | } 41 | 42 | -------------------------------------------------------------------------------- /vue/src/api/status.js: -------------------------------------------------------------------------------- 1 | import request from "@/utils/request"; 2 | 3 | export function addStatus(data) { 4 | return request({ 5 | url: "/status/add", 6 | method: "post", 7 | data: data 8 | }); 9 | } 10 | 11 | export function getStatusList() { 12 | return request({ 13 | url: "/status/list", 14 | method: "post" 15 | }); 16 | } 17 | 18 | export function removeStatus(id) { 19 | return request({ 20 | url: "/status/remove", 21 | method: "get", 22 | params: { id } 23 | }); 24 | } 25 | 26 | export function updateStatus(data) { 27 | return request({ 28 | url: "/status/update", 29 | method: "post", 30 | data 31 | }); 32 | } 33 | 34 | export function statusFilter(data) { 35 | return request({ 36 | url: "/status/save", 37 | method: "post", 38 | data 39 | }); 40 | } 41 | 42 | export function showStatus() { 43 | return request({ 44 | url: "/status/show", 45 | method: "post" 46 | }); 47 | } 48 | 49 | export function getStatusName() { 50 | return request({ 51 | url: "/status/groupname", 52 | method: "post" 53 | }); 54 | } 55 | -------------------------------------------------------------------------------- /vue/src/api/statusgroup.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function statusGroupList() { 4 | return request({ 5 | url: '/statusgroup/list', 6 | method: 'post' 7 | }) 8 | } 9 | 10 | export function addStatusGroup(data) { 11 | return request({ 12 | url: '/statusgroup/add', 13 | method: 'post', 14 | data: data 15 | }) 16 | } 17 | 18 | export function editStatusGroup(data) { 19 | return request({ 20 | url: '/statusgroup/edit', 21 | method: 'post', 22 | data: data 23 | }) 24 | } 25 | 26 | export function removeStatusGroup(id) { 27 | return request({ 28 | url: '/statusgroup/remove', 29 | method: 'get', 30 | params: { id } 31 | }) 32 | } 33 | 34 | export function getStatusGroupName() { 35 | return request({ 36 | url: '/statusgroup/keyname', 37 | method: 'post' 38 | }) 39 | } 40 | 41 | -------------------------------------------------------------------------------- /vue/src/api/transaction.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function fetchList(query) { 4 | return request({ 5 | url: '/transaction/list', 6 | method: 'get', 7 | params: query 8 | }) 9 | } 10 | -------------------------------------------------------------------------------- /vue/src/api/upload.js: -------------------------------------------------------------------------------- 1 | // import request from '@/utils/request' 2 | 3 | // export function uploadImg() { 4 | // return request({ 5 | // url: '/get/status', 6 | // method: 'post' 7 | // }) 8 | // } 9 | -------------------------------------------------------------------------------- /vue/src/api/uploadimg.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function uploadImg(data) { 4 | return request({ 5 | url: '/uploadimg', 6 | method: 'post', 7 | data 8 | }) 9 | } 10 | -------------------------------------------------------------------------------- /vue/src/api/usermanager/usergroup.js: -------------------------------------------------------------------------------- 1 | import request from "@/utils/request"; 2 | 3 | // 获取所有用户keyname 4 | export function getAllUserKeyName() { 5 | return request({ 6 | url: "/alluser/keyname", 7 | method: "post" 8 | }); 9 | } 10 | 11 | // 获取所有用户组 12 | export function getUserGroups() { 13 | return request({ 14 | url: "/usergroup/list", 15 | method: "post" 16 | }); 17 | } 18 | 19 | // 修改用户组 20 | export function updateUserGroup(data) { 21 | return request({ 22 | url: "/usergroup/update", 23 | method: "post", 24 | data 25 | }); 26 | } 27 | 28 | // 创建用户组 29 | export function createUserGroups(data) { 30 | return request({ 31 | url: "/usergroup/create", 32 | method: "post", 33 | data 34 | }); 35 | } 36 | 37 | // 删除用户组 38 | export function deleteUserGroups(id) { 39 | return request({ 40 | url: `/usergroup/delete?id=${id}`, 41 | method: "get" 42 | }); 43 | } 44 | -------------------------------------------------------------------------------- /vue/src/api/version.js: -------------------------------------------------------------------------------- 1 | import request from '@/utils/request' 2 | 3 | export function addVersion(data) { 4 | return request({ 5 | url: '/version/add', 6 | method: 'post', 7 | data: data 8 | }) 9 | } 10 | 11 | export function getVersion() { 12 | return request({ 13 | url: '/version/list', 14 | method: 'post' 15 | }) 16 | } 17 | 18 | export function removeVersion(id) { 19 | return request({ 20 | url: '/version/remove', 21 | method: 'get', 22 | params: { id } 23 | }) 24 | } 25 | 26 | export function updateVersion(data) { 27 | return request({ 28 | url: '/version/update', 29 | method: 'post', 30 | data: data 31 | }) 32 | } 33 | -------------------------------------------------------------------------------- /vue/src/assets/401_images/401.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyahm/ITflow/692a9c34d4c33e37cd7fbe6d8f19615bd8b3bc40/vue/src/assets/401_images/401.gif -------------------------------------------------------------------------------- /vue/src/assets/404_images/404.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyahm/ITflow/692a9c34d4c33e37cd7fbe6d8f19615bd8b3bc40/vue/src/assets/404_images/404.png -------------------------------------------------------------------------------- /vue/src/assets/404_images/404_cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyahm/ITflow/692a9c34d4c33e37cd7fbe6d8f19615bd8b3bc40/vue/src/assets/404_images/404_cloud.png -------------------------------------------------------------------------------- /vue/src/assets/custom-theme/fonts/element-icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyahm/ITflow/692a9c34d4c33e37cd7fbe6d8f19615bd8b3bc40/vue/src/assets/custom-theme/fonts/element-icons.ttf -------------------------------------------------------------------------------- /vue/src/assets/custom-theme/fonts/element-icons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hyahm/ITflow/692a9c34d4c33e37cd7fbe6d8f19615bd8b3bc40/vue/src/assets/custom-theme/fonts/element-icons.woff -------------------------------------------------------------------------------- /vue/src/components/Hamburger/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 32 | 33 | 45 | -------------------------------------------------------------------------------- /vue/src/icons/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import SvgIcon from '@/components/SvgIcon'// svg component 3 | 4 | // register globally 5 | Vue.component('svg-icon', SvgIcon) 6 | 7 | const req = require.context('./svg', false, /\.svg$/) 8 | const requireAll = requireContext => requireContext.keys().map(requireContext) 9 | requireAll(req) 10 | -------------------------------------------------------------------------------- /vue/src/icons/svg/404.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/add.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/bug.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/chart.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/clipboard.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/component.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/documentation.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/download.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/drag.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/edit.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/education.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/email.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/example.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/excel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/eye-open.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/eye.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/file.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/folder.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/fullscreen.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/guide.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/icon.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/international.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/language.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/link.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/list.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/lock.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/message.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/money.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/more.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/moveto.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/nested.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/password.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/people.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/peoples.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/remove.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/rename.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/search.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/size.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/skill.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/star.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/tab.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/table.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/theme.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/tree-table.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/user.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/wechat.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svg/zip.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /vue/src/icons/svgo.yml: -------------------------------------------------------------------------------- 1 | # replace default config 2 | 3 | # multipass: true 4 | # full: true 5 | 6 | plugins: 7 | 8 | # - name 9 | # 10 | # or: 11 | # - name: false 12 | # - name: true 13 | # 14 | # or: 15 | # - name: 16 | # param1: 1 17 | # param2: 2 18 | 19 | - removeAttrs: 20 | attrs: 21 | - 'fill' 22 | - 'fill-rule' 23 | -------------------------------------------------------------------------------- /vue/src/layout/components/AppMain.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 24 | 25 | 49 | 50 | 58 | -------------------------------------------------------------------------------- /vue/src/layout/components/Sidebar/FixiOSBug.js: -------------------------------------------------------------------------------- 1 | export default { 2 | computed: { 3 | device() { 4 | return this.$store.state.app.device 5 | } 6 | }, 7 | mounted() { 8 | // In order to fix the click on menu on the ios device will trigger the mouseleave bug 9 | // https://github.com/PanJiaChen/vue-element-admin/issues/1135 10 | this.fixBugIniOS() 11 | }, 12 | methods: { 13 | fixBugIniOS() { 14 | const $subMenu = this.$refs.subMenu 15 | if ($subMenu) { 16 | const handleMouseleave = $subMenu.handleMouseleave 17 | $subMenu.handleMouseleave = (e) => { 18 | if (this.device === 'mobile') { 19 | return 20 | } 21 | handleMouseleave(e) 22 | } 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vue/src/layout/components/Sidebar/Item.vue: -------------------------------------------------------------------------------- 1 | 34 | 35 | 42 | -------------------------------------------------------------------------------- /vue/src/layout/components/Sidebar/Link.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 44 | -------------------------------------------------------------------------------- /vue/src/layout/components/index.js: -------------------------------------------------------------------------------- 1 | export { default as AppMain } from "./AppMain"; 2 | export { default as Navbar } from "./Navbar"; 3 | export { default as Sidebar } from "./Sidebar/index.vue"; 4 | export { default as TagsView } from "./TagsView/index.vue"; 5 | -------------------------------------------------------------------------------- /vue/src/layout/mixin/ResizeHandler.js: -------------------------------------------------------------------------------- 1 | import store from '@/store' 2 | 3 | const { body } = document 4 | const WIDTH = 992 // refer to Bootstrap's responsive design 5 | 6 | export default { 7 | watch: { 8 | $route(route) { 9 | if (this.device === 'mobile' && this.sidebar.opened) { 10 | store.dispatch('app/closeSideBar', { withoutAnimation: false }) 11 | } 12 | } 13 | }, 14 | beforeMount() { 15 | window.addEventListener('resize', this.$_resizeHandler) 16 | }, 17 | beforeDestroy() { 18 | window.removeEventListener('resize', this.$_resizeHandler) 19 | }, 20 | mounted() { 21 | const isMobile = this.$_isMobile() 22 | if (isMobile) { 23 | store.dispatch('app/toggleDevice', 'mobile') 24 | store.dispatch('app/closeSideBar', { withoutAnimation: true }) 25 | } 26 | }, 27 | methods: { 28 | // use $_ for mixins properties 29 | // https://vuejs.org/v2/style-guide/index.html#Private-property-names-essential 30 | $_isMobile() { 31 | const rect = body.getBoundingClientRect() 32 | return rect.width - 1 < WIDTH 33 | }, 34 | $_resizeHandler() { 35 | if (!document.hidden) { 36 | const isMobile = this.$_isMobile() 37 | store.dispatch('app/toggleDevice', isMobile ? 'mobile' : 'desktop') 38 | 39 | if (isMobile) { 40 | store.dispatch('app/closeSideBar', { withoutAnimation: true }) 41 | } 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vue/src/router/modules/charts.js: -------------------------------------------------------------------------------- 1 | /** When your routing table is too long, you can split it into small modules**/ 2 | 3 | import Layout from '@/layout' 4 | 5 | const chartsRouter = { 6 | path: '/charts', 7 | component: Layout, 8 | redirect: 'noredirect', 9 | name: 'charts', 10 | meta: { 11 | title: 'charts', 12 | icon: 'chart' 13 | }, 14 | children: [ 15 | { 16 | path: 'keyboard', 17 | component: () => import('@/views/charts/keyboard'), 18 | name: 'keyboardChart', 19 | meta: { title: 'keyboardChart', noCache: true } 20 | }, 21 | { 22 | path: 'line', 23 | component: () => import('@/views/charts/line'), 24 | name: 'lineChart', 25 | meta: { title: 'lineChart', noCache: true } 26 | }, 27 | { 28 | path: 'mixchart', 29 | component: () => import('@/views/charts/mixChart'), 30 | name: 'mixChart', 31 | meta: { title: 'mixChart', noCache: true } 32 | } 33 | ] 34 | } 35 | 36 | export default chartsRouter 37 | -------------------------------------------------------------------------------- /vue/src/router/modules/components.js: -------------------------------------------------------------------------------- 1 | /** When your routing table is too long, you can split it into small modules**/ 2 | 3 | import Layout from '@/layout' 4 | 5 | const componentsRouter = { 6 | path: '/showbug', 7 | component: Layout, 8 | redirect: 'noredirect', 9 | hidden: true, 10 | children: [ 11 | { 12 | path: ':id', 13 | component: () => import('@/views/bug/show'), 14 | name: 'showbug', 15 | meta: { title: 'backToTop' } 16 | } 17 | ] 18 | } 19 | 20 | export default componentsRouter 21 | -------------------------------------------------------------------------------- /vue/src/router/modules/doc.js: -------------------------------------------------------------------------------- 1 | import Layout from '@/layout' 2 | 3 | // 用户添加和管理的权限 usermanager 4 | 5 | const docRoute = { 6 | path: '/doc', 7 | component: Layout, 8 | name: 'docManager', 9 | meta: { 10 | title: '文档管理', 11 | icon: 'setting', 12 | roles: ['admin', 'user'] 13 | }, 14 | children: [{ 15 | path: 'doc', 16 | component: () => 17 | import ('@/views/doc/doclist'), 18 | name: 'keys', 19 | meta: { 20 | title: '文档管理', 21 | icon: 'edit', 22 | 23 | } 24 | }, 25 | { 26 | path: 'keys', 27 | component: () => 28 | import ('@/views/doc/keys'), 29 | name: 'keylist', 30 | meta: { 31 | title: '秘钥管理', 32 | noCache: true, 33 | icon: 'edit' 34 | } 35 | } 36 | ] 37 | } 38 | 39 | export default docRoute -------------------------------------------------------------------------------- /vue/src/settings.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | title: 'ITflow', 3 | 4 | /** 5 | * @type {boolean} true | false 6 | * @description Whether show the settings right-panel 7 | */ 8 | showSettings: true, 9 | 10 | /** 11 | * @type {boolean} true | false 12 | * @description Whether need tagsView 13 | */ 14 | tagsView: true, 15 | 16 | /** 17 | * @type {boolean} true | false 18 | * @description Whether fix the header 19 | */ 20 | fixedHeader: false, 21 | 22 | /** 23 | * @type {boolean} true | false 24 | * @description Whether show the logo in sidebar 25 | */ 26 | sidebarLogo: false, 27 | 28 | /** 29 | * @type {string | array} 'production' | ['production', 'development'] 30 | * @description Need show err logs component. 31 | * The default is only used in the production env 32 | * If you want to also use it in dev, you can pass ['production', 'development'] 33 | */ 34 | errorLog: 'production' 35 | } -------------------------------------------------------------------------------- /vue/src/store/getters.js: -------------------------------------------------------------------------------- 1 | const getters = { 2 | sidebar: state => state.app.sidebar, 3 | size: state => state.app.size, 4 | device: state => state.app.device, 5 | visitedViews: state => state.tagsView.visitedViews, 6 | cachedViews: state => state.tagsView.cachedViews, 7 | token: state => state.user.token, 8 | avatar: state => state.user.avatar, 9 | name: state => state.user.name, 10 | introduction: state => state.user.introduction, 11 | roles: state => state.user.roles, 12 | permission_routes: state => state.permission.routes, 13 | errorLogs: state => state.errorLog.logs, 14 | uid: state => state.user.uid 15 | } 16 | export default getters 17 | -------------------------------------------------------------------------------- /vue/src/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | import getters from './getters' 4 | 5 | Vue.use(Vuex) 6 | 7 | // https://webpack.js.org/guides/dependency-management/#requirecontext 8 | const modulesFiles = require.context('./modules', true, /\.js$/) 9 | 10 | // you do not need `import app from './modules/app'` 11 | // it will auto require all vuex module from modules file 12 | const modules = modulesFiles.keys().reduce((modules, modulePath) => { 13 | // set './app.js' => 'app' 14 | const moduleName = modulePath.replace(/^\.\/(.*)\.\w+$/, '$1') 15 | const value = modulesFiles(modulePath) 16 | modules[moduleName] = value.default 17 | return modules 18 | }, {}) 19 | 20 | const store = new Vuex.Store({ 21 | modules, 22 | getters 23 | }) 24 | 25 | export default store 26 | -------------------------------------------------------------------------------- /vue/src/store/modules/app.js: -------------------------------------------------------------------------------- 1 | import Cookies from 'js-cookie' 2 | 3 | const state = { 4 | sidebar: { 5 | opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, 6 | withoutAnimation: false 7 | }, 8 | device: 'desktop', 9 | size: Cookies.get('size') || 'medium' 10 | } 11 | 12 | const mutations = { 13 | TOGGLE_SIDEBAR: state => { 14 | state.sidebar.opened = !state.sidebar.opened 15 | state.sidebar.withoutAnimation = false 16 | if (state.sidebar.opened) { 17 | Cookies.set('sidebarStatus', 1) 18 | } else { 19 | Cookies.set('sidebarStatus', 0) 20 | } 21 | }, 22 | CLOSE_SIDEBAR: (state, withoutAnimation) => { 23 | Cookies.set('sidebarStatus', 0) 24 | state.sidebar.opened = false 25 | state.sidebar.withoutAnimation = withoutAnimation 26 | }, 27 | TOGGLE_DEVICE: (state, device) => { 28 | state.device = device 29 | }, 30 | SET_SIZE: (state, size) => { 31 | state.size = size 32 | Cookies.set('size', size) 33 | } 34 | } 35 | 36 | const actions = { 37 | toggleSideBar({ commit }) { 38 | commit('TOGGLE_SIDEBAR') 39 | }, 40 | closeSideBar({ commit }, { withoutAnimation }) { 41 | commit('CLOSE_SIDEBAR', withoutAnimation) 42 | }, 43 | toggleDevice({ commit }, device) { 44 | commit('TOGGLE_DEVICE', device) 45 | }, 46 | setSize({ commit }, size) { 47 | commit('SET_SIZE', size) 48 | } 49 | } 50 | 51 | export default { 52 | namespaced: true, 53 | state, 54 | mutations, 55 | actions 56 | } 57 | -------------------------------------------------------------------------------- /vue/src/store/modules/settings.js: -------------------------------------------------------------------------------- 1 | // import variables from '@/styles/element-variables.scss' 2 | import defaultSettings from '@/settings' 3 | 4 | const { showSettings, tagsView, fixedHeader, sidebarLogo } = defaultSettings 5 | 6 | const state = { 7 | // theme: variables.theme, 8 | showSettings: showSettings, 9 | tagsView: tagsView, 10 | fixedHeader: fixedHeader, 11 | sidebarLogo: sidebarLogo 12 | } 13 | 14 | const mutations = { 15 | CHANGE_SETTING: (state, { key, value }) => { 16 | if (state.hasOwnProperty(key)) { 17 | state[key] = value 18 | } 19 | } 20 | } 21 | 22 | const actions = { 23 | changeSetting({ commit }, data) { 24 | commit('CHANGE_SETTING', data) 25 | } 26 | } 27 | 28 | export default { 29 | namespaced: true, 30 | state, 31 | mutations, 32 | actions 33 | } 34 | 35 | -------------------------------------------------------------------------------- /vue/src/styles/element-variables.scss: -------------------------------------------------------------------------------- 1 | /** 2 | * I think element-ui's default theme color is too light for long-term use. 3 | * So I modified the default color and you can modify it to your liking. 4 | **/ 5 | 6 | /* theme color */ 7 | $--color-primary: #1890ff; 8 | $--color-success: #13ce66; 9 | $--color-warning: #ffba00; 10 | $--color-danger: #ff4949; 11 | // $--color-info: #1E1E1E; 12 | 13 | $--button-font-weight: 400; 14 | 15 | // $--color-text-regular: #1f2d3d; 16 | 17 | $--border-color-light: #dfe4ed; 18 | $--border-color-lighter: #e6ebf5; 19 | 20 | $--table-border: 1px solid #dfe6ec; 21 | 22 | /* icon font path, required */ 23 | $--font-path: "~element-ui/lib/theme-chalk/fonts"; 24 | 25 | @use "~element-ui/packages/theme-chalk/src/index"; 26 | 27 | // the :export directive is the magic sauce for webpack 28 | // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass 29 | :export { 30 | theme: $--color-primary; 31 | } 32 | -------------------------------------------------------------------------------- /vue/src/styles/transition.scss: -------------------------------------------------------------------------------- 1 | // global transition css 2 | 3 | /* fade */ 4 | .fade-enter-active, 5 | .fade-leave-active { 6 | transition: opacity 0.28s; 7 | } 8 | 9 | .fade-enter, 10 | .fade-leave-active { 11 | opacity: 0; 12 | } 13 | 14 | /* fade-transform */ 15 | .fade-transform-leave-active, 16 | .fade-transform-enter-active { 17 | transition: all .5s; 18 | } 19 | 20 | .fade-transform-enter { 21 | opacity: 0; 22 | transform: translateX(-30px); 23 | } 24 | 25 | .fade-transform-leave-to { 26 | opacity: 0; 27 | transform: translateX(30px); 28 | } 29 | 30 | /* breadcrumb transition */ 31 | .breadcrumb-enter-active, 32 | .breadcrumb-leave-active { 33 | transition: all .5s; 34 | } 35 | 36 | .breadcrumb-enter, 37 | .breadcrumb-leave-active { 38 | opacity: 0; 39 | transform: translateX(20px); 40 | } 41 | 42 | .breadcrumb-move { 43 | transition: all .5s; 44 | } 45 | 46 | .breadcrumb-leave-active { 47 | position: absolute; 48 | } 49 | -------------------------------------------------------------------------------- /vue/src/styles/variables.scss: -------------------------------------------------------------------------------- 1 | // base color 2 | $blue:#324157; 3 | $light-blue:#3A71A8; 4 | $red:#C03639; 5 | $pink: #E65D6E; 6 | $green: #30B08F; 7 | $tiffany: #4AB7BD; 8 | $yellow:#FEC171; 9 | $panGreen: #30B08F; 10 | 11 | // sidebar 12 | $menuText:#bfcbd9; 13 | $menuActiveText:#409EFF; 14 | $subMenuActiveText:#f4f4f5; // https://github.com/ElemeFE/element/issues/12951 15 | 16 | $menuBg:#304156; 17 | $menuHover:#263445; 18 | 19 | $subMenuBg:#1f2d3d; 20 | $subMenuHover:#001528; 21 | 22 | $sideBarWidth: 210px; 23 | 24 | // the :export directive is the magic sauce for webpack 25 | // https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass 26 | :export { 27 | menuText: $menuText; 28 | menuActiveText: $menuActiveText; 29 | subMenuActiveText: #f4f4f5; 30 | menuBg: $menuBg; 31 | menuHover: #263445; 32 | subMenuBg: #1f2d3d; 33 | subMenuHover: #001528; 34 | sideBarWidth: 210px; 35 | } 36 | -------------------------------------------------------------------------------- /vue/src/utils/auth.js: -------------------------------------------------------------------------------- 1 | import Cookies from 'js-cookie' 2 | 3 | const TokenKey = 'Admin-Token' 4 | // const inFifteenMinutes = new Date(new Date().getTime() + 120 * 60 * 1000 * 24) 5 | export function getToken() { 6 | return Cookies.get(TokenKey) 7 | } 8 | 9 | export function setToken(token) { 10 | return Cookies.set(TokenKey, token) 11 | } 12 | 13 | export function removeToken() { 14 | return Cookies.remove(TokenKey) 15 | } 16 | 17 | export function setTimeout() { 18 | return Cookies.set(TokenKey, getToken(TokenKey)) 19 | } 20 | -------------------------------------------------------------------------------- /vue/src/utils/clipboard.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Clipboard from 'clipboard' 3 | 4 | function clipboardSuccess() { 5 | Vue.prototype.$message({ 6 | message: 'Copy successfully', 7 | type: 'success', 8 | duration: 1500 9 | }) 10 | } 11 | 12 | function clipboardError() { 13 | Vue.prototype.$message({ 14 | message: 'Copy failed', 15 | type: 'error' 16 | }) 17 | } 18 | 19 | export default function handleClipboard(text, event) { 20 | const clipboard = new Clipboard(event.target, { 21 | text: () => text 22 | }) 23 | clipboard.on('success', () => { 24 | clipboardSuccess() 25 | clipboard.destroy() 26 | }) 27 | clipboard.on('error', () => { 28 | clipboardError() 29 | clipboard.destroy() 30 | }) 31 | clipboard.onClick(event) 32 | } 33 | -------------------------------------------------------------------------------- /vue/src/utils/get-page-title.js: -------------------------------------------------------------------------------- 1 | import defaultSettings from '@/settings' 2 | 3 | const title = defaultSettings.title || 'ITflow' 4 | 5 | export default function getPageTitle(pageTitle) { 6 | if (pageTitle) { 7 | return `${pageTitle} - ${title}` 8 | } 9 | return `${title}` 10 | } -------------------------------------------------------------------------------- /vue/src/utils/open-window.js: -------------------------------------------------------------------------------- 1 | /** 2 | *Created by PanJiaChen on 16/11/29. 3 | * @param {Sting} url 4 | * @param {Sting} title 5 | * @param {Number} w 6 | * @param {Number} h 7 | */ 8 | export default function openWindow(url, title, w, h) { 9 | // Fixes dual-screen position Most browsers Firefox 10 | const dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : screen.left 11 | const dualScreenTop = window.screenTop !== undefined ? window.screenTop : screen.top 12 | 13 | const width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width 14 | const height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height 15 | 16 | const left = ((width / 2) - (w / 2)) + dualScreenLeft 17 | const top = ((height / 2) - (h / 2)) + dualScreenTop 18 | const newWindow = window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left) 19 | 20 | // Puts focus on the newWindow 21 | if (window.focus) { 22 | newWindow.focus() 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /vue/src/utils/permission.js: -------------------------------------------------------------------------------- 1 | import store from '@/store' 2 | 3 | /** 4 | * @param {Array} value 5 | * @returns {Boolean} 6 | * @example see @/views/permission/directive.vue 7 | */ 8 | export default function checkPermission(value) { 9 | if (value && value instanceof Array && value.length > 0) { 10 | const roles = store.getters && store.getters.roles 11 | const permissionRoles = value 12 | 13 | const hasPermission = roles.some(role => { 14 | return permissionRoles.includes(role) 15 | }) 16 | return hasPermission 17 | } else { 18 | console.error(`need roles! Like v-permission="['admin','editor']"`) 19 | return false 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /vue/src/views/bug/allbugs.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 22 | -------------------------------------------------------------------------------- /vue/src/views/bug/components/Dropdown/Comment.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 38 | -------------------------------------------------------------------------------- /vue/src/views/bug/components/Dropdown/Platform.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 50 | -------------------------------------------------------------------------------- /vue/src/views/bug/components/Dropdown/SourceUrl.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 37 | -------------------------------------------------------------------------------- /vue/src/views/bug/components/Dropdown/index.js: -------------------------------------------------------------------------------- 1 | export { default as CommentDropdown } from './Comment' 2 | export { default as PlatformDropdown } from './Platform' 3 | export { default as SourceUrlDropdown } from './SourceUrl' 4 | -------------------------------------------------------------------------------- /vue/src/views/bug/create.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 13 | 14 | -------------------------------------------------------------------------------- /vue/src/views/bug/edit.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 13 | 14 | -------------------------------------------------------------------------------- /vue/src/views/bug/mybug.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 25 | 26 | 36 | -------------------------------------------------------------------------------- /vue/src/views/bug/mytask.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 22 | -------------------------------------------------------------------------------- /vue/src/views/charts/keyboard.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 15 | 16 | 23 | 24 | -------------------------------------------------------------------------------- /vue/src/views/charts/line.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 15 | 16 | 23 | 24 | -------------------------------------------------------------------------------- /vue/src/views/charts/mix-chart.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 15 | 16 | 23 | 24 | -------------------------------------------------------------------------------- /vue/src/views/charts/mixChart.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 15 | 16 | 24 | 25 | -------------------------------------------------------------------------------- /vue/src/views/dashboard/index.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 29 | -------------------------------------------------------------------------------- /vue/src/views/login/auth-redirect.vue: -------------------------------------------------------------------------------- 1 | 16 | -------------------------------------------------------------------------------- /vue/src/views/login/authredirect.vue: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /vue/src/views/profile/components/Account.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 39 | -------------------------------------------------------------------------------- /vue/src/views/profile/components/Timeline.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 44 | -------------------------------------------------------------------------------- /vue/src/views/restful/doc.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | -------------------------------------------------------------------------------- /vue/src/views/system/bugdustbin.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /vue/src/views/user/email.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 64 | 65 | 70 | -------------------------------------------------------------------------------- /vue/test.js: -------------------------------------------------------------------------------- 1 | let a = [1,2,4,5,6] 2 | console.log( a.indexOf(0)) --------------------------------------------------------------------------------