├── .gitignore
├── README.md
├── rebugger-admin
├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .postcssrc.js
├── LICENSE
├── README.md
├── build
│ ├── build.em.js
│ ├── build.js
│ ├── build.lib.js
│ ├── check-versions.js
│ ├── utils.js
│ ├── vue-loader.conf.js
│ ├── webpack.base.conf.js
│ ├── webpack.dev.conf.js
│ ├── webpack.em.conf.js
│ ├── webpack.lib.conf.js
│ └── webpack.prod.conf.js
├── config
│ ├── dev.env.js
│ ├── index.js
│ └── prod.env.js
├── favicon.ico
├── index.html
├── package-lock.json
├── package.json
├── src
│ ├── App.vue
│ ├── api
│ │ ├── dashboard.js
│ │ ├── set-axios.js
│ │ └── system.js
│ ├── assets
│ │ ├── css
│ │ │ ├── base.scss
│ │ │ ├── element-common.scss
│ │ │ ├── theme.scss
│ │ │ ├── transition.scss
│ │ │ └── vars.scss
│ │ ├── icons
│ │ │ ├── icon.js
│ │ │ └── svg
│ │ │ │ ├── datetime.svg
│ │ │ │ ├── expand.svg
│ │ │ │ ├── gcjzlogo.svg
│ │ │ │ ├── unexpand.svg
│ │ │ │ └── wenhao.svg
│ │ └── images
│ │ │ ├── head.jpg
│ │ │ ├── login-bg.png
│ │ │ ├── login_bg.png
│ │ │ ├── login_icon1_n.png
│ │ │ ├── login_icon2_n.png
│ │ │ └── login_icon3_n.png
│ ├── components
│ │ ├── HelloWorld.vue
│ │ ├── TreeTable
│ │ │ ├── TreeTable.vue
│ │ │ └── eval.js
│ │ └── base
│ │ │ ├── DyButton.vue
│ │ │ ├── DyCheckboxGroup.vue
│ │ │ ├── DyForm.vue
│ │ │ ├── DyFormItem.vue
│ │ │ ├── DyIcon.vue
│ │ │ ├── DyImport.vue
│ │ │ ├── DyInputNumber.vue
│ │ │ ├── DyInputTable.vue
│ │ │ ├── DyInputTags.vue
│ │ │ ├── DyInputTree.vue
│ │ │ ├── DyRender.vue
│ │ │ ├── DySelect.vue
│ │ │ ├── DyTable.vue
│ │ │ └── EditModel.vue
│ ├── config
│ │ └── index.js
│ ├── main.js
│ ├── mixins
│ │ └── baseMixins.js
│ ├── modules
│ │ ├── chart
│ │ │ ├── router.js
│ │ │ └── view
│ │ │ │ └── engChart.vue
│ │ ├── common
│ │ │ ├── router.js
│ │ │ ├── view
│ │ │ │ ├── Header.vue
│ │ │ │ ├── MainLayout.vue
│ │ │ │ ├── Nav.vue
│ │ │ │ ├── Page404.vue
│ │ │ │ └── Tabs.vue
│ │ │ └── vuex.js
│ │ ├── dashboard
│ │ │ ├── api.js
│ │ │ ├── fragment
│ │ │ │ ├── handleInfo.vue
│ │ │ │ ├── lineChartPanel.vue
│ │ │ │ ├── pannel.vue
│ │ │ │ ├── piePannel.vue
│ │ │ │ ├── projectPannel.vue
│ │ │ │ └── statPannel.vue
│ │ │ ├── router.js
│ │ │ ├── view
│ │ │ │ └── Dashboard.vue
│ │ │ └── vuex.js
│ │ ├── project
│ │ │ ├── api.js
│ │ │ ├── fragment
│ │ │ │ └── imageSelect.vue
│ │ │ ├── router.js
│ │ │ ├── view
│ │ │ │ ├── editProject.vue
│ │ │ │ └── project.vue
│ │ │ └── vuex.js
│ │ ├── public
│ │ │ ├── api.js
│ │ │ ├── router.js
│ │ │ ├── view
│ │ │ │ └── Login.vue
│ │ │ └── vuex.js
│ │ ├── report
│ │ │ ├── api.js
│ │ │ ├── fragment
│ │ │ │ ├── infoModel.vue
│ │ │ │ └── resolveModel.vue
│ │ │ ├── router.js
│ │ │ ├── view
│ │ │ │ ├── reportInfo.vue
│ │ │ │ └── reportList.vue
│ │ │ └── vuex.js
│ │ ├── stat
│ │ │ ├── api.js
│ │ │ ├── router.js
│ │ │ ├── view
│ │ │ │ ├── broswerStat.vue
│ │ │ │ ├── deviceStat.vue
│ │ │ │ └── regionStat.vue
│ │ │ └── vuex.js
│ │ └── system
│ │ │ ├── api.js
│ │ │ ├── fragment
│ │ │ └── MenuTree.vue
│ │ │ ├── router.js
│ │ │ ├── view
│ │ │ ├── Dept.vue
│ │ │ ├── DeptAddOrUpdate.vue
│ │ │ ├── Menu.vue
│ │ │ ├── Role.vue
│ │ │ ├── RoleAddOrUpdate.vue
│ │ │ ├── User.vue
│ │ │ ├── UserAddOrUpdate.vue
│ │ │ ├── dept-list.json
│ │ │ ├── dept-select.json
│ │ │ ├── menu.json
│ │ │ ├── role-info.json
│ │ │ ├── role-list.json
│ │ │ ├── selectMenu.json
│ │ │ ├── user-info.json
│ │ │ └── user-list.json
│ │ │ └── vuex.js
│ ├── router.js
│ ├── store.js
│ └── utils
│ │ ├── constant.js
│ │ ├── formVerify.js
│ │ ├── index.js
│ │ ├── lsUtils.js
│ │ ├── mixins.js
│ │ ├── regComponents.js
│ │ ├── uiUtils.js
│ │ └── utils.js
├── static
│ ├── .gitkeep
│ ├── 1.txt
│ ├── assets
│ │ ├── angular.jpg
│ │ ├── chkt.png
│ │ ├── edas.png
│ │ ├── element.png
│ │ ├── ios.png
│ │ ├── java.png
│ │ ├── javascript.jpg
│ │ ├── mobile.png
│ │ ├── qq.png
│ │ ├── qxglyy.png
│ │ ├── react.png
│ │ ├── sae.png
│ │ ├── swas.png
│ │ ├── vue.png
│ │ ├── webx.png
│ │ ├── wechat.png
│ │ ├── wlt.png
│ │ ├── wwafeb.png
│ │ ├── yytg.png
│ │ ├── yytj.png
│ │ └── 静态资源.md
│ ├── backup
│ │ ├── reportController2.ts
│ │ └── reportService2.ts
│ ├── dashb.png
│ └── vue-fabric.png
└── tsconfig.json
├── rebugger-embed
├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .postcssrc.js
├── LICENSE
├── README.md
├── build
│ ├── build.em.js
│ ├── build.js
│ ├── check-versions.js
│ ├── utils.js
│ ├── vue-loader.conf.js
│ ├── webpack.base.conf.js
│ ├── webpack.dev.conf.js
│ ├── webpack.em.conf.js
│ └── webpack.prod.conf.js
├── config
│ ├── dev.env.js
│ ├── index.js
│ └── prod.env.js
├── em
│ ├── config
│ │ └── index.js
│ ├── index.js
│ └── lib
│ │ ├── ajax.js
│ │ ├── common.js
│ │ ├── customFieldUtil.js
│ │ ├── lsUtils.js
│ │ ├── reportHandller.js
│ │ └── utils.js
├── index.html
├── lib
│ └── front_rebugger.min.js
├── package-lock.json
├── package.json
└── tsconfig.json
├── rebugger-schedule
├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .postcssrc.js
├── LICENSE
├── README.md
├── build
│ ├── build.em.js
│ ├── build.js
│ ├── build.lib.js
│ ├── check-versions.js
│ ├── utils.js
│ ├── vue-loader.conf.js
│ ├── webpack.base.conf.js
│ └── webpack.dev.conf.js
├── package-lock.json
├── package.json
├── server
│ ├── app.ts
│ ├── build
│ │ ├── app.js
│ │ ├── config
│ │ │ └── default.js
│ │ └── src
│ │ │ ├── module
│ │ │ └── system
│ │ │ │ ├── auth
│ │ │ │ ├── model
│ │ │ │ │ └── user.js
│ │ │ │ └── service
│ │ │ │ │ └── authService.js
│ │ │ │ └── user
│ │ │ │ ├── controller
│ │ │ │ └── userController.js
│ │ │ │ ├── schema
│ │ │ │ └── user.js
│ │ │ │ └── service
│ │ │ │ └── userService.js
│ │ │ ├── router
│ │ │ ├── index.js
│ │ │ ├── router.js
│ │ │ └── sample.js
│ │ │ └── utils
│ │ │ └── mysql.js
│ ├── config
│ │ └── default.ts
│ ├── public
│ │ ├── 1.txt
│ │ ├── SQL语句.txt
│ │ ├── front_logger_db.sql
│ │ ├── script.txt
│ │ └── static
│ │ │ └── app.css
│ └── src
│ │ ├── middleware
│ │ ├── check.ts
│ │ ├── error.ts
│ │ └── logger.ts
│ │ ├── module
│ │ ├── base
│ │ │ ├── controller
│ │ │ │ └── baseController.ts
│ │ │ ├── model
│ │ │ │ └── baseModel.ts
│ │ │ └── service
│ │ │ │ └── baseService.ts
│ │ ├── project
│ │ │ ├── controller
│ │ │ │ └── projectController.ts
│ │ │ ├── schema
│ │ │ │ └── projectSchema.ts
│ │ │ └── service
│ │ │ │ └── projectService.ts
│ │ └── system
│ │ │ ├── config
│ │ │ ├── controller
│ │ │ │ └── configController.ts
│ │ │ ├── schema
│ │ │ │ └── configSchema.ts
│ │ │ └── service
│ │ │ │ └── configService.ts
│ │ │ ├── menu
│ │ │ ├── controller
│ │ │ │ └── menuController.ts
│ │ │ ├── schema
│ │ │ │ └── menuSchema.ts
│ │ │ └── service
│ │ │ │ └── menuService.ts
│ │ │ ├── org
│ │ │ ├── controller
│ │ │ │ └── orgController.ts
│ │ │ ├── schema
│ │ │ │ └── orgSchema.ts
│ │ │ └── service
│ │ │ │ └── orgService.ts
│ │ │ ├── role
│ │ │ ├── controller
│ │ │ │ └── roleController.ts
│ │ │ ├── schema
│ │ │ │ ├── roleMenuSchema.ts
│ │ │ │ └── roleSchema.ts
│ │ │ └── service
│ │ │ │ └── roleService.ts
│ │ │ └── user
│ │ │ ├── controller
│ │ │ ├── bk.ts
│ │ │ └── userController.ts
│ │ │ ├── schema
│ │ │ ├── userRoleSchema.ts
│ │ │ └── userSchema.ts
│ │ │ └── service
│ │ │ ├── bk.ts
│ │ │ └── userService.ts
│ │ ├── router
│ │ ├── index.ts
│ │ └── sample.ts
│ │ └── utils
│ │ ├── cacheUtil.ts
│ │ ├── mysql.ts
│ │ ├── redis.js
│ │ └── redisUtil.ts
└── tsconfig.json
└── rebugger-service
├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .postcssrc.js
├── LICENSE
├── README.md
├── build
├── build.em.js
├── build.js
├── build.lib.js
├── check-versions.js
├── utils.js
├── vue-loader.conf.js
├── webpack.base.conf.js
└── webpack.dev.conf.js
├── package-lock.json
├── package.json
├── prod.config.js
├── server
├── app.ts
├── build
│ ├── app.js
│ ├── config
│ │ └── default.js
│ └── src
│ │ ├── middleware
│ │ ├── check.js
│ │ ├── error.js
│ │ └── logger.js
│ │ ├── module
│ │ ├── base
│ │ │ ├── controller
│ │ │ │ └── baseController.js
│ │ │ ├── model
│ │ │ │ └── baseModel.js
│ │ │ └── service
│ │ │ │ └── baseService.js
│ │ ├── comment
│ │ │ └── schema
│ │ │ │ └── commentSchema.js
│ │ ├── dashboard
│ │ │ ├── controller
│ │ │ │ └── dashboardController.js
│ │ │ └── service
│ │ │ │ └── dashboardService.js
│ │ ├── ipAuth
│ │ │ ├── controller
│ │ │ │ └── ipAuthController.js
│ │ │ ├── schema
│ │ │ │ └── ipAuthSchema.js
│ │ │ └── service
│ │ │ │ └── ipAuthService.js
│ │ ├── perform
│ │ │ └── schema
│ │ │ │ └── performSchema.js
│ │ ├── project
│ │ │ ├── controller
│ │ │ │ └── projectController.js
│ │ │ ├── schema
│ │ │ │ └── projectSchema.js
│ │ │ └── service
│ │ │ │ └── projectService.js
│ │ ├── report
│ │ │ ├── controller
│ │ │ │ └── reportController.js
│ │ │ ├── schema
│ │ │ │ └── reportSchema.js
│ │ │ └── service
│ │ │ │ └── reportService.js
│ │ └── system
│ │ │ ├── auth
│ │ │ ├── controller
│ │ │ │ └── authController.js
│ │ │ ├── model
│ │ │ │ └── user.js
│ │ │ └── service
│ │ │ │ └── authService.js
│ │ │ ├── config
│ │ │ ├── controller
│ │ │ │ └── configController.js
│ │ │ ├── schema
│ │ │ │ └── configSchema.js
│ │ │ └── service
│ │ │ │ └── configService.js
│ │ │ ├── dict
│ │ │ ├── controller
│ │ │ │ └── dictController.js
│ │ │ ├── schema
│ │ │ │ └── dictSchema.js
│ │ │ └── service
│ │ │ │ └── dictService.js
│ │ │ ├── menu
│ │ │ ├── controller
│ │ │ │ └── menuController.js
│ │ │ ├── schema
│ │ │ │ └── menuSchema.js
│ │ │ └── service
│ │ │ │ └── menuService.js
│ │ │ ├── org
│ │ │ ├── controller
│ │ │ │ └── orgController.js
│ │ │ ├── schema
│ │ │ │ └── orgSchema.js
│ │ │ └── service
│ │ │ │ └── orgService.js
│ │ │ ├── role
│ │ │ ├── controller
│ │ │ │ └── roleController.js
│ │ │ ├── schema
│ │ │ │ ├── roleMenuSchema.js
│ │ │ │ └── roleSchema.js
│ │ │ └── service
│ │ │ │ └── roleService.js
│ │ │ └── user
│ │ │ ├── controller
│ │ │ ├── bk.js
│ │ │ └── userController.js
│ │ │ ├── schema
│ │ │ ├── user.js
│ │ │ ├── userRoleSchema.js
│ │ │ └── userSchema.js
│ │ │ └── service
│ │ │ ├── bk.js
│ │ │ └── userService.js
│ │ ├── router
│ │ ├── index.js
│ │ ├── router.js
│ │ └── sample.js
│ │ └── utils
│ │ ├── cacheUtil.js
│ │ ├── mysql.js
│ │ ├── redis.js
│ │ └── redisUtil.js
├── config
│ └── default.ts
├── public
│ ├── 1.txt
│ ├── SQL语句.txt
│ ├── front_logger_db.sql
│ ├── script.txt
│ └── static
│ │ └── app.css
└── src
│ ├── middleware
│ ├── check.ts
│ ├── error.ts
│ └── logger.ts
│ ├── module
│ ├── base
│ │ ├── controller
│ │ │ └── baseController.ts
│ │ ├── model
│ │ │ └── baseModel.ts
│ │ └── service
│ │ │ └── baseService.ts
│ ├── comment
│ │ └── schema
│ │ │ └── commentSchema.ts
│ ├── dashboard
│ │ ├── controller
│ │ │ └── dashboardController.ts
│ │ └── service
│ │ │ └── dashboardService.ts
│ ├── ipAuth
│ │ ├── controller
│ │ │ └── ipAuthController.ts
│ │ ├── schema
│ │ │ └── ipAuthSchema.ts
│ │ └── service
│ │ │ └── ipAuthService.ts
│ ├── perform
│ │ └── schema
│ │ │ └── performSchema.ts
│ ├── project
│ │ ├── controller
│ │ │ └── projectController.ts
│ │ ├── schema
│ │ │ └── projectSchema.ts
│ │ └── service
│ │ │ └── projectService.ts
│ ├── report
│ │ ├── controller
│ │ │ └── reportController.ts
│ │ ├── schema
│ │ │ └── reportSchema.ts
│ │ └── service
│ │ │ └── reportService.ts
│ └── system
│ │ ├── auth
│ │ ├── controller
│ │ │ └── authController.ts
│ │ ├── model
│ │ │ └── user.ts
│ │ └── service
│ │ │ └── authService.ts
│ │ ├── config
│ │ ├── controller
│ │ │ └── configController.ts
│ │ ├── schema
│ │ │ └── configSchema.ts
│ │ └── service
│ │ │ └── configService.ts
│ │ ├── dict
│ │ ├── controller
│ │ │ └── dictController.ts
│ │ ├── schema
│ │ │ └── dictSchema.ts
│ │ └── service
│ │ │ └── dictService.ts
│ │ ├── menu
│ │ ├── controller
│ │ │ └── menuController.ts
│ │ ├── schema
│ │ │ └── menuSchema.ts
│ │ └── service
│ │ │ └── menuService.ts
│ │ ├── org
│ │ ├── controller
│ │ │ └── orgController.ts
│ │ ├── schema
│ │ │ └── orgSchema.ts
│ │ └── service
│ │ │ └── orgService.ts
│ │ ├── role
│ │ ├── controller
│ │ │ └── roleController.ts
│ │ ├── schema
│ │ │ ├── roleMenuSchema.ts
│ │ │ └── roleSchema.ts
│ │ └── service
│ │ │ └── roleService.ts
│ │ └── user
│ │ ├── controller
│ │ ├── bk.ts
│ │ └── userController.ts
│ │ ├── schema
│ │ ├── userRoleSchema.ts
│ │ └── userSchema.ts
│ │ └── service
│ │ ├── bk.ts
│ │ └── userService.ts
│ ├── router
│ ├── index.ts
│ └── sample.ts
│ └── utils
│ ├── cacheUtil.ts
│ ├── mysql.ts
│ ├── redis.ts
│ └── redisUtil.ts
├── test.config.js
└── tsconfig.json
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | static/assets/external/
4 | static/module/
5 | dist/
6 |
7 | npm-debug.log*
8 | yarn-debug.log*
9 | yarn-error.log*
10 |
11 | # Editor directories and files
12 | .idea
13 | .vscode
14 | *.suo
15 | *.ntvs*
16 | *.njsproj
17 | *.sln
18 |
--------------------------------------------------------------------------------
/rebugger-admin/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", {
4 | "modules": false,
5 | "targets": {
6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7 | }
8 | }],
9 | "stage-2"
10 | ],
11 | "plugins": ["transform-vue-jsx", "transform-runtime"]
12 | }
13 |
--------------------------------------------------------------------------------
/rebugger-admin/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/rebugger-admin/.eslintignore:
--------------------------------------------------------------------------------
1 | /build/
2 | /config/
3 | /dist/
4 | /*.js
5 |
--------------------------------------------------------------------------------
/rebugger-admin/.eslintrc.js:
--------------------------------------------------------------------------------
1 | // https://eslint.org/docs/user-guide/configuring
2 |
3 | module.exports = {
4 | root: true,
5 | parser: 'babel-eslint',
6 | parserOptions: {
7 | sourceType: 'module'
8 | },
9 | env: {
10 | browser: true
11 | },
12 | // https://github.com/standard/standard/blob/master/docs/RULES-en.md
13 | extends: 'standard',
14 | // required to lint *.vue files
15 | plugins: ['html'],
16 | // add your custom rules here
17 | rules: {
18 | // allow paren-less arrow functions
19 | 'arrow-parens': 0,
20 | // allow async-await
21 | 'generator-star-spacing': 0,
22 | // allow debugger during development
23 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
24 | semi: ['error', 'always'],
25 | 'no-unused-vars': 0,
26 | 'one-var': 0,
27 | eqeqeq: 'off',
28 | 'no-callback-literal': 0,
29 | 'standard/no-callback-literal': 0,
30 | "quotes": [1, "double"], //引号类型 `` "" ''
31 | "space-before-function-paren": [0, "always"] //函数定义时括号前面要不要有空格
32 | },
33 | globals: {
34 | requireModule: true
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/rebugger-admin/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | dist
4 |
5 | npm-debug.log*
6 | yarn-debug.log*
7 | yarn-error.log*
8 |
9 | # Editor directories and files
10 | .idea
11 | .vscode
12 | *.suo
13 | *.ntvs*
14 | *.njsproj
15 | *.sln
16 |
--------------------------------------------------------------------------------
/rebugger-admin/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-import": {},
6 | "postcss-url": {},
7 | // to edit target browsers: use "browserslist" field in package.json
8 | "autoprefixer": {}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/rebugger-admin/README.md:
--------------------------------------------------------------------------------
1 | # nine
2 |
3 | > A Vue.js project
4 |
5 | ## Build Setup
6 |
7 | ```bash
8 | # install dependencies
9 | npm install
10 |
11 | # serve with hot reload at localhost:8080
12 | npm run dev
13 |
14 | # build for production with minification
15 | npm run build
16 | ```
17 |
18 | For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).
19 |
--------------------------------------------------------------------------------
/rebugger-admin/build/build.em.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | require('./check-versions')();
3 |
4 | process.env.NODE_ENV = 'production';
5 |
6 | const ora = require('ora');
7 | const rm = require('rimraf');
8 | const path = require('path');
9 | const chalk = require('chalk');
10 | const webpack = require('webpack');
11 | const config = require('../config');
12 | const webpackConfig = require('./webpack.em.conf');
13 |
14 | const spinner = ora('building for production...');
15 | spinner.start();
16 |
17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18 | if (err) throw err;
19 | webpack(webpackConfig, (err, stats) => {
20 | spinner.stop();
21 | if (err) throw err;
22 | process.stdout.write(
23 | stats.toString({
24 | colors: true,
25 | modules: false,
26 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
27 | chunks: false,
28 | chunkModules: false
29 | }) + '\n\n'
30 | );
31 |
32 | if (stats.hasErrors()) {
33 | console.log(chalk.red(' Build failed with errors.\n'));
34 | process.exit(1);
35 | }
36 |
37 | console.log(chalk.cyan(' Build complete.\n'));
38 | console.log(
39 | chalk.yellow(
40 | ' Tip: built files are meant to be served over an HTTP server.\n' +
41 | " Opening index.html over file:// won't work.\n"
42 | )
43 | );
44 | });
45 | });
46 |
--------------------------------------------------------------------------------
/rebugger-admin/build/build.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | require('./check-versions')();
3 |
4 | process.env.NODE_ENV = 'production';
5 |
6 | const ora = require('ora');
7 | const rm = require('rimraf');
8 | const path = require('path');
9 | const chalk = require('chalk');
10 | const webpack = require('webpack');
11 | const config = require('../config');
12 | const webpackConfig = require('./webpack.prod.conf');
13 |
14 | const spinner = ora('building for production...');
15 | spinner.start();
16 |
17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18 | if (err) throw err;
19 | webpack(webpackConfig, (err, stats) => {
20 | spinner.stop();
21 | if (err) throw err;
22 | process.stdout.write(
23 | stats.toString({
24 | colors: true,
25 | modules: false,
26 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
27 | chunks: false,
28 | chunkModules: false
29 | }) + '\n\n'
30 | );
31 |
32 | if (stats.hasErrors()) {
33 | console.log(chalk.red(' Build failed with errors.\n'));
34 | process.exit(1);
35 | }
36 |
37 | console.log(chalk.cyan(' Build complete.\n'));
38 | console.log(
39 | chalk.yellow(
40 | ' Tip: built files are meant to be served over an HTTP server.\n' +
41 | " Opening index.html over file:// won't work.\n"
42 | )
43 | );
44 | });
45 | });
46 |
--------------------------------------------------------------------------------
/rebugger-admin/build/build.lib.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | require('./check-versions')();
3 |
4 | process.env.NODE_ENV = 'production';
5 |
6 | const ora = require('ora');
7 | const rm = require('rimraf');
8 | const path = require('path');
9 | const chalk = require('chalk');
10 | const webpack = require('webpack');
11 | const config = require('../config');
12 | const webpackConfig = require('./webpack.lib.conf');
13 |
14 | const spinner = ora('building for production...');
15 | spinner.start();
16 |
17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18 | if (err) throw err;
19 | webpack(webpackConfig, (err, stats) => {
20 | spinner.stop();
21 | if (err) throw err;
22 | process.stdout.write(
23 | stats.toString({
24 | colors: true,
25 | modules: false,
26 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
27 | chunks: false,
28 | chunkModules: false
29 | }) + '\n\n'
30 | );
31 |
32 | if (stats.hasErrors()) {
33 | console.log(chalk.red(' Build failed with errors.\n'));
34 | process.exit(1);
35 | }
36 |
37 | console.log(chalk.cyan(' Build complete.\n'));
38 | console.log(
39 | chalk.yellow(
40 | ' Tip: built files are meant to be served over an HTTP server.\n' +
41 | " Opening index.html over file:// won't work.\n"
42 | )
43 | );
44 | });
45 | });
46 |
--------------------------------------------------------------------------------
/rebugger-admin/build/check-versions.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const chalk = require('chalk')
3 | const semver = require('semver')
4 | const packageConfig = require('../package.json')
5 | const shell = require('shelljs')
6 |
7 | function exec (cmd) {
8 | return require('child_process').execSync(cmd).toString().trim()
9 | }
10 |
11 | const versionRequirements = [
12 | {
13 | name: 'node',
14 | currentVersion: semver.clean(process.version),
15 | versionRequirement: packageConfig.engines.node
16 | }
17 | ]
18 |
19 | if (shell.which('npm')) {
20 | versionRequirements.push({
21 | name: 'npm',
22 | currentVersion: exec('npm --version'),
23 | versionRequirement: packageConfig.engines.npm
24 | })
25 | }
26 |
27 | module.exports = function () {
28 | const warnings = []
29 |
30 | for (let i = 0; i < versionRequirements.length; i++) {
31 | const mod = versionRequirements[i]
32 |
33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
34 | warnings.push(mod.name + ': ' +
35 | chalk.red(mod.currentVersion) + ' should be ' +
36 | chalk.green(mod.versionRequirement)
37 | )
38 | }
39 | }
40 |
41 | if (warnings.length) {
42 | console.log('')
43 | console.log(chalk.yellow('To use this template, you must update following to modules:'))
44 | console.log()
45 |
46 | for (let i = 0; i < warnings.length; i++) {
47 | const warning = warnings[i]
48 | console.log(' ' + warning)
49 | }
50 |
51 | console.log()
52 | process.exit(1)
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/rebugger-admin/build/vue-loader.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const utils = require('./utils')
3 | const config = require('../config')
4 | const isProduction = process.env.NODE_ENV === 'production'
5 | const sourceMapEnabled = isProduction
6 | ? config.build.productionSourceMap
7 | : config.dev.cssSourceMap
8 |
9 | module.exports = {
10 | loaders: utils.cssLoaders({
11 | sourceMap: sourceMapEnabled,
12 | extract: isProduction
13 | }),
14 | cssSourceMap: sourceMapEnabled,
15 | cacheBusting: config.dev.cacheBusting,
16 | transformToRequire: {
17 | video: ['src', 'poster'],
18 | source: 'src',
19 | img: 'src',
20 | image: 'xlink:href'
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/rebugger-admin/config/dev.env.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | const merge = require("webpack-merge");
3 | const prodEnv = require("./prod.env");
4 |
5 | module.exports = merge(prodEnv, {
6 | NODE_ENV: '"development"'
7 | });
8 |
--------------------------------------------------------------------------------
/rebugger-admin/config/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | // Template version: 1.2.8
3 | // see http://vuejs-templates.github.io/webpack for documentation.
4 |
5 | const path = require('path');
6 |
7 | module.exports = {
8 | dev: {
9 | // assetsSubDirectory: '/',
10 | assetsSubDirectory: 'static',
11 | assetsPublicPath: '/',
12 | proxyTable: {},
13 | host: '127.0.0.1',
14 | port: 8090,
15 | autoOpenBrowser: false,
16 | errorOverlay: true,
17 | notifyOnErrors: true,
18 | poll: false,
19 | showEslintErrorsInOverlay: false,
20 | devtool: 'cheap-module-eval-source-map',
21 | cacheBusting: true,
22 | cssSourceMap: true,
23 | useEslint: false
24 | },
25 | build: {
26 | index: path.resolve(__dirname, '../dist/index.html'),
27 | env: require('./prod.env'),
28 | assetsRoot: path.resolve(__dirname, '../dist'),
29 | // assetsPublicPath: '/',
30 | assetsPublicPath: '/',
31 | assetsSubDirectory: 'static',
32 | // assetsSubDirectory: '/',
33 | productionSourceMap: true,
34 | // devtool: 'source-map',
35 | productionGzip: true,
36 | productionGzipExtensions: ['js', 'css'],
37 | bundleAnalyzerReport: false
38 | // bundleAnalyzerReport: process.env.npm_config_report
39 | }
40 | };
41 |
--------------------------------------------------------------------------------
/rebugger-admin/config/prod.env.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | module.exports = {
3 | NODE_ENV: '"production"'
4 | };
5 |
--------------------------------------------------------------------------------
/rebugger-admin/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/favicon.ico
--------------------------------------------------------------------------------
/rebugger-admin/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | logger
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/rebugger-admin/src/App.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
26 |
--------------------------------------------------------------------------------
/rebugger-admin/src/api/dashboard.js:
--------------------------------------------------------------------------------
1 | import {
2 | request
3 | } from './set-axios'
4 |
5 | export default {
6 | login: (params) => request('/api/login/sso', 'post', params)
7 | }
8 |
--------------------------------------------------------------------------------
/rebugger-admin/src/api/system.js:
--------------------------------------------------------------------------------
1 | import {
2 | request
3 | } from './set-axios'
4 |
5 | export default {
6 | login: (params) => request('/api/login/sso', 'post', params)
7 | }
8 |
--------------------------------------------------------------------------------
/rebugger-admin/src/assets/css/element-common.scss:
--------------------------------------------------------------------------------
1 | //当前模块级别全局样式
2 | .logger {
3 |
4 | .XXXpageName {
5 | .xxclass {
6 | font-size: 12px;
7 | }
8 | }
9 | }
10 | .el-menu.el-menu--popup{
11 | .el-menu-item{
12 | height: 40px;
13 | line-height: 40px;
14 | }
15 | }
--------------------------------------------------------------------------------
/rebugger-admin/src/assets/css/transition.scss:
--------------------------------------------------------------------------------
1 | /*
2 | * Description:动画CSS配置文件
3 | * Author:詹陈龙
4 | * Update:
5 | */
6 | //globl transition css
7 |
8 | /*fade*/
9 | .fade-enter-active,
10 | .fade-leave-active {
11 | transition: opacity 0.28s;
12 | }
13 |
14 | .fade-enter,
15 | .fade-leave-active {
16 | opacity: 0;
17 | }
18 |
19 | /*fade-transform*/
20 | .fade-transform-leave-active,
21 | .fade-transform-enter-active {
22 | transition: all .4s;
23 | }
24 | .fade-transform-enter {
25 | opacity: 0;
26 | transform: translateY(30px);
27 | }
28 | .fade-transform-leave-to {
29 | opacity: 0;
30 | transform: translateY(30px);
31 | }
32 |
33 |
34 |
35 | /*breadcrumb transition*/
36 | .breadcrumb-enter-active,
37 | .breadcrumb-leave-active {
38 | transition: all .5s;
39 | }
40 |
41 | .breadcrumb-enter,
42 | .breadcrumb-leave-active {
43 | opacity: 0;
44 | transform: translateX(20px);
45 | }
46 |
47 | .breadcrumb-move {
48 | transition: all .5s;
49 | }
50 |
51 | .breadcrumb-leave-active {
52 | position: absolute;
53 | }
54 |
55 |
--------------------------------------------------------------------------------
/rebugger-admin/src/assets/css/vars.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by 熊超超 on 2017/8/4.
3 | */
4 | $baseFontSize: 12px;
5 | $baseFontColor: #333333;
6 | $rem: 1px;
7 |
8 | $color-primary: #ec8d00;
9 | // $color-primary: #9F79EE;
10 | $color-success: #67C23A;
11 | $color-warning: #f39c12;
12 | $color-danger: #F56C6C;
13 | $color-info: #909399;
14 | $color-gray: #5a5a5a;
15 | $color-white: white;
16 | $color-black: black;
17 | $color-nodata: #909399;
18 | $bg: #ecf0f5;
19 | $bg0: mix($color-black, $color-primary, 80%);
20 | $bg-gray: #f6f6f6;
21 | $border-color: #ebebeb;
22 |
23 | $--border-color-base: #dcdfe6;
24 | $--color-text-placeholder: #c0c4cc;
25 |
26 | $l_fontsize:16px !default;
27 |
28 | $m_fontsize:14px !default;
29 |
30 | $s_fontsize:12px !default;
31 |
32 | $fontcolor: #8E6B19 !default;
33 |
34 | $focusfontcolor: #3C3C3C !default;
35 |
36 | $bg_color:#f90 !default;
37 | $fontfamily:'微软雅黑' !default;
38 | // $nav_bg_color:#414141;
39 | $nav_bg_color:#21376b;
--------------------------------------------------------------------------------
/rebugger-admin/src/assets/icons/icon.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by 熊超超 on 2018/4/25.
3 | */
4 |
5 | import Vue from 'vue'
6 | import SvgIcon from '../../components/base/DyIcon.vue'
7 |
8 | Vue.component('dy-icon', SvgIcon)
9 |
10 | const content = require.context('./svg', false, /\.svg$/)
11 |
12 | content.keys().map(content)
13 | export default content.keys()
14 |
--------------------------------------------------------------------------------
/rebugger-admin/src/assets/icons/svg/expand.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
--------------------------------------------------------------------------------
/rebugger-admin/src/assets/icons/svg/unexpand.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
--------------------------------------------------------------------------------
/rebugger-admin/src/assets/icons/svg/wenhao.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/rebugger-admin/src/assets/images/head.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/src/assets/images/head.jpg
--------------------------------------------------------------------------------
/rebugger-admin/src/assets/images/login-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/src/assets/images/login-bg.png
--------------------------------------------------------------------------------
/rebugger-admin/src/assets/images/login_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/src/assets/images/login_bg.png
--------------------------------------------------------------------------------
/rebugger-admin/src/assets/images/login_icon1_n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/src/assets/images/login_icon1_n.png
--------------------------------------------------------------------------------
/rebugger-admin/src/assets/images/login_icon2_n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/src/assets/images/login_icon2_n.png
--------------------------------------------------------------------------------
/rebugger-admin/src/assets/images/login_icon3_n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/src/assets/images/login_icon3_n.png
--------------------------------------------------------------------------------
/rebugger-admin/src/components/HelloWorld.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
{{ msg }}
4 |
5 |
6 |
7 |
15 |
16 |
17 |
33 |
--------------------------------------------------------------------------------
/rebugger-admin/src/components/TreeTable/eval.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @Author: ZhanChenLong
3 | * @Date: 2018-7-30 11:06:49
4 | */
5 | 'use strict'
6 | import Vue from 'vue'
7 | export default function treeToArray (data, expandAll, parent = null, level = null) {
8 | let tmp = []
9 | Array.from(data).forEach(function (record) {
10 | if (record._expanded === undefined) {
11 | Vue.set(record, '_expanded', expandAll)
12 | }
13 | let _level = 1
14 | if (level !== undefined && level !== null) {
15 | _level = level + 1
16 | }
17 | Vue.set(record, '_level', _level)
18 | // 如果有父元素
19 | if (parent) {
20 | Vue.set(record, 'parent', parent)
21 | }
22 | tmp.push(record)
23 | if (record.children && record.children.length > 0) {
24 | const children = treeToArray(record.children, expandAll, record, _level)
25 | tmp = tmp.concat(children)
26 | }
27 | })
28 | return tmp
29 | }
30 |
--------------------------------------------------------------------------------
/rebugger-admin/src/components/base/DyButton.vue:
--------------------------------------------------------------------------------
1 | /* eslint-disable quotes */
2 |
3 |
4 |
10 |
11 |
12 | {{ text }}
13 |
14 |
15 |
16 |
17 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/rebugger-admin/src/components/base/DyCheckboxGroup.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 | {{ option.label }}
17 |
18 |
19 | {{ option.label }}
27 |
28 |
29 |
30 |
31 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/rebugger-admin/src/components/base/DyIcon.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
13 |
48 |
49 |
58 |
--------------------------------------------------------------------------------
/rebugger-admin/src/components/base/DyInputNumber.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/rebugger-admin/src/components/base/DySelect.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
16 |
17 |
18 |
19 |
53 |
54 |
59 |
--------------------------------------------------------------------------------
/rebugger-admin/src/config/index.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Description:配置文件
3 | * Author:詹陈龙
4 | * Update:2018-08-06
5 | */
6 | // 基础Url配置
7 | let url = process.env.VUE_APP_BASE_URL || "http://127.0.0.1:9090";
8 |
9 | let domain = document.domain,
10 | protocol = window.location.protocol;
11 |
12 | switch (domain) {
13 | case '127.0.0.1':
14 | case 'localhost':
15 | url = "http://127.0.0.1:9090";
16 | break;
17 | case "rebuggertest.xxxxxx.com":
18 | url = protocol + "//apirebuggertest.xxxxxx.com";
19 | break;
20 | case "rebuggerdev.xxxxxx.com":
21 | url = protocol + "//apirebuggerdev.xxxxxx.com";
22 | break;
23 | case "rebuggerpre.xxxxxx.com":
24 | url = protocol + "//apirebuggerpre.xxxxxx.com";
25 | break;
26 | case "rebugger.xxxxxx.com":
27 | url = protocol + "//apirebugger.xxxxxx.com";
28 | break;
29 | default:
30 | break;
31 | }
32 | console.log(url);
33 |
34 | // 图表库配置
35 | const iconList = [
36 | "iconfont icon-dashboard",
37 | "iconfont icon-location-fill",
38 | "iconfont icon-fa-codepen",
39 | "iconfont icon-security",
40 | "iconfont icon-fa-columns",
41 | "iconfont icon-Afa-cog",
42 | "iconfont icon-fa-video-camera",
43 | "iconfont icon-gongnengdingyi",
44 | "iconfont icon-jichuguanli",
45 | "iconfont icon-tianshenpi",
46 | "iconfont icon-shujukanban",
47 | "iconfont icon-shujukanban",
48 | "iconfont icon-shujuwajue",
49 | "iconfont icon-iframetianjia",
50 | "iconfont icon-home",
51 | "el-icon-menu"
52 | ];
53 |
54 | export { url, iconList };
55 |
--------------------------------------------------------------------------------
/rebugger-admin/src/main.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable quotes */
2 | import Vue from "vue";
3 | import App from "./App.vue";
4 | import router from "./router";
5 | import store from "./store";
6 | import echarts from "echarts";
7 | import ElementUI from "element-ui";
8 | import formVerify from "./utils/formVerify";
9 | import NProgress from "nprogress";
10 | import "nprogress/nprogress.css";
11 | import JsonViewer from "vue-json-viewer";
12 | import "default-passive-events"; // 去 Added non-passive event listener to a scroll-blocking。。。的警告
13 |
14 | import regComponents from "./utils/regComponents.js";
15 | import "flex.css";
16 | import "./assets/css/base.scss";
17 | import utils from "./utils";
18 | import "./assets/icons/icon";
19 | Vue.prototype.$echarts = echarts;
20 | Vue.use(JsonViewer);
21 |
22 | Vue.use(ElementUI, {
23 | size: "small"
24 | });
25 | Vue.use(formVerify);
26 | Vue.use(regComponents);
27 | Vue.use(utils);
28 |
29 | NProgress.configure({ showSpinner: false });
30 |
31 | router.beforeEach((to, from, next) => {
32 | let token = sessionStorage.getItem("token");
33 | let user = localStorage.getItem("user");
34 | NProgress.start();
35 | if (to.path == "/login") {
36 | window.localStorage.removeItem("user");
37 | window.sessionStorage.clear();
38 | store.commit("clearUserInfo", {});
39 | // 清除所有tab缓存
40 | store.commit("clearTabs", "all");
41 | next();
42 | } else {
43 | // if (!token || !user) {
44 | if (token && user) {
45 | // store.commit('updateLoginTokenCPM', token);
46 | // store.commit('updateLoginUserCPM', JSON.parse(user));
47 | // setGlobalTopNavs(to, next);
48 | next();
49 | } else {
50 | next({
51 | path: "/login"
52 | });
53 | }
54 | // } else {
55 | // next();
56 | // }
57 | }
58 | next();
59 | });
60 |
61 | router.afterEach(transition => {
62 | setTimeout(() => {
63 | NProgress.done();
64 | }, 200);
65 | });
66 |
67 | Vue.config.productionTip = false;
68 |
69 | new Vue({
70 | router,
71 | store,
72 | render: h => h(App)
73 | }).$mount("#app");
74 |
--------------------------------------------------------------------------------
/rebugger-admin/src/mixins/baseMixins.js:
--------------------------------------------------------------------------------
1 | export default {
2 | baseMixin: {
3 | data() {
4 | return {
5 | loading: false,
6 | modelLoading: false
7 | };
8 | }
9 | },
10 | pageMixin: {
11 | data() {
12 | return {
13 | pageSizes: [1, 10, 20, 50, 100],
14 | layout: "total, prev, pager, next, jumper",
15 | pageSize: 10,
16 | pageNum: 1,
17 | rows: [],
18 | total: 0,
19 | selectedRows: [],
20 | currentRow: null,
21 | pageNumName: "pageNum"
22 | };
23 | },
24 | computed: {
25 | pageParams() {
26 | return {
27 | pageSize: this.pageSize,
28 | [this.pageNumName]: this.pageNum
29 | };
30 | }
31 | },
32 | created() {},
33 | mounted() {
34 | // console.log("mounted");
35 | this.getData();
36 | },
37 | methods: {
38 | // pageNum改变的时候的事件
39 | pageNumChange(pageNum) {
40 | this.pageNum = pageNum;
41 | this.getData();
42 | },
43 | // pageSize改变的时候的事件
44 | pageSizeChange(pageSize) {
45 | this.pageSize = pageSize;
46 | this.getData();
47 | },
48 | setPageData(data) {
49 | if (data) {
50 | this.total = data.total;
51 | this.rows = data.records;
52 | } else {
53 | this.total = 0;
54 | this.rows = [];
55 | }
56 | }
57 | }
58 | }
59 | };
60 |
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/chart/router.js:
--------------------------------------------------------------------------------
1 | export default [{
2 | path: '/chart',
3 | name: 'chart',
4 | component: () => import(/* webpackChunkName: "system" */ './view/engChart.vue')
5 | }]
6 |
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/common/router.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/src/modules/common/router.js
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/dashboard/api.js:
--------------------------------------------------------------------------------
1 | import { request } from "../../api/set-axios";
2 |
3 | export default {
4 | // 登录
5 | fetchDashboardStatInfo: params => request("/api/dashboard/statInfo", "post", params)
6 | };
7 |
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/dashboard/fragment/pannel.vue:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
63 |
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/dashboard/fragment/statPannel.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 今日数据
7 |
8 |
9 | {{statInfo.dayTotal || 0}}
10 |
11 |
12 |
13 |
14 | 日志数据
15 |
16 |
17 | {{statInfo.infoTotal || 0}}
18 |
19 |
20 |
21 |
22 | 异常数据
23 |
24 |
25 | {{statInfo.errorTotal || 0}}
26 |
27 |
28 |
29 |
30 | 日志总量
31 |
32 |
33 | {{statInfo.total || 0}}
34 |
35 |
36 |
37 |
38 |
39 |
40 |
66 |
67 |
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/dashboard/router.js:
--------------------------------------------------------------------------------
1 | import Dashboard from './view/Dashboard.vue'
2 |
3 | export default [{
4 | path: '/home',
5 | name: 'home',
6 | component: Dashboard
7 | }]
8 |
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/dashboard/vuex.js:
--------------------------------------------------------------------------------
1 | import api from '../../api/dashboard'
2 |
3 | const state = {}
4 | const mutations = {}
5 |
6 | const actions = {
7 | getWarehousingNo (context, params) {
8 | return api.getWarehousingNo()
9 | }
10 | }
11 |
12 | export default {
13 | state,
14 | mutations,
15 | actions
16 | }
17 |
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/project/api.js:
--------------------------------------------------------------------------------
1 | import { request } from "../../api/set-axios";
2 |
3 | export default {
4 | // 登录
5 | fetchProjectList: params => request("/api/project/list", "post", params),
6 | fetchProjectById: params => request("/api/project/info", "post", params),
7 | createOrUpdateProject: params => request("/api/project/createOrUpdate", "post", params),
8 | deleteProject: params => request("/api/project/delete", "post", params)
9 | };
10 |
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/project/router.js:
--------------------------------------------------------------------------------
1 | import project from "./view/project.vue";
2 | import editProject from "./view/editProject.vue";
3 |
4 | export default [
5 | {
6 | path: "/project/list",
7 | name: "project",
8 | component: project
9 | },
10 | {
11 | path: "/project/edit/:id",
12 | name: "editProject",
13 | meta: [
14 | { name: "项目管理", url: "/department" },
15 | { name: "编辑项目", url: "" }
16 | ],
17 | component: editProject
18 | }
19 | ];
20 |
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/project/vuex.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/src/modules/project/vuex.js
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/public/api.js:
--------------------------------------------------------------------------------
1 | import { request } from "../../api/set-axios";
2 |
3 | export default {
4 | // 登录
5 | login: params => request("/api/auth/login", "post", params)
6 | };
7 |
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/public/router.js:
--------------------------------------------------------------------------------
1 | import Login from './view/Login.vue'
2 |
3 | export default [{
4 | path: '/login',
5 | name: 'login',
6 | component: Login
7 | }]
8 |
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/public/vuex.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/src/modules/public/vuex.js
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/report/api.js:
--------------------------------------------------------------------------------
1 | import { request } from "../../api/set-axios";
2 |
3 | export default {
4 | // 登录
5 | fetchReportList: params => request("/api/report/list", "post", params),
6 | fetchReportById: params => request("/api/report/info", "post", params),
7 | updateReport: params => request("/api/report/update", "post", params),
8 | deleteReport: params => request("/api/report/delete", "post", params),
9 | resolveStatus: params => request("/api/report/resolveStatus", "post", params),
10 | fetchResolveList: params => request("/api/report/resolveList", "post", params)
11 | };
12 |
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/report/router.js:
--------------------------------------------------------------------------------
1 | import reportList from "./view/reportList.vue";
2 | import reportInfo from "./view/reportInfo.vue";
3 |
4 | export default [
5 | {
6 | path: "/report/errorInfo",
7 | name: "report",
8 | component: reportList
9 | },
10 | {
11 | path: "/report/errorInfo/tab/:activeTab",
12 | name: "reportTab",
13 | meta: [
14 | { name: "日志管理", url: "/report/errorInfo" },
15 | { name: "项目日志", url: "" }
16 | ],
17 | component: reportList
18 | },
19 | {
20 | path: "/report/errorInfo/projectCode/:code",
21 | name: "reportCode",
22 | meta: [
23 | { name: "日志管理", url: "/report/errorInfo" },
24 | { name: "项目日志", url: "" }
25 | ],
26 | component: reportList
27 | },
28 | {
29 | path: "/report/info/:id",
30 | name: "reportInfo",
31 | meta: [
32 | { name: "日志管理", url: "/report/errorInfo" },
33 | { name: "日志详情", url: "" }
34 | ],
35 | component: reportInfo
36 | }
37 | // {
38 | // path: "/project/edit/:id",
39 | // name: "editProject",
40 | // meta: [
41 | // { name: "项目管理", url: "/department" },
42 | // { name: "编辑项目", url: "" }
43 | // ],
44 | // component: editProject
45 | // }
46 | ];
47 |
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/report/vuex.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/src/modules/report/vuex.js
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/stat/api.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/src/modules/stat/api.js
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/stat/router.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/src/modules/stat/router.js
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/stat/view/broswerStat.vue:
--------------------------------------------------------------------------------
1 | /*
2 | * Description:浏览器信息统计
3 | * Author:
4 | * Update:
5 | */
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/stat/view/deviceStat.vue:
--------------------------------------------------------------------------------
1 | /*
2 | * Description:设备和操作系统统计
3 | * Author:
4 | * Update:
5 | */
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/stat/view/regionStat.vue:
--------------------------------------------------------------------------------
1 | /*
2 | * Description: 地区统计
3 | * Author:
4 | * Update:
5 | */
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/stat/vuex.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/src/modules/stat/vuex.js
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/system/api.js:
--------------------------------------------------------------------------------
1 | import { request } from "../../api/set-axios";
2 |
3 | export default {
4 | fetchUserList: params => request("/api/user/list", "post", params),
5 | fetchUserById: params => request("/api/user/info", "post", params),
6 | createOrUpdateUser: params => request("/api/user/createOrUpdate", "post", params),
7 | deleteUser: params => request("/api/user/delete", "post", params),
8 | updatePassword: params => request("/api/user/updatePassword", "post", params)
9 | };
10 |
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/system/router.js:
--------------------------------------------------------------------------------
1 | export default [{
2 | path: '/user',
3 | name: 'user',
4 | component: () => import(/* webpackChunkName: "system" */ './view/User.vue')
5 | }, {
6 | path: '/role',
7 | name: 'role',
8 | component: () => import(/* webpackChunkName: "system" */ './view/Role.vue')
9 | }, {
10 | path: '/dept',
11 | name: 'dept',
12 | component: () => import(/* webpackChunkName: "system" */ './view/Dept.vue')
13 | }, {
14 | path: '/menu',
15 | name: 'menu',
16 | component: () => import(/* webpackChunkName: "system" */ './view/Menu.vue')
17 | }]
18 |
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/system/view/dept-list.json:
--------------------------------------------------------------------------------
1 | [{
2 | "deptId": 1,
3 | "parentId": 0,
4 | "name": "xxx集团",
5 | "parentName": null,
6 | "orderNum": 0,
7 | "delFlag": 0,
8 | "open": null,
9 | "list": null
10 | }, {
11 | "deptId": 2,
12 | "parentId": 1,
13 | "name": "长沙分公司",
14 | "parentName": "xxx集团",
15 | "orderNum": 1,
16 | "delFlag": 0,
17 | "open": null,
18 | "list": null
19 | }, {
20 | "deptId": 3,
21 | "parentId": 1,
22 | "name": "上海分公司",
23 | "parentName": "xxx集团",
24 | "orderNum": 2,
25 | "delFlag": 0,
26 | "open": null,
27 | "list": null
28 | }, {
29 | "deptId": 4,
30 | "parentId": 3,
31 | "name": "技术部",
32 | "parentName": "上海分公司",
33 | "orderNum": 0,
34 | "delFlag": 0,
35 | "open": null,
36 | "list": null
37 | }, {
38 | "deptId": 5,
39 | "parentId": 3,
40 | "name": "销售部",
41 | "parentName": "上海分公司",
42 | "orderNum": 1,
43 | "delFlag": 0,
44 | "open": null,
45 | "list": null
46 | }, {
47 | "deptId": 6,
48 | "parentId": 1,
49 | "name": "我的部门",
50 | "parentName": "xxx集团",
51 | "orderNum": 0,
52 | "delFlag": 0,
53 | "open": null,
54 | "list": null
55 | }]
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/system/view/dept-select.json:
--------------------------------------------------------------------------------
1 | {
2 | "msg": "success",
3 | "code": 0,
4 | "deptList": [{
5 | "deptId": 1,
6 | "parentId": 0,
7 | "name": "xxx集团",
8 | "parentName": null,
9 | "orderNum": 0,
10 | "delFlag": 0,
11 | "open": null,
12 | "list": null
13 | }, {
14 | "deptId": 2,
15 | "parentId": 1,
16 | "name": "长沙分公司",
17 | "parentName": "xxx集团",
18 | "orderNum": 1,
19 | "delFlag": 0,
20 | "open": null,
21 | "list": null
22 | }, {
23 | "deptId": 3,
24 | "parentId": 1,
25 | "name": "上海分公司",
26 | "parentName": "xxx集团",
27 | "orderNum": 2,
28 | "delFlag": 0,
29 | "open": null,
30 | "list": null
31 | }, {
32 | "deptId": 4,
33 | "parentId": 3,
34 | "name": "技术部",
35 | "parentName": "上海分公司",
36 | "orderNum": 0,
37 | "delFlag": 0,
38 | "open": null,
39 | "list": null
40 | }, {
41 | "deptId": 5,
42 | "parentId": 3,
43 | "name": "销售部",
44 | "parentName": "上海分公司",
45 | "orderNum": 1,
46 | "delFlag": 0,
47 | "open": null,
48 | "list": null
49 | }, {
50 | "deptId": 6,
51 | "parentId": 1,
52 | "name": "我的部门",
53 | "parentName": "xxx集团",
54 | "orderNum": 0,
55 | "delFlag": 0,
56 | "open": null,
57 | "list": null
58 | }, {
59 | "deptId": 0,
60 | "parentId": -1,
61 | "name": "一级部门",
62 | "parentName": null,
63 | "orderNum": null,
64 | "delFlag": null,
65 | "open": true,
66 | "list": null
67 | }]
68 | }
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/system/view/role-info.json:
--------------------------------------------------------------------------------
1 | {"msg":"success","code":0,"role":{"roleId":1,"roleName":"普通员工","remark":"普通员工","deptId":1,"deptName":null,"menuIdList":[42,4,23,24,25,26,6,7,8,9,10,11,12,13,14,27,30,36,37,38,39,40,46,2,15,16,17,18,51,3,19,20,21,22,31,32,33,34,35,47,5,29,55,41,62,66,58,56,59,60,-666666,48,61],"deptIdList":[1,2,3,4,5,-666666],"createTime":"2018-10-26 08:56:49"}}
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/system/view/role-list.json:
--------------------------------------------------------------------------------
1 | {"code":0,"count":1,"data":[{"roleId":1,"roleName":"普通员工","remark":"普通员工","deptId":1,"deptName":"XX集团","menuIdList":null,"deptIdList":null,"createTime":"2018-10-26 08:56:49"}]}
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/system/view/user-info.json:
--------------------------------------------------------------------------------
1 | {"msg":"success","code":0,"user":{"userId":1,"username":"admin","salt":"YzcmCZNvbXocrsz9dm8e","email":"root@renren.io","mobile":"13612345678","status":1,"roleIdList":[],"createTime":"2016-11-11 11:11:11","deptId":1,"deptName":null}}
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/system/view/user-list.json:
--------------------------------------------------------------------------------
1 | {
2 | "code": 0,
3 | "count": 2,
4 | "data": [{
5 | "userId": 1,
6 | "username": "admin",
7 | "salt": "YzcmCZNvbXocrsz9dm8e",
8 | "email": "root@renren.io",
9 | "mobile": "13612345678",
10 | "status": 1,
11 | "roleIdList": null,
12 | "createTime": "2016-11-11 11:11:11",
13 | "deptId": 1,
14 | "deptName": "XXX集团"
15 | }, {
16 | "userId": 2,
17 | "username": "pure",
18 | "salt": "zLmvb0wWCYDo6Lbjq3Dt",
19 | "email": "5223802456@qq.com",
20 | "mobile": "18819640516",
21 | "status": 1,
22 | "roleIdList": null,
23 | "createTime": "2018-10-26 08:57:36",
24 | "deptId": 1,
25 | "deptName": "XXXX集团"
26 | }]
27 | }
--------------------------------------------------------------------------------
/rebugger-admin/src/modules/system/vuex.js:
--------------------------------------------------------------------------------
1 | import api from '../../api/dashboard'
2 |
3 | const state = {}
4 | const mutations = {}
5 |
6 | const actions = {
7 | getWarehousingNo (context, params) {
8 | return api.getWarehousingNo()
9 | }
10 | }
11 |
12 | export default {
13 | state,
14 | mutations,
15 | actions
16 | }
17 |
--------------------------------------------------------------------------------
/rebugger-admin/src/router.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable quotes */
2 | import Vue from "vue";
3 | import Router from "vue-router";
4 | // import Home from './views/Home.vue'
5 | import MainLayout from "./modules/common/view/MainLayout.vue";
6 | import Page404 from "./modules/common/view/Page404.vue";
7 | import dashboard from "./modules/dashboard/router.js";
8 | import system from "./modules/system/router";
9 | import publicRouter from "./modules/public/router";
10 | import chart from "./modules/chart/router";
11 | import projectRouter from "./modules/project/router";
12 | import reportRouter from './modules/report/router';
13 |
14 | // 全局处理异常 this.$router.push('/home') 出现 NavigationDuplicated 的bug
15 | const originalPush = Router.prototype.push;
16 | Router.prototype.push = function push(location, onResolve, onReject) {
17 | if (onResolve || onReject){
18 | return originalPush.call(this, location, onResolve, onReject);
19 | }
20 | return originalPush.call(this, location).catch(err => err);
21 | };
22 |
23 | Vue.use(Router);
24 |
25 | export default new Router({
26 | mode: "history",
27 | base: process.env.BASE_URL,
28 | routes: [
29 | ...publicRouter,
30 | {
31 | path: "/",
32 | component: MainLayout,
33 | children: [...dashboard, ...system, ...chart, ...projectRouter, ...reportRouter]
34 | },
35 | // {
36 | // path: '/about',
37 | // name: 'about',
38 | // // route level code-splitting
39 | // // this generates a separate chunk (about.[hash].js) for this route
40 | // // which is lazy-loaded when the route is visited.
41 | // component: () => import(/* webpackChunkName: "about" */ './views/About.vue')
42 | // },
43 | {
44 | path: "*",
45 | component: Page404
46 | }
47 | ]
48 | });
49 |
--------------------------------------------------------------------------------
/rebugger-admin/src/store.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable quotes */
2 | import Vue from "vue";
3 | import Vuex from "vuex";
4 | import createPersistedState from "vuex-persistedstate";
5 |
6 | import defaultStore from './modules/common/vuex'
7 | import dashboardStore from './modules/dashboard/vuex'
8 | Vue.use(Vuex);
9 |
10 | const store = new Vuex.Store({
11 | modules: {
12 | default: defaultStore,
13 | dashboard: dashboardStore
14 | },
15 | plugins: [
16 | createPersistedState({
17 | storage: window.localStorage,
18 | reducer: state => ({
19 | default: {
20 | userInfo: state.default.userInfo,
21 | menus: state.default.menus,
22 | menuTabs: state.default.menuTabs,
23 | selectedTab: state.default.selectedTab,
24 | noMenuTabsMap: state.default.noMenuTabsMap
25 | // allAreas: state.default.allAreas
26 | }
27 | })
28 | })
29 | ]
30 | });
31 |
32 | export default store;
33 |
--------------------------------------------------------------------------------
/rebugger-admin/src/utils/formVerify.js:
--------------------------------------------------------------------------------
1 | import elementUIVerify from 'element-ui-verify'
2 | export default {
3 | install (Vue) {
4 | Vue.use(elementUIVerify, {
5 | errorMessageTemplate: {
6 | empty: '{alias}不能为空',
7 | length: '{alias}的长度必须为{length}',
8 | maxLength: '{alias}的长度不能超过{maxLength}',
9 | minLength: '{alias}的长度不能少于{minLength}',
10 | number: '{alias}必须为数字',
11 | int: '{alias}必须为整数',
12 | lt: '{alias}必须为小于{lt}的数字',
13 | lte: '{alias}必须为不大于{lte}的数字',
14 | gt: '{alias}必须为大于{gt}的数字',
15 | gte: '{alias}必须为不小于{gte}的数字',
16 | maxDecimalLength: '{alias}必须为小数位不大于{maxDecimalLength}的数字',
17 | phone: '{alias}必须为正确的手机号',
18 | email: '{alias}必须为正确的邮箱',
19 | verifyCode: '{alias}必须为正确的验证码',
20 | password: '{alias}必须包含大小写字母和数字'
21 | }
22 | })
23 | // 增加自定义校验规则
24 | // https://github.com/aweiu/element-ui-verify
25 | // 最大长度
26 | elementUIVerify.addRule('maxLength', maxLength => ({
27 | validator (rule, val, callback) {
28 | if ((val + '').length > maxLength) {
29 | const errorMessage = elementUIVerify.getErrorMessage(
30 | 'maxLength',
31 | maxLength
32 | )
33 | callback(Error(errorMessage))
34 | } else {
35 | callback()
36 | }
37 | }
38 | }))
39 | elementUIVerify.addRule('password', () => ({
40 | validator (rule, val, callback) {
41 | if (
42 | !/.*[A-Z]+.*/.test(val) ||
43 | !/.*[a-z]+.*/.test(val) ||
44 | !/.*\d+.*/.test(val)
45 | ) {
46 | const errorMessage = elementUIVerify.getErrorMessage('password')
47 | callback(Error(errorMessage))
48 | } else {
49 | callback()
50 | }
51 | }
52 | }))
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/rebugger-admin/src/utils/index.js:
--------------------------------------------------------------------------------
1 | import constant from "./constant";
2 | import ls from "./lsUtils";
3 | import utils from "./uiUtils";
4 | import axios from "axios";
5 | import * as config from "../config/index";
6 |
7 | export default {
8 | install (Vue, $i18n) {
9 | Vue.prototype.$axios = axios;
10 | Vue.prototype.$bus = utils.bus;
11 | Vue.prototype.$c = constant;
12 | Vue.prototype.$ls = ls;
13 | Vue.prototype.$utils = utils;
14 | Vue.prototype.$config = config;
15 |
16 | // 权限检查方法
17 | Vue.prototype.$_has = function (value) {
18 | // debugger
19 | console.log(value);
20 | let isExist = false;
21 | let buttonpermsStr = sessionStorage.getItem("buttenpremissions");
22 | if (buttonpermsStr === undefined || buttonpermsStr == null) {
23 | return false;
24 | }
25 | let buttonperms = JSON.parse(buttonpermsStr);
26 | for (let i = 0; i < buttonperms.length; i++) {
27 | if (buttonperms[i].perms.indexOf(value) > -1) {
28 | isExist = true;
29 | break;
30 | }
31 | }
32 | return isExist;
33 | };
34 |
35 | /** 权限指令**/
36 | Vue.directive("auth", {
37 | bind: function (el, binding) {
38 | if (!Vue.prototype.$_has(binding.value)) {
39 | el.parentNode.removeChild(el);
40 | }
41 | }
42 | });
43 | }
44 | };
45 |
--------------------------------------------------------------------------------
/rebugger-admin/src/utils/lsUtils.js:
--------------------------------------------------------------------------------
1 |
2 | export class LsUtils {
3 | set (key, val) {
4 | if (typeof val === 'object') {
5 | val = JSON.stringify(val)
6 | }
7 | localStorage.setItem(key, val)
8 | }
9 | get (key, defaultVal = '') {
10 | return localStorage.getItem(key) || defaultVal
11 | }
12 | getObj (key, defaultVal) {
13 | const val = this.get(key, null)
14 | if (val) {
15 | return JSON.parse(val)
16 | }
17 | return defaultVal || null
18 | }
19 | remove (key) {
20 | localStorage.removeItem(key)
21 | }
22 | }
23 | export default new LsUtils()
24 |
--------------------------------------------------------------------------------
/rebugger-admin/src/utils/regComponents.js:
--------------------------------------------------------------------------------
1 | import DyTable from "../components/base/DyTable.vue";
2 | import EditModel from "../components/base/EditModel.vue";
3 | import DyForm from "../components/base/DyForm.vue";
4 | import TreeTable from "../components/TreeTable/TreeTable.vue";
5 | import DyFormItem from "../components/base/DyFormItem.vue";
6 | import utils from "./uiUtils";
7 | import constant from "./constant";
8 | import "../assets/css/element-common.scss";
9 |
10 | import VueProgressBar from "vue-progressbar";
11 |
12 | export default {
13 | install(Vue) {
14 | Vue.prototype.$utils = utils;
15 | Vue.prototype.$to = utils.to;
16 | Vue.prototype.$c = constant;
17 |
18 | Vue.component("dy-table", DyTable);
19 | Vue.component(EditModel.name, EditModel);
20 | Vue.component("dy-form", DyForm);
21 | Vue.component(TreeTable.name, TreeTable);
22 | Vue.component("dy-form-item", DyFormItem);
23 |
24 | Vue.use(VueProgressBar, {
25 | color: "#93ccf8",
26 | failedColor: "#F56C6C"
27 | });
28 | }
29 | };
30 |
--------------------------------------------------------------------------------
/rebugger-admin/static/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/.gitkeep
--------------------------------------------------------------------------------
/rebugger-admin/static/1.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/angular.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/angular.jpg
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/chkt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/chkt.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/edas.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/edas.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/element.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/element.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/ios.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/ios.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/java.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/java.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/javascript.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/javascript.jpg
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/mobile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/mobile.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/qq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/qq.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/qxglyy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/qxglyy.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/react.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/react.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/sae.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/sae.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/swas.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/swas.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/vue.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/vue.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/webx.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/webx.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/wechat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/wechat.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/wlt.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/wlt.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/wwafeb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/wwafeb.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/yytg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/yytg.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/yytj.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/yytj.png
--------------------------------------------------------------------------------
/rebugger-admin/static/assets/静态资源.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/assets/静态资源.md
--------------------------------------------------------------------------------
/rebugger-admin/static/dashb.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/dashb.png
--------------------------------------------------------------------------------
/rebugger-admin/static/vue-fabric.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-admin/static/vue-fabric.png
--------------------------------------------------------------------------------
/rebugger-embed/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", {
4 | "modules": false,
5 | "targets": {
6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7 | }
8 | }],
9 | "stage-2"
10 | ],
11 | "plugins": ["transform-vue-jsx", "transform-runtime"]
12 | }
13 |
--------------------------------------------------------------------------------
/rebugger-embed/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/rebugger-embed/.eslintignore:
--------------------------------------------------------------------------------
1 | /build/
2 | /config/
3 | /dist/
4 | /*.js
5 |
--------------------------------------------------------------------------------
/rebugger-embed/.eslintrc.js:
--------------------------------------------------------------------------------
1 | // https://eslint.org/docs/user-guide/configuring
2 |
3 | module.exports = {
4 | root: true,
5 | parser: 'babel-eslint',
6 | parserOptions: {
7 | sourceType: 'module'
8 | },
9 | env: {
10 | browser: true
11 | },
12 | // https://github.com/standard/standard/blob/master/docs/RULES-en.md
13 | extends: 'standard',
14 | // required to lint *.vue files
15 | plugins: ['html'],
16 | // add your custom rules here
17 | rules: {
18 | // allow paren-less arrow functions
19 | 'arrow-parens': 0,
20 | // allow async-await
21 | 'generator-star-spacing': 0,
22 | // allow debugger during development
23 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
24 | semi: ['error', 'always'],
25 | 'no-unused-vars': 0,
26 | 'one-var': 0,
27 | eqeqeq: 'off',
28 | 'no-callback-literal': 0,
29 | 'standard/no-callback-literal': 0,
30 | "quotes": [1, "double"], //引号类型 `` "" ''
31 | "space-before-function-paren": [0, "always"] //函数定义时括号前面要不要有空格
32 | },
33 | globals: {
34 | requireModule: true
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/rebugger-embed/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | static/assets/external/
4 | static/module/
5 |
6 | npm-debug.log*
7 | yarn-debug.log*
8 | yarn-error.log*
9 |
10 | # Editor directories and files
11 | .idea
12 | .vscode
13 | *.suo
14 | *.ntvs*
15 | *.njsproj
16 | *.sln
17 |
--------------------------------------------------------------------------------
/rebugger-embed/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-import": {},
6 | "postcss-url": {},
7 | // to edit target browsers: use "browserslist" field in package.json
8 | "autoprefixer": {}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/rebugger-embed/README.md:
--------------------------------------------------------------------------------
1 | # nine
2 |
3 | > A Vue.js project
4 |
5 | ## Build Setup
6 |
7 | ```bash
8 | # install dependencies
9 | npm install
10 |
11 | # serve with hot reload at localhost:8080
12 | npm run dev
13 |
14 | # build for production with minification
15 | npm run build
16 | ```
17 |
18 | For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).
19 |
--------------------------------------------------------------------------------
/rebugger-embed/build/build.em.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | require('./check-versions')();
3 |
4 | process.env.NODE_ENV = 'production';
5 |
6 | const ora = require('ora');
7 | const rm = require('rimraf');
8 | const path = require('path');
9 | const chalk = require('chalk');
10 | const webpack = require('webpack');
11 | const config = require('../config');
12 | const webpackConfig = require('./webpack.em.conf');
13 |
14 | const spinner = ora('building for production...');
15 | spinner.start();
16 |
17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18 | if (err) throw err;
19 | webpack(webpackConfig, (err, stats) => {
20 | spinner.stop();
21 | if (err) throw err;
22 | process.stdout.write(
23 | stats.toString({
24 | colors: true,
25 | modules: false,
26 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
27 | chunks: false,
28 | chunkModules: false
29 | }) + '\n\n'
30 | );
31 |
32 | if (stats.hasErrors()) {
33 | console.log(chalk.red(' Build failed with errors.\n'));
34 | process.exit(1);
35 | }
36 |
37 | console.log(chalk.cyan(' Build complete.\n'));
38 | console.log(
39 | chalk.yellow(
40 | ' Tip: built files are meant to be served over an HTTP server.\n' +
41 | " Opening index.html over file:// won't work.\n"
42 | )
43 | );
44 | });
45 | });
46 |
--------------------------------------------------------------------------------
/rebugger-embed/build/build.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | require('./check-versions')();
3 |
4 | process.env.NODE_ENV = 'production';
5 |
6 | const ora = require('ora');
7 | const rm = require('rimraf');
8 | const path = require('path');
9 | const chalk = require('chalk');
10 | const webpack = require('webpack');
11 | const config = require('../config');
12 | const webpackConfig = require('./webpack.prod.conf');
13 |
14 | const spinner = ora('building for production...');
15 | spinner.start();
16 |
17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18 | if (err) throw err;
19 | webpack(webpackConfig, (err, stats) => {
20 | spinner.stop();
21 | if (err) throw err;
22 | process.stdout.write(
23 | stats.toString({
24 | colors: true,
25 | modules: false,
26 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
27 | chunks: false,
28 | chunkModules: false
29 | }) + '\n\n'
30 | );
31 |
32 | if (stats.hasErrors()) {
33 | console.log(chalk.red(' Build failed with errors.\n'));
34 | process.exit(1);
35 | }
36 |
37 | console.log(chalk.cyan(' Build complete.\n'));
38 | console.log(
39 | chalk.yellow(
40 | ' Tip: built files are meant to be served over an HTTP server.\n' +
41 | " Opening index.html over file:// won't work.\n"
42 | )
43 | );
44 | });
45 | });
46 |
--------------------------------------------------------------------------------
/rebugger-embed/build/check-versions.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const chalk = require('chalk')
3 | const semver = require('semver')
4 | const packageConfig = require('../package.json')
5 | const shell = require('shelljs')
6 |
7 | function exec (cmd) {
8 | return require('child_process').execSync(cmd).toString().trim()
9 | }
10 |
11 | const versionRequirements = [
12 | {
13 | name: 'node',
14 | currentVersion: semver.clean(process.version),
15 | versionRequirement: packageConfig.engines.node
16 | }
17 | ]
18 |
19 | if (shell.which('npm')) {
20 | versionRequirements.push({
21 | name: 'npm',
22 | currentVersion: exec('npm --version'),
23 | versionRequirement: packageConfig.engines.npm
24 | })
25 | }
26 |
27 | module.exports = function () {
28 | const warnings = []
29 |
30 | for (let i = 0; i < versionRequirements.length; i++) {
31 | const mod = versionRequirements[i]
32 |
33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
34 | warnings.push(mod.name + ': ' +
35 | chalk.red(mod.currentVersion) + ' should be ' +
36 | chalk.green(mod.versionRequirement)
37 | )
38 | }
39 | }
40 |
41 | if (warnings.length) {
42 | console.log('')
43 | console.log(chalk.yellow('To use this template, you must update following to modules:'))
44 | console.log()
45 |
46 | for (let i = 0; i < warnings.length; i++) {
47 | const warning = warnings[i]
48 | console.log(' ' + warning)
49 | }
50 |
51 | console.log()
52 | process.exit(1)
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/rebugger-embed/build/vue-loader.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const utils = require('./utils')
3 | const config = require('../config')
4 | const isProduction = process.env.NODE_ENV === 'production'
5 | const sourceMapEnabled = isProduction
6 | ? config.build.productionSourceMap
7 | : config.dev.cssSourceMap
8 |
9 | module.exports = {
10 | loaders: utils.cssLoaders({
11 | sourceMap: sourceMapEnabled,
12 | extract: isProduction
13 | }),
14 | cssSourceMap: sourceMapEnabled,
15 | cacheBusting: config.dev.cacheBusting,
16 | transformToRequire: {
17 | video: ['src', 'poster'],
18 | source: 'src',
19 | img: 'src',
20 | image: 'xlink:href'
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/rebugger-embed/config/dev.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const merge = require('webpack-merge')
3 | const prodEnv = require('./prod.env')
4 |
5 | module.exports = merge(prodEnv, {
6 | NODE_ENV: '"development"'
7 | })
8 |
--------------------------------------------------------------------------------
/rebugger-embed/config/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | // Template version: 1.2.8
3 | // see http://vuejs-templates.github.io/webpack for documentation.
4 |
5 | const path = require('path');
6 |
7 | module.exports = {
8 | dev: {
9 | // assetsSubDirectory: '/',
10 | assetsSubDirectory: 'static',
11 | assetsPublicPath: '/',
12 | proxyTable: {},
13 | host: '127.0.0.1',
14 | port: 8090,
15 | autoOpenBrowser: false,
16 | errorOverlay: true,
17 | notifyOnErrors: true,
18 | poll: false,
19 | showEslintErrorsInOverlay: false,
20 | devtool: 'cheap-module-eval-source-map',
21 | cacheBusting: true,
22 | cssSourceMap: true,
23 | useEslint: false
24 | },
25 | build: {
26 | index: path.resolve(__dirname, '../dist/index.html'),
27 | env: require('./prod.env'),
28 | assetsRoot: path.resolve(__dirname, '../dist'),
29 | // assetsPublicPath: '/',
30 | assetsPublicPath: './',
31 | assetsSubDirectory: 'static',
32 | // assetsSubDirectory: '/',
33 | productionSourceMap: true,
34 | // devtool: 'source-map',
35 | productionGzip: true,
36 | productionGzipExtensions: ['js', 'css'],
37 | bundleAnalyzerReport: process.env.npm_config_report
38 | }
39 | };
40 |
--------------------------------------------------------------------------------
/rebugger-embed/config/prod.env.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | module.exports = {
3 | NODE_ENV: '"production"'
4 | }
5 |
--------------------------------------------------------------------------------
/rebugger-embed/em/config/index.js:
--------------------------------------------------------------------------------
1 | // 配置文件
2 | let domain = document.domain,
3 | protocol = window.location.protocol;
4 |
5 | let config = {
6 | // 环境配置
7 | dev: {
8 | // 基础域名
9 | baseUrl: "http://localhost:9090"
10 | },
11 | test: {
12 | baseUrl: protocol + "//apirebuggertest.xxxxxx.com"
13 | },
14 | prod: {
15 | baseUrl: protocol + "//apirebugger.xxxxxx.com"
16 | }
17 | };
18 |
19 | export default config;
20 |
--------------------------------------------------------------------------------
/rebugger-embed/em/lib/lsUtils.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable quotes */
2 | /* eslint-disable space-before-function-paren */
3 | export class LsUtils {
4 | set(key, val) {
5 | if (typeof val === "object") {
6 | val = JSON.stringify(val);
7 | }
8 | localStorage.setItem(key, val);
9 | }
10 | get(key, defaultVal = "") {
11 | return localStorage.getItem(key) || defaultVal;
12 | }
13 | getObj(key, defaultVal) {
14 | const val = this.get(key, null);
15 | if (val) {
16 | return JSON.parse(val);
17 | }
18 | return defaultVal || null;
19 | }
20 | remove(key) {
21 | localStorage.removeItem(key);
22 | }
23 | }
24 | export default new LsUtils();
25 |
--------------------------------------------------------------------------------
/rebugger-embed/em/lib/utils.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable quotes */
2 | /* eslint-disable space-before-function-paren */
3 |
4 | var utils = {
5 | // 判断是否为对象
6 | isObject: function(obj) {
7 | return Object.prototype.toString.call(obj) === "[object Object]";
8 | },
9 | // 判断是否为数组
10 | isArray: function(a) {
11 | return Object.prototype.toString.call(a) == "[object Array]";
12 | },
13 | // 判断是否为字符串
14 | isString: function(str) {
15 | return typeof str == "string";
16 | },
17 | isEmpty(obj) {
18 | if (typeof obj == "undefined" || obj == null || obj == "") {
19 | return true;
20 | } else {
21 | return false;
22 | }
23 | },
24 | // 时间字符串比较 2019-12-12 13:13:13
25 | CompareDate(d1, d2) {
26 | return new Date(d1.replace(/-/g, "/")) > new Date(d2.replace(/-/g, "/"));
27 | }
28 | };
29 |
30 | export default utils;
31 |
--------------------------------------------------------------------------------
/rebugger-embed/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | logger
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/rebugger-schedule/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", {
4 | "modules": false,
5 | "targets": {
6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7 | }
8 | }],
9 | "stage-2"
10 | ],
11 | "plugins": ["transform-vue-jsx", "transform-runtime"]
12 | }
13 |
--------------------------------------------------------------------------------
/rebugger-schedule/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/rebugger-schedule/.eslintignore:
--------------------------------------------------------------------------------
1 | /build/
2 | /config/
3 | /dist/
4 | /*.js
5 |
--------------------------------------------------------------------------------
/rebugger-schedule/.eslintrc.js:
--------------------------------------------------------------------------------
1 | // https://eslint.org/docs/user-guide/configuring
2 |
3 | module.exports = {
4 | root: true,
5 | parser: 'babel-eslint',
6 | parserOptions: {
7 | sourceType: 'module'
8 | },
9 | env: {
10 | browser: true
11 | },
12 | // https://github.com/standard/standard/blob/master/docs/RULES-en.md
13 | extends: 'standard',
14 | // required to lint *.vue files
15 | plugins: ['html'],
16 | // add your custom rules here
17 | rules: {
18 | // allow paren-less arrow functions
19 | 'arrow-parens': 0,
20 | // allow async-await
21 | 'generator-star-spacing': 0,
22 | // allow debugger during development
23 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
24 | semi: ['error', 'always'],
25 | 'no-unused-vars': 0,
26 | 'one-var': 0,
27 | eqeqeq: 'off',
28 | 'no-callback-literal': 0,
29 | 'standard/no-callback-literal': 0,
30 | "quotes": [1, "double"], //引号类型 `` "" ''
31 | "space-before-function-paren": [0, "always"] //函数定义时括号前面要不要有空格
32 | },
33 | globals: {
34 | requireModule: true
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/rebugger-schedule/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | log/
4 | server/logs/
5 |
6 | npm-debug.log*
7 | yarn-debug.log*
8 | yarn-error.log*
9 |
10 | # Editor directories and files
11 | .idea
12 | .vscode
13 | *.suo
14 | *.ntvs*
15 | *.njsproj
16 | *.sln
17 |
--------------------------------------------------------------------------------
/rebugger-schedule/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-import": {},
6 | "postcss-url": {},
7 | // to edit target browsers: use "browserslist" field in package.json
8 | "autoprefixer": {}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/rebugger-schedule/README.md:
--------------------------------------------------------------------------------
1 | # nine
2 |
3 | > A nodeJs project
4 |
5 | ## Build Setup
6 |
7 | ```bash
8 | # install dependencies
9 | npm install
10 |
11 | # serve with hot reload at localhost:8080
12 | npm run serve
13 |
14 | # build for production with minification
15 | npm run serve:pm2
16 | npm run restart
17 | npm run stop
18 | ```
19 |
20 | For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).
21 |
--------------------------------------------------------------------------------
/rebugger-schedule/build/build.em.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | require('./check-versions')();
3 |
4 | process.env.NODE_ENV = 'production';
5 |
6 | const ora = require('ora');
7 | const rm = require('rimraf');
8 | const path = require('path');
9 | const chalk = require('chalk');
10 | const webpack = require('webpack');
11 | const config = require('../config');
12 | const webpackConfig = require('./webpack.em.conf');
13 |
14 | const spinner = ora('building for production...');
15 | spinner.start();
16 |
17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18 | if (err) throw err;
19 | webpack(webpackConfig, (err, stats) => {
20 | spinner.stop();
21 | if (err) throw err;
22 | process.stdout.write(
23 | stats.toString({
24 | colors: true,
25 | modules: false,
26 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
27 | chunks: false,
28 | chunkModules: false
29 | }) + '\n\n'
30 | );
31 |
32 | if (stats.hasErrors()) {
33 | console.log(chalk.red(' Build failed with errors.\n'));
34 | process.exit(1);
35 | }
36 |
37 | console.log(chalk.cyan(' Build complete.\n'));
38 | console.log(
39 | chalk.yellow(
40 | ' Tip: built files are meant to be served over an HTTP server.\n' +
41 | " Opening index.html over file:// won't work.\n"
42 | )
43 | );
44 | });
45 | });
46 |
--------------------------------------------------------------------------------
/rebugger-schedule/build/build.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | require('./check-versions')();
3 |
4 | process.env.NODE_ENV = 'production';
5 |
6 | const ora = require('ora');
7 | const rm = require('rimraf');
8 | const path = require('path');
9 | const chalk = require('chalk');
10 | const webpack = require('webpack');
11 | const config = require('../config');
12 | const webpackConfig = require('./webpack.prod.conf');
13 |
14 | const spinner = ora('building for production...');
15 | spinner.start();
16 |
17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18 | if (err) throw err;
19 | webpack(webpackConfig, (err, stats) => {
20 | spinner.stop();
21 | if (err) throw err;
22 | process.stdout.write(
23 | stats.toString({
24 | colors: true,
25 | modules: false,
26 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
27 | chunks: false,
28 | chunkModules: false
29 | }) + '\n\n'
30 | );
31 |
32 | if (stats.hasErrors()) {
33 | console.log(chalk.red(' Build failed with errors.\n'));
34 | process.exit(1);
35 | }
36 |
37 | console.log(chalk.cyan(' Build complete.\n'));
38 | console.log(
39 | chalk.yellow(
40 | ' Tip: built files are meant to be served over an HTTP server.\n' +
41 | " Opening index.html over file:// won't work.\n"
42 | )
43 | );
44 | });
45 | });
46 |
--------------------------------------------------------------------------------
/rebugger-schedule/build/build.lib.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | require('./check-versions')();
3 |
4 | process.env.NODE_ENV = 'production';
5 |
6 | const ora = require('ora');
7 | const rm = require('rimraf');
8 | const path = require('path');
9 | const chalk = require('chalk');
10 | const webpack = require('webpack');
11 | const config = require('../config');
12 | const webpackConfig = require('./webpack.lib.conf');
13 |
14 | const spinner = ora('building for production...');
15 | spinner.start();
16 |
17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18 | if (err) throw err;
19 | webpack(webpackConfig, (err, stats) => {
20 | spinner.stop();
21 | if (err) throw err;
22 | process.stdout.write(
23 | stats.toString({
24 | colors: true,
25 | modules: false,
26 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
27 | chunks: false,
28 | chunkModules: false
29 | }) + '\n\n'
30 | );
31 |
32 | if (stats.hasErrors()) {
33 | console.log(chalk.red(' Build failed with errors.\n'));
34 | process.exit(1);
35 | }
36 |
37 | console.log(chalk.cyan(' Build complete.\n'));
38 | console.log(
39 | chalk.yellow(
40 | ' Tip: built files are meant to be served over an HTTP server.\n' +
41 | " Opening index.html over file:// won't work.\n"
42 | )
43 | );
44 | });
45 | });
46 |
--------------------------------------------------------------------------------
/rebugger-schedule/build/check-versions.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const chalk = require('chalk')
3 | const semver = require('semver')
4 | const packageConfig = require('../package.json')
5 | const shell = require('shelljs')
6 |
7 | function exec (cmd) {
8 | return require('child_process').execSync(cmd).toString().trim()
9 | }
10 |
11 | const versionRequirements = [
12 | {
13 | name: 'node',
14 | currentVersion: semver.clean(process.version),
15 | versionRequirement: packageConfig.engines.node
16 | }
17 | ]
18 |
19 | if (shell.which('npm')) {
20 | versionRequirements.push({
21 | name: 'npm',
22 | currentVersion: exec('npm --version'),
23 | versionRequirement: packageConfig.engines.npm
24 | })
25 | }
26 |
27 | module.exports = function () {
28 | const warnings = []
29 |
30 | for (let i = 0; i < versionRequirements.length; i++) {
31 | const mod = versionRequirements[i]
32 |
33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
34 | warnings.push(mod.name + ': ' +
35 | chalk.red(mod.currentVersion) + ' should be ' +
36 | chalk.green(mod.versionRequirement)
37 | )
38 | }
39 | }
40 |
41 | if (warnings.length) {
42 | console.log('')
43 | console.log(chalk.yellow('To use this template, you must update following to modules:'))
44 | console.log()
45 |
46 | for (let i = 0; i < warnings.length; i++) {
47 | const warning = warnings[i]
48 | console.log(' ' + warning)
49 | }
50 |
51 | console.log()
52 | process.exit(1)
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/rebugger-schedule/build/vue-loader.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const utils = require('./utils')
3 | const config = require('../config')
4 | const isProduction = process.env.NODE_ENV === 'production'
5 | const sourceMapEnabled = isProduction
6 | ? config.build.productionSourceMap
7 | : config.dev.cssSourceMap
8 |
9 | module.exports = {
10 | loaders: utils.cssLoaders({
11 | sourceMap: sourceMapEnabled,
12 | extract: isProduction
13 | }),
14 | cssSourceMap: sourceMapEnabled,
15 | cacheBusting: config.dev.cacheBusting,
16 | transformToRequire: {
17 | video: ['src', 'poster'],
18 | source: 'src',
19 | img: 'src',
20 | image: 'xlink:href'
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/app.ts:
--------------------------------------------------------------------------------
1 | const Koa = require("koa");
2 | const bodyParser = require("koa-bodyparser");
3 | const app = new Koa();
4 | const koaStatic = require("koa-static");
5 | const path = require("path");
6 | const Router = require("koa-router");
7 | const router = new Router();
8 | const Kcors = require("kcors");
9 | // const koaLogger = require('koa-logger-winston');
10 | // import logger from './src/middleware/logger';
11 |
12 | import sample from './src/router/sample';
13 | import myRouter from './src/router/index';
14 | import errorMiddleware from './src/middleware/error';
15 | import checkMiddleware from './src/middleware/check';
16 |
17 | // 验证是否有token
18 | //POST解析
19 | app.use(bodyParser());
20 | // 跨域设置
21 | const corsOptions = {
22 | origin: "",
23 | credentials: true,
24 | maxAge: 3600
25 | };
26 | app.use(Kcors(corsOptions));
27 |
28 | app.use(checkMiddleware);
29 | app.use(errorMiddleware());
30 | // console.log(process.env.NODE_ENV);
31 |
32 | if(process.env.NODE_ENV === 'development'){
33 | app.use(koaStatic(path.resolve(__dirname, "./public")));
34 | }else{
35 | app.use(koaStatic(path.resolve(__dirname, "../public")));
36 | }
37 | // 路由配置
38 | router.get("/", sample);
39 | for(var i in myRouter) {
40 | myRouter[i].forEach((item)=>{
41 | if(item.method=='get'){
42 | router.get(item.url, item.function);
43 | }else if(item.method=='post'){
44 | router.post(item.url, item.function);
45 | }
46 | })
47 | }
48 |
49 | //正常请求的日志
50 | // app.use(koaLogger(logger.success));
51 |
52 | app
53 | .use(router.routes()) //把路由都引入进来
54 | .use(router.allowedMethods());
55 |
56 | // 收集错误日志
57 | // app.use(koaLogger(logger.error));
58 |
59 | console.log("listen 9091");
60 | app.listen(9091);
61 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/build/app.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var Koa = require("koa");
3 | var bodyParser = require("koa-bodyparser");
4 | var app = new Koa();
5 | var koaStatic = require("koa-static");
6 | var path = require("path");
7 | var Router = require("koa-router");
8 | var router = new Router();
9 | var Kcors = require("kcors");
10 | var sample = require("./src/router/sample");
11 | var myRouter = require('./src/router/index');
12 | //POST解析
13 | app.use(bodyParser());
14 | // 跨域设置
15 | var corsOptions = {
16 | origin: "",
17 | credentials: true,
18 | maxAge: 3600
19 | };
20 | app.use(Kcors(corsOptions));
21 | console.log(process.env.NODE_ENV);
22 | if (process.env.NODE_ENV === 'development') {
23 | app.use(koaStatic(path.resolve(__dirname, "./public")));
24 | }
25 | else {
26 | app.use(koaStatic(path.resolve(__dirname, "../public")));
27 | }
28 | // 路由配置
29 | router.get("/", sample);
30 | for (var i in myRouter) {
31 | myRouter[i].forEach(function (item) {
32 | if (item.method == 'get') {
33 | router.get(item.url, item.function);
34 | }
35 | else if (item.method == 'post') {
36 | router.post(item.url, item.function);
37 | }
38 | });
39 | }
40 | app
41 | .use(router.routes()) //把路由都引入进来
42 | .use(router.allowedMethods());
43 | console.log("listen 9090");
44 | app.listen(9090);
45 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/build/config/default.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | exports.config = {
4 | port: 3000,
5 | database: {
6 | HOST: '127.0.0.1',
7 | PORT: '3306',
8 | USER: 'root',
9 | PASSWORD: '18819640516',
10 | DATABASE: 'front_logger_db' //选中数据库
11 | }
12 | };
13 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/build/src/module/system/auth/model/user.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | var User = /** @class */ (function () {
4 | function User() {
5 | }
6 | return User;
7 | }());
8 | exports.default = User;
9 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/build/src/module/system/auth/service/authService.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | // const mysql = require("../../../../utils/mysql");
3 | // const sequelize = require("sequelize");
4 | var UserDao = require("../../user/schema/user")(require("../../../../utils/mysql"), require("sequelize")); // 引入user的表结构
5 | var uuid = require("node-uuid");
6 | var authService = /** @class */ (function () {
7 | function authService(parameters) {
8 | }
9 | /**
10 | * login
11 | */
12 | authService.prototype.login = function () {
13 | };
14 | return authService;
15 | }());
16 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/build/src/router/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var userController = require("../module/system/user/controller/userController");
3 | module.exports = {
4 | userController: userController
5 | };
6 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/build/src/router/router.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | exports.default = {
4 | getName: function () { }
5 | };
6 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/build/src/router/sample.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var main = function (ctx) {
3 | ctx.response.body = 'front-logger';
4 | };
5 | module.exports = main;
6 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/build/src/utils/mysql.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var Sequelize = require("sequelize");
3 | var config = require("../../config/default");
4 | // const mysql = new Sequelize(config.mysql.default, {
5 | // define: {
6 | // timestamps: false,
7 | // },
8 | // operatorsAliases: false
9 | // });
10 | var sequelized = new Sequelize(config.database.DATABASE, config.database.USER, config.database.PASSWORD, {
11 | host: config.database.HOST,
12 | dialect: "mysql",
13 | pool: {
14 | max: 5,
15 | min: 0,
16 | idle: 30000
17 | }
18 | });
19 | module.exports = sequelized;
20 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/config/default.ts:
--------------------------------------------------------------------------------
1 | export default{
2 | port: 3000,
3 | database: {
4 | HOST: '127.0.0.1', //数据库地址
5 | PORT: '3306',
6 | USER: 'root', //数据库用户
7 | PASSWORD: '18819640516', //数据库密码
8 | DATABASE: 'front_logger_db' //选中数据库
9 | },
10 | useRedis:false, // 缓存使用 redis
11 | redis:{
12 | exprires:60000, //默认缓存时间 单位ms
13 | },
14 | secret:"gesafe"
15 | }
16 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/public/1.txt:
--------------------------------------------------------------------------------
1 | 日志,权限
--------------------------------------------------------------------------------
/rebugger-schedule/server/public/SQL语句.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-schedule/server/public/SQL语句.txt
--------------------------------------------------------------------------------
/rebugger-schedule/server/public/script.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/public/static/app.css:
--------------------------------------------------------------------------------
1 | .app{
2 | color: #fefefe;
3 | }
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/middleware/check.ts:
--------------------------------------------------------------------------------
1 | const bluebird = require("bluebird");
2 | const jwt = require("jsonwebtoken");
3 | const verify = bluebird.promisify(jwt.verify);
4 | import config from "../../config/default";
5 |
6 | async function check(ctx, next) {
7 | let url = ctx.request.url;
8 | // 登录 和上报 不用检查 url.indexOf("/report/") != -1
9 | if (url == "/api/auth/login" || url == "/api/report/create" || url == "/api/report/createList") await next();
10 | else {
11 | // 规定token写在header 的 'autohrization'
12 | let token = ctx.request.headers["token"];
13 | console.log(token);
14 | if (!token) {
15 | //没有token
16 | ctx.body = {
17 | code: 401,
18 | status: 401,
19 | message: "没有token"
20 | };
21 | } else {
22 | try {
23 | // 解码
24 | let payload = await verify(token, config.secret);
25 | let { time, timeout } = payload;
26 | // console.log(payload);
27 | let data = new Date().getTime();
28 | if (data - time <= timeout) {
29 | // 未过期
30 | await next();
31 | } else {
32 | //过期
33 | ctx.body = {
34 | code: 401,
35 | status: 401,
36 | message: "token 已过期"
37 | };
38 | }
39 | } catch (error) {
40 | console.log(error);
41 | //过期
42 | ctx.body = {
43 | code: 401,
44 | status: 401,
45 | message: "无效的token"
46 | };
47 | }
48 | }
49 | }
50 | }
51 |
52 | export default check;
53 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/middleware/error.ts:
--------------------------------------------------------------------------------
1 | import { Context } from 'koa';
2 | // import * as compose from 'koa-compose';
3 | let compose = require("koa-compose");
4 | import logger from './logger';
5 | // var process = require('child_process');
6 |
7 | const handler = async (ctx: Context, next: () => void) => {
8 | try {
9 | await next();
10 | } catch (error) {
11 | // ctx.log.error(error);
12 | // console.log(process.env.NODE_ENV);
13 | if (!process.env.NODE_ENV || process.env.NODE_ENV === 'development') {
14 | console.log("异常捕获", error);
15 | }
16 |
17 | // let errMsg = "";
18 | // console.log(ctx.request.body);
19 | let errorObj ={
20 | message:"",
21 | url:ctx.request.url,
22 | method:ctx.request.method,
23 | body:JSON.stringify(ctx.request.body),
24 | query:JSON.stringify(ctx.request.query)
25 | }
26 | if (error.isBoom) {
27 | errorObj.message = error.output.payload;
28 | ctx.body = {
29 | code:503,
30 | data:null,
31 | errMsg:error.output.payload
32 | };
33 | // ctx.status = error.output.statusCode;
34 | ctx.status = 200;
35 |
36 | } else {
37 | // General Exception
38 | let errMsg =error.message +": "+ (error.parent ? error.parent.message:'');
39 | errorObj.message = errMsg;
40 | ctx.body = {
41 | code:503,
42 | data:null,
43 | errMsg:errMsg
44 | };
45 | // ctx.status = error.statusCode || 500;
46 | ctx.status = 200;
47 |
48 | }
49 | logger.logger.log("error", errorObj);
50 | return;
51 | }
52 | };
53 |
54 | export default () => compose([
55 | handler,
56 | ]);
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/base/model/baseModel.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * 基础实例类
3 | */
4 |
5 | export default abstract class BaseEntity {
6 |
7 | public id: string;
8 |
9 | public updateDate: string;
10 |
11 | public createDate: string;
12 |
13 | constructor(id: string, updateDate: string, createDate:string) {
14 | this.id = id;
15 | this.updateDate = updateDate;
16 | this.createDate = createDate;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/project/controller/projectController.ts:
--------------------------------------------------------------------------------
1 | import ProjectService from "../service/projectService";
2 | import BaseController from "../../base/controller/baseController";
3 | import { Context } from "koa";
4 | class ProjectController extends BaseController {
5 | constructor(entityService, prefix, option?: any) {
6 | super(entityService, prefix, option);
7 | }
8 |
9 | /**
10 | * getCustomRouter
11 | * 自定义扩展路由
12 | */
13 | public getCustomRouter() {
14 | return [
15 | // 自定义扩展
16 | // {
17 | // url: this.profix + "/info",
18 | // method: "post",
19 | // function: async (ctx: Context) => {}
20 | // }
21 | ];
22 | }
23 | }
24 |
25 | let projectController = new ProjectController(ProjectService, "/api/project", {
26 | infoCacheable: false,
27 | findCacheable: true
28 | });
29 | let projectRouter = projectController
30 | .getBaseRouter()
31 | .concat(projectController.getCustomRouter());
32 |
33 | export default projectRouter;
34 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/system/config/controller/configController.ts:
--------------------------------------------------------------------------------
1 | import ConfigService from "../service/configService";
2 | import BaseController from "../../../base/controller/baseController";
3 | import { Context } from "koa";
4 | class ConfigController extends BaseController {
5 | constructor(entityService, prefix, option?: any) {
6 | super(entityService, prefix, option);
7 | }
8 |
9 | /**
10 | * getCustomRouter
11 | * 自定义扩展路由
12 | */
13 | public getCustomRouter() {
14 | return [
15 | // 自定义扩展
16 | // {
17 | // url: this.profix + "/info",
18 | // method: "post",
19 | // function: async (ctx: Context) => {}
20 | // }
21 | ];
22 | }
23 | }
24 |
25 | let configController = new ConfigController(ConfigService, "/api/config", {
26 | infoCacheable: false,
27 | findCacheable: false
28 | });
29 | let configRouter = configController
30 | .getBaseRouter()
31 | .concat(configController.getCustomRouter());
32 |
33 | export default configRouter;
34 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/system/config/schema/configSchema.ts:
--------------------------------------------------------------------------------
1 | export default function(sequelize: any, DataTypes: any) {
2 | return sequelize.define(
3 | "sys_config",
4 | {
5 | id: {
6 | type: DataTypes.STRING(64),
7 | allowNull: false,
8 | primaryKey: true,
9 | comment:"主键"
10 | },
11 | paramKey:{
12 | type: DataTypes.STRING,
13 | allowNull: false,
14 | comment:"key"
15 | },
16 | paramValue:{
17 | type: DataTypes.STRING,
18 | allowNull: false,
19 | comment:"value"
20 | },
21 | remark:{
22 | type: DataTypes.TEXT,
23 | allowNull: true,
24 | comment:"备注"
25 | },
26 | retainField1:{
27 | type: DataTypes.STRING,
28 | allowNull: true,
29 | comment:"保留字段"
30 | },
31 | isDel:{
32 | type: DataTypes.INTEGER,
33 | allowNull: true,
34 | comment:"物理删除 0 不删除 1 删除"
35 | },
36 | createDate: {
37 | type: DataTypes.DATE,
38 | allowNull: true,
39 | primaryKey: false,
40 | // field: "create_date",
41 | comment:"创建日期"
42 | },
43 | updateDate: {
44 | type: DataTypes.DATE,
45 | allowNull: true,
46 | primaryKey: false,
47 | // field: "update_date",
48 | comment:"修改日期"
49 | }
50 | },
51 | {
52 | tableName: "sys_config",
53 | createdAt: false, //去掉默认字段
54 | updatedAt: false //去掉默认字段
55 | }
56 | );
57 | }
58 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/system/config/service/configService.ts:
--------------------------------------------------------------------------------
1 | import BaseService from "../../../base/service/baseService";
2 | import mysql from "../../../../utils/mysql";
3 | import sequelize from "sequelize";
4 | import configSchema from "../schema/configSchema";
5 |
6 | const configDao = configSchema(mysql, sequelize);
7 |
8 | // 重新生成表
9 | configDao.sync({ alter: true, force: true });
10 |
11 | class ConfigService extends BaseService {
12 | constructor() {
13 | super(configDao);
14 | }
15 | }
16 | const configService = new ConfigService();
17 | export default configService;
18 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/system/menu/controller/menuController.ts:
--------------------------------------------------------------------------------
1 | import MenuService from "../service/menuService";
2 | import BaseController from "../../../base/controller/baseController";
3 | import { Context } from "koa";
4 | class MenuController extends BaseController {
5 | constructor(entityService, prefix, option?: any) {
6 | super(entityService, prefix, option);
7 | }
8 |
9 | /**
10 | * getCustomRouter
11 | * 自定义扩展路由
12 | */
13 | public getCustomRouter() {
14 | return [
15 | // 自定义扩展
16 | // {
17 | // url: this.profix + "/info",
18 | // method: "post",
19 | // function: async (ctx: Context) => {}
20 | // }
21 | ];
22 | }
23 | }
24 |
25 | let menuController = new MenuController(MenuService, "/api/menu", {
26 | infoCacheable: false,
27 | findCacheable: false
28 | });
29 | let menuRouter = menuController
30 | .getBaseRouter()
31 | .concat(menuController.getCustomRouter());
32 |
33 | export default menuRouter;
34 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/system/menu/service/menuService.ts:
--------------------------------------------------------------------------------
1 | import BaseService from "../../../base/service/baseService";
2 | import mysql from "../../../../utils/mysql";
3 | import sequelize from "sequelize";
4 | import menuSchema from "../schema/menuSchema";
5 |
6 |
7 | const MenuDao = menuSchema(mysql, sequelize);
8 |
9 | // 重新生成表
10 | MenuDao.sync({ alter: true, force: true });
11 |
12 | class MenuService extends BaseService {
13 | constructor() {
14 | super(MenuDao);
15 | }
16 | }
17 | const menuService = new MenuService();
18 | export default menuService;
19 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/system/org/controller/orgController.ts:
--------------------------------------------------------------------------------
1 | import OrgService from "../service/orgService";
2 | import BaseController from "../../../base/controller/baseController";
3 | import { Context } from "koa";
4 | class OrgController extends BaseController {
5 | constructor(entityService, prefix, option?: any) {
6 | super(entityService, prefix, option);
7 | }
8 |
9 | /**
10 | * getCustomRouter
11 | * 自定义扩展路由
12 | */
13 | public getCustomRouter() {
14 | return [
15 | // 自定义扩展
16 | // {
17 | // url: this.profix + "/info",
18 | // method: "post",
19 | // function: async (ctx: Context) => {}
20 | // }
21 | ];
22 | }
23 | }
24 |
25 | let orgController = new OrgController(OrgService, "/api/org", {
26 | infoCacheable: false,
27 | findCacheable: false
28 | });
29 | let orgRouter = orgController
30 | .getBaseRouter()
31 | .concat(orgController.getCustomRouter());
32 |
33 | export default orgRouter;
34 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/system/org/schema/orgSchema.ts:
--------------------------------------------------------------------------------
1 | export default function(sequelize: any, DataTypes: any) {
2 | return sequelize.define(
3 | "sys_org",
4 | {
5 | id: {
6 | type: DataTypes.STRING(64),
7 | allowNull: false,
8 | primaryKey: true,
9 | comment:"主键"
10 | },
11 | name:{
12 | type: DataTypes.STRING,
13 | allowNull: false,
14 | comment:"组织名称"
15 | },
16 | code:{
17 | type: DataTypes.STRING,
18 | allowNull: false,
19 | comment:"组织编码"
20 | },
21 | parentId:{
22 | type: DataTypes.STRING,
23 | allowNull: false,
24 | comment:"父级Id"
25 | },
26 | remark:{
27 | type: DataTypes.TEXT,
28 | allowNull: true,
29 | comment:"备注"
30 | },
31 | retainField1:{
32 | type: DataTypes.STRING,
33 | allowNull: true,
34 | comment:"保留字段"
35 | },
36 | retainField2:{
37 | type: DataTypes.STRING,
38 | allowNull: true,
39 | comment:"保留字段"
40 | },
41 | retainField3:{
42 | type: DataTypes.STRING,
43 | allowNull: true,
44 | comment:"保留字段"
45 | },
46 | isDel:{
47 | type: DataTypes.INTEGER,
48 | allowNull: true,
49 | comment:"物理删除 0 不删除 1 删除"
50 | },
51 | createDate: {
52 | type: DataTypes.DATE,
53 | allowNull: true,
54 | primaryKey: false,
55 | // field: "create_date",
56 | comment:"创建日期"
57 | },
58 | updateDate: {
59 | type: DataTypes.DATE,
60 | allowNull: true,
61 | primaryKey: false,
62 | // field: "update_date",
63 | comment:"修改日期"
64 | }
65 | },
66 | {
67 | tableName: "sys_org",
68 | createdAt: false, //去掉默认字段
69 | updatedAt: false //去掉默认字段
70 | }
71 | );
72 | }
73 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/system/org/service/orgService.ts:
--------------------------------------------------------------------------------
1 | import BaseService from "../../../base/service/baseService";
2 | import mysql from "../../../../utils/mysql";
3 | import sequelize from "sequelize";
4 | import orgSchema from "../schema/orgSchema";
5 |
6 | const OrgDao = orgSchema(mysql, sequelize);
7 |
8 | // 重新生成表
9 | OrgDao.sync({ alter: true, force: true });
10 |
11 | class OrgService extends BaseService {
12 | constructor() {
13 | super(OrgDao);
14 | }
15 | }
16 | const orgService = new OrgService();
17 | export default orgService;
18 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/system/role/controller/roleController.ts:
--------------------------------------------------------------------------------
1 | import RoleService from "../service/roleService";
2 | import BaseController from "../../../base/controller/baseController";
3 | import { Context } from "koa";
4 | class RoleController extends BaseController {
5 | constructor(entityService, prefix, option?: any) {
6 | super(entityService, prefix, option);
7 | }
8 |
9 | /**
10 | * getCustomRouter
11 | * 自定义扩展路由
12 | */
13 | public getCustomRouter() {
14 | return [
15 | // 自定义扩展
16 | // {
17 | // url: this.profix + "/info",
18 | // method: "post",
19 | // function: async (ctx: Context) => {}
20 | // }
21 | ];
22 | }
23 | }
24 |
25 | let roleController = new RoleController(RoleService, "/api/role", {
26 | infoCacheable: false,
27 | findCacheable: false
28 | });
29 | let roleRouter = roleController
30 | .getBaseRouter()
31 | .concat(roleController.getCustomRouter());
32 |
33 | export default roleRouter;
34 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/system/role/schema/roleMenuSchema.ts:
--------------------------------------------------------------------------------
1 | export default function(sequelize: any, DataTypes: any) {
2 | return sequelize.define(
3 | "sys_role_menu",
4 | {
5 | id: {
6 | type: DataTypes.STRING(64),
7 | allowNull: false,
8 | primaryKey: true,
9 | comment:"主键"
10 | },
11 | roleId:{
12 | type: DataTypes.STRING(64),
13 | allowNull: false,
14 | comment:"角色Id"
15 | },
16 | menuId:{
17 | type: DataTypes.STRING(64),
18 | allowNull: false,
19 | comment:"菜单Id"
20 | },
21 | createDate: {
22 | type: DataTypes.DATE,
23 | allowNull: true,
24 | primaryKey: false,
25 | // field: "create_date",
26 | comment:"创建日期"
27 | }
28 | },
29 | {
30 | tableName: "sys_role_menu",
31 | createdAt: false, //去掉默认字段
32 | updatedAt: false //去掉默认字段
33 | }
34 | );
35 | }
36 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/system/role/schema/roleSchema.ts:
--------------------------------------------------------------------------------
1 | export default function(sequelize: any, DataTypes: any) {
2 | return sequelize.define(
3 | "sys_role",
4 | {
5 | id: {
6 | type: DataTypes.STRING(64),
7 | allowNull: false,
8 | primaryKey: true,
9 | comment:"主键"
10 | },
11 | name:{
12 | type: DataTypes.STRING,
13 | allowNull: false,
14 | comment:"角色名称"
15 | },
16 | remark:{
17 | type: DataTypes.TEXT,
18 | allowNull: true,
19 | comment:"备注"
20 | },
21 | isAdmin:{
22 | type: DataTypes.INTEGER,
23 | allowNull: true,
24 | comment:"是否为管理员"
25 | },
26 | retainField1:{
27 | type: DataTypes.STRING,
28 | allowNull: true,
29 | comment:"保留字段"
30 | },
31 | retainField2:{
32 | type: DataTypes.STRING,
33 | allowNull: true,
34 | comment:"保留字段"
35 | },
36 | retainField3:{
37 | type: DataTypes.STRING,
38 | allowNull: true,
39 | comment:"保留字段"
40 | },
41 | createDate: {
42 | type: DataTypes.DATE,
43 | allowNull: true,
44 | primaryKey: false,
45 | // field: "create_date",
46 | comment:"创建日期"
47 | },
48 | updateDate: {
49 | type: DataTypes.DATE,
50 | allowNull: true,
51 | primaryKey: false,
52 | // field: "update_date",
53 | comment:"修改日期"
54 | }
55 | },
56 | {
57 | tableName: "sys_role",
58 | createdAt: false, //去掉默认字段
59 | updatedAt: false //去掉默认字段
60 | }
61 | );
62 | }
63 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/system/role/service/roleService.ts:
--------------------------------------------------------------------------------
1 | import BaseService from "../../../base/service/baseService";
2 | import mysql from "../../../../utils/mysql";
3 | import sequelize from "sequelize";
4 | import roleSchema from "../schema/roleSchema";
5 | import roleMenuSchema from '..//schema/roleMenuSchema';
6 |
7 | const RoleDao = roleSchema(mysql, sequelize);
8 | // 用于更新角色 批量保存角色 菜单关联表
9 | const RoleMenuDao = roleMenuSchema(mysql, sequelize);
10 |
11 | // 重新生成表
12 | // RoleDao.sync({ alter: true, force: true });
13 | // RoleMenuDao.sync({ alter: true, force: true });
14 |
15 | class RoleService extends BaseService {
16 | constructor() {
17 | super(RoleDao);
18 | }
19 | }
20 | const roleService = new RoleService();
21 | export default roleService;
22 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/system/user/controller/userController.ts:
--------------------------------------------------------------------------------
1 | import UserService from "../service/userService";
2 | import BaseController from "../../../base/controller/baseController";
3 | import { Context } from "koa";
4 | class UserController extends BaseController {
5 | constructor(entityService, prefix, option?: any) {
6 | super(entityService, prefix, option);
7 | }
8 |
9 | /**
10 | * getCustomRouter
11 | * 自定义扩展路由
12 | */
13 | public getCustomRouter() {
14 | return [
15 | // 自定义扩展
16 | {
17 | url: this.profix + "/updatePassword",
18 | method: "post",
19 | function: async (ctx: Context) => {
20 | let obj = ctx.request.body;
21 | const ret = await this.entityService.updatePassword(obj);
22 | if (ret) {
23 | ctx.response.body = {
24 | code: 200,
25 | data: ret
26 | };
27 | } else {
28 | ctx.response.body = {
29 | code: 503,
30 | data: null,
31 | message: "修改失败,请稍后再试"
32 | };
33 | }
34 | }
35 | }
36 | ];
37 | }
38 | }
39 |
40 | let userController = new UserController(UserService, "/api/user", {
41 | infoCacheable: false,
42 | findCacheable: false
43 | });
44 | let userRouter = userController
45 | .getBaseRouter()
46 | .concat(userController.getCustomRouter());
47 |
48 | export default userRouter;
49 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/module/system/user/schema/userRoleSchema.ts:
--------------------------------------------------------------------------------
1 | export default function(sequelize: any, DataTypes: any) {
2 | return sequelize.define(
3 | "sys_user_role",
4 | {
5 | id: {
6 | type: DataTypes.STRING(64),
7 | allowNull: false,
8 | primaryKey: true,
9 | comment:"主键"
10 | },
11 | roleId:{
12 | type: DataTypes.STRING(64),
13 | allowNull: false,
14 | comment:"角色Id"
15 | },
16 | userId:{
17 | type: DataTypes.STRING(64),
18 | allowNull: false,
19 | comment:"用户Id"
20 | },
21 | createDate: {
22 | type: DataTypes.DATE,
23 | allowNull: true,
24 | primaryKey: false,
25 | // field: "create_date",
26 | comment:"创建日期"
27 | }
28 | },
29 | {
30 | tableName: "sys_user_role",
31 | createdAt: false, //去掉默认字段
32 | updatedAt: false //去掉默认字段
33 | }
34 | );
35 | }
36 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/router/index.ts:
--------------------------------------------------------------------------------
1 | import userController from '../module/system/user/controller/userController';
2 |
3 | export default {
4 | userController
5 | };
6 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/router/sample.ts:
--------------------------------------------------------------------------------
1 | import { Context } from 'koa';
2 | const main = (ctx:Context) => {
3 | ctx.response.body = 'front-logger';
4 | };
5 |
6 | export default main;
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/utils/cacheUtil.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Description:缓存工具类
3 | * Author:詹陈龙
4 | * Update:
5 | */
6 |
7 | import baseCache from "memory-cache";
8 | import sysConfig from "../../config/default";
9 | import redisUtil from "./redisUtil";
10 |
11 | class CacheUtil {
12 | constructor() {}
13 | /**
14 | * get
15 | */
16 | public async get(key) {
17 | if (sysConfig.useRedis) {
18 | return await redisUtil.get(key);
19 | }
20 | return baseCache.get(key);
21 | }
22 |
23 | /**
24 | * set
25 | */
26 | public set(key, value: any, exprires: any) {
27 | if (sysConfig.useRedis) {
28 | redisUtil.set(key, value);
29 | redisUtil.expire(key, exprires);
30 | } else {
31 | baseCache.put(
32 | key,
33 | value,
34 | exprires ? exprires : sysConfig.redis.exprires
35 | );
36 | }
37 | }
38 | }
39 |
40 | const cacheUtil = new CacheUtil();
41 | export default cacheUtil;
42 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/utils/mysql.ts:
--------------------------------------------------------------------------------
1 | const Sequelize = require("sequelize");
2 | // const config = require("../../config/default");
3 | import config from '../../config/default';
4 |
5 |
6 | // const mysql = new Sequelize(config.mysql.default, {
7 | // define: {
8 | // timestamps: false,
9 | // },
10 | // operatorsAliases: false
11 | // });
12 |
13 | var sequelized = new Sequelize(
14 | config.database.DATABASE,
15 | config.database.USER,
16 | config.database.PASSWORD,
17 | {
18 | host: config.database.HOST,
19 | dialect: "mysql",
20 | pool: {
21 | max: 5,
22 | min: 0,
23 | idle: 30000
24 | },
25 | // 添加这个配置 格式化日期
26 | dialectOptions: {
27 | dateStrings: true,
28 | typeCast: true
29 | },
30 | 'define': {
31 | // 字段以下划线(_)来分割(默认是驼峰命名风格)
32 | 'underscored': true
33 | },
34 | // 时区东八区
35 | timezone: '+08:00'
36 | }
37 | );
38 |
39 | export default sequelized;
40 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/utils/redis.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable quotes */
2 | const Redis = require("ioredis");
3 | const redis = {
4 | port: 6379, // Redis port
5 | host: "127.0.0.1", // Redis host
6 | prefix: "front-logger:", // 存诸前缀
7 | ttl: 60 * 60 * 23, // 默认过期时间
8 | family: 4,
9 | db: 0
10 | };
11 | const newRedis = new Redis(redis);
12 | module.exports = newRedis;
13 |
--------------------------------------------------------------------------------
/rebugger-schedule/server/src/utils/redisUtil.ts:
--------------------------------------------------------------------------------
1 | const redis = require("./redis");
2 |
3 | class RedisUtil {
4 | constructor() {}
5 | /**
6 | * get
7 | */
8 | public async get(key) {
9 | return await redis.get(key);
10 | }
11 |
12 | /**
13 | * set
14 | */
15 | public async set(key, value: any) {
16 | redis.set(key, value);
17 | }
18 |
19 | /**
20 | * 设置过期时间
21 | */
22 | public expire(key, expire) {
23 | redis.expire(key, expire);
24 | }
25 | }
26 | const redisUtil = new RedisUtil();
27 | export default redisUtil;
28 |
--------------------------------------------------------------------------------
/rebugger-service/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": [
3 | ["env", {
4 | "modules": false,
5 | "targets": {
6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7 | }
8 | }],
9 | "stage-2"
10 | ],
11 | "plugins": ["transform-vue-jsx", "transform-runtime"]
12 | }
13 |
--------------------------------------------------------------------------------
/rebugger-service/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
--------------------------------------------------------------------------------
/rebugger-service/.eslintignore:
--------------------------------------------------------------------------------
1 | /build/
2 | /config/
3 | /dist/
4 | /*.js
5 |
--------------------------------------------------------------------------------
/rebugger-service/.eslintrc.js:
--------------------------------------------------------------------------------
1 | // https://eslint.org/docs/user-guide/configuring
2 |
3 | module.exports = {
4 | root: true,
5 | parser: 'babel-eslint',
6 | parserOptions: {
7 | sourceType: 'module'
8 | },
9 | env: {
10 | browser: true
11 | },
12 | // https://github.com/standard/standard/blob/master/docs/RULES-en.md
13 | extends: 'standard',
14 | // required to lint *.vue files
15 | plugins: ['html'],
16 | // add your custom rules here
17 | rules: {
18 | // allow paren-less arrow functions
19 | 'arrow-parens': 0,
20 | // allow async-await
21 | 'generator-star-spacing': 0,
22 | // allow debugger during development
23 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
24 | semi: ['error', 'always'],
25 | 'no-unused-vars': 0,
26 | 'one-var': 0,
27 | eqeqeq: 'off',
28 | 'no-callback-literal': 0,
29 | 'standard/no-callback-literal': 0,
30 | "quotes": [1, "double"], //引号类型 `` "" ''
31 | "space-before-function-paren": [0, "always"] //函数定义时括号前面要不要有空格
32 | },
33 | globals: {
34 | requireModule: true
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/rebugger-service/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules/
3 | logs
4 | server/logs/
5 |
6 | npm-debug.log*
7 | yarn-debug.log*
8 | yarn-error.log*
9 |
10 | # Editor directories and files
11 | .idea
12 | .vscode
13 | *.suo
14 | *.ntvs*
15 | *.njsproj
16 | *.sln
17 |
--------------------------------------------------------------------------------
/rebugger-service/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-import": {},
6 | "postcss-url": {},
7 | // to edit target browsers: use "browserslist" field in package.json
8 | "autoprefixer": {}
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/rebugger-service/README.md:
--------------------------------------------------------------------------------
1 | # nine
2 |
3 | > A nodeJs project
4 |
5 | ## Build Setup
6 |
7 | ```bash
8 | # install dependencies
9 | npm install
10 |
11 | # serve with hot reload at localhost:8080
12 | npm run serve
13 |
14 | # build for production with minification
15 | npm run serve:pm2
16 | npm run restart
17 | npm run stop
18 | ```
19 |
20 | For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).
21 |
--------------------------------------------------------------------------------
/rebugger-service/build/build.em.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | require('./check-versions')();
3 |
4 | process.env.NODE_ENV = 'production';
5 |
6 | const ora = require('ora');
7 | const rm = require('rimraf');
8 | const path = require('path');
9 | const chalk = require('chalk');
10 | const webpack = require('webpack');
11 | const config = require('../config');
12 | const webpackConfig = require('./webpack.em.conf');
13 |
14 | const spinner = ora('building for production...');
15 | spinner.start();
16 |
17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18 | if (err) throw err;
19 | webpack(webpackConfig, (err, stats) => {
20 | spinner.stop();
21 | if (err) throw err;
22 | process.stdout.write(
23 | stats.toString({
24 | colors: true,
25 | modules: false,
26 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
27 | chunks: false,
28 | chunkModules: false
29 | }) + '\n\n'
30 | );
31 |
32 | if (stats.hasErrors()) {
33 | console.log(chalk.red(' Build failed with errors.\n'));
34 | process.exit(1);
35 | }
36 |
37 | console.log(chalk.cyan(' Build complete.\n'));
38 | console.log(
39 | chalk.yellow(
40 | ' Tip: built files are meant to be served over an HTTP server.\n' +
41 | " Opening index.html over file:// won't work.\n"
42 | )
43 | );
44 | });
45 | });
46 |
--------------------------------------------------------------------------------
/rebugger-service/build/build.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | require('./check-versions')();
3 |
4 | process.env.NODE_ENV = 'production';
5 |
6 | const ora = require('ora');
7 | const rm = require('rimraf');
8 | const path = require('path');
9 | const chalk = require('chalk');
10 | const webpack = require('webpack');
11 | const config = require('../config');
12 | const webpackConfig = require('./webpack.prod.conf');
13 |
14 | const spinner = ora('building for production...');
15 | spinner.start();
16 |
17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18 | if (err) throw err;
19 | webpack(webpackConfig, (err, stats) => {
20 | spinner.stop();
21 | if (err) throw err;
22 | process.stdout.write(
23 | stats.toString({
24 | colors: true,
25 | modules: false,
26 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
27 | chunks: false,
28 | chunkModules: false
29 | }) + '\n\n'
30 | );
31 |
32 | if (stats.hasErrors()) {
33 | console.log(chalk.red(' Build failed with errors.\n'));
34 | process.exit(1);
35 | }
36 |
37 | console.log(chalk.cyan(' Build complete.\n'));
38 | console.log(
39 | chalk.yellow(
40 | ' Tip: built files are meant to be served over an HTTP server.\n' +
41 | " Opening index.html over file:// won't work.\n"
42 | )
43 | );
44 | });
45 | });
46 |
--------------------------------------------------------------------------------
/rebugger-service/build/build.lib.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | require('./check-versions')();
3 |
4 | process.env.NODE_ENV = 'production';
5 |
6 | const ora = require('ora');
7 | const rm = require('rimraf');
8 | const path = require('path');
9 | const chalk = require('chalk');
10 | const webpack = require('webpack');
11 | const config = require('../config');
12 | const webpackConfig = require('./webpack.lib.conf');
13 |
14 | const spinner = ora('building for production...');
15 | spinner.start();
16 |
17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => {
18 | if (err) throw err;
19 | webpack(webpackConfig, (err, stats) => {
20 | spinner.stop();
21 | if (err) throw err;
22 | process.stdout.write(
23 | stats.toString({
24 | colors: true,
25 | modules: false,
26 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build.
27 | chunks: false,
28 | chunkModules: false
29 | }) + '\n\n'
30 | );
31 |
32 | if (stats.hasErrors()) {
33 | console.log(chalk.red(' Build failed with errors.\n'));
34 | process.exit(1);
35 | }
36 |
37 | console.log(chalk.cyan(' Build complete.\n'));
38 | console.log(
39 | chalk.yellow(
40 | ' Tip: built files are meant to be served over an HTTP server.\n' +
41 | " Opening index.html over file:// won't work.\n"
42 | )
43 | );
44 | });
45 | });
46 |
--------------------------------------------------------------------------------
/rebugger-service/build/check-versions.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const chalk = require('chalk')
3 | const semver = require('semver')
4 | const packageConfig = require('../package.json')
5 | const shell = require('shelljs')
6 |
7 | function exec (cmd) {
8 | return require('child_process').execSync(cmd).toString().trim()
9 | }
10 |
11 | const versionRequirements = [
12 | {
13 | name: 'node',
14 | currentVersion: semver.clean(process.version),
15 | versionRequirement: packageConfig.engines.node
16 | }
17 | ]
18 |
19 | if (shell.which('npm')) {
20 | versionRequirements.push({
21 | name: 'npm',
22 | currentVersion: exec('npm --version'),
23 | versionRequirement: packageConfig.engines.npm
24 | })
25 | }
26 |
27 | module.exports = function () {
28 | const warnings = []
29 |
30 | for (let i = 0; i < versionRequirements.length; i++) {
31 | const mod = versionRequirements[i]
32 |
33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
34 | warnings.push(mod.name + ': ' +
35 | chalk.red(mod.currentVersion) + ' should be ' +
36 | chalk.green(mod.versionRequirement)
37 | )
38 | }
39 | }
40 |
41 | if (warnings.length) {
42 | console.log('')
43 | console.log(chalk.yellow('To use this template, you must update following to modules:'))
44 | console.log()
45 |
46 | for (let i = 0; i < warnings.length; i++) {
47 | const warning = warnings[i]
48 | console.log(' ' + warning)
49 | }
50 |
51 | console.log()
52 | process.exit(1)
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/rebugger-service/build/vue-loader.conf.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | const utils = require('./utils')
3 | const config = require('../config')
4 | const isProduction = process.env.NODE_ENV === 'production'
5 | const sourceMapEnabled = isProduction
6 | ? config.build.productionSourceMap
7 | : config.dev.cssSourceMap
8 |
9 | module.exports = {
10 | loaders: utils.cssLoaders({
11 | sourceMap: sourceMapEnabled,
12 | extract: isProduction
13 | }),
14 | cssSourceMap: sourceMapEnabled,
15 | cacheBusting: config.dev.cacheBusting,
16 | transformToRequire: {
17 | video: ['src', 'poster'],
18 | source: 'src',
19 | img: 'src',
20 | image: 'xlink:href'
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/rebugger-service/prod.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | apps: [
3 | {
4 | name: "rebugger-server",
5 | script: "server/build/app.js",
6 | // watch: true,
7 | // watch: [
8 | // // 监控变化的目录,一旦变化,自动重启
9 | // "server"
10 | // ],
11 | instances: "max",
12 | ignore_watch: [
13 | // 从监控目录中排除
14 | "node_modules",
15 | "logs",
16 | "server/logs"
17 | ],
18 | error_file: "./logs/app-err.log", // 错误日志路径
19 | // out_file: "./logs/app-out.log", // 普通日志路径
20 | env: {
21 | NODE_ENV: "development"
22 | },
23 | env_dev: {
24 | NODE_ENV: "development"
25 | },
26 | env_test: {
27 | NODE_ENV: "test"
28 | },
29 | env_prod: {
30 | NODE_ENV: "prod"
31 | }
32 | }
33 | ]
34 | };
35 |
--------------------------------------------------------------------------------
/rebugger-service/server/app.ts:
--------------------------------------------------------------------------------
1 | const Koa = require("koa");
2 | const bodyParser = require("koa-bodyparser");
3 | const app = new Koa();
4 | const koaStatic = require("koa-static");
5 | const path = require("path");
6 | const Router = require("koa-router");
7 | const router = new Router();
8 | const Kcors = require("kcors");
9 | // const koaLogger = require('koa-logger-winston');
10 | // import logger from './src/middleware/logger';
11 |
12 | import sample from './src/router/sample';
13 | import myRouter from './src/router/index';
14 | import errorMiddleware from './src/middleware/error';
15 | import checkMiddleware from './src/middleware/check';
16 |
17 | // 验证是否有token
18 | //POST解析
19 | app.use(bodyParser());
20 | // 跨域设置
21 | const corsOptions = {
22 | origin: "*",
23 | credentials: true,
24 | maxAge: 3600
25 | };
26 | app.use(Kcors(corsOptions));
27 |
28 | app.use(checkMiddleware);
29 | app.use(errorMiddleware());
30 | // console.log(process.env.NODE_ENV);
31 |
32 | if(process.env.NODE_ENV === 'development'){
33 | app.use(koaStatic(path.resolve(__dirname, "./public")));
34 | }else{
35 | app.use(koaStatic(path.resolve(__dirname, "../public")));
36 | }
37 | // 路由配置
38 | router.get("/", sample);
39 | for(var i in myRouter) {
40 | myRouter[i].forEach((item)=>{
41 | if(item.method=='get'){
42 | router.get(item.url, item.function);
43 | }else if(item.method=='post'){
44 | router.post(item.url, item.function);
45 | }
46 | })
47 | }
48 |
49 | //正常请求的日志
50 | // app.use(koaLogger(logger.success));
51 |
52 | app
53 | .use(router.routes()) //把路由都引入进来
54 | .use(router.allowedMethods());
55 |
56 | // 收集错误日志
57 | // app.use(koaLogger(logger.error));
58 |
59 | console.log("listen 9090");
60 | app.listen(9090);
61 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/app.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
4 | };
5 | Object.defineProperty(exports, "__esModule", { value: true });
6 | var Koa = require("koa");
7 | var bodyParser = require("koa-bodyparser");
8 | var app = new Koa();
9 | var koaStatic = require("koa-static");
10 | var path = require("path");
11 | var Router = require("koa-router");
12 | var router = new Router();
13 | var Kcors = require("kcors");
14 | // const koaLogger = require('koa-logger-winston');
15 | // import logger from './src/middleware/logger';
16 | var sample_1 = __importDefault(require("./src/router/sample"));
17 | var index_1 = __importDefault(require("./src/router/index"));
18 | var error_1 = __importDefault(require("./src/middleware/error"));
19 | var check_1 = __importDefault(require("./src/middleware/check"));
20 | // 验证是否有token
21 | //POST解析
22 | app.use(bodyParser());
23 | // 跨域设置
24 | var corsOptions = {
25 | origin: "",
26 | credentials: true,
27 | maxAge: 3600
28 | };
29 | app.use(Kcors(corsOptions));
30 | app.use(check_1.default);
31 | app.use(error_1.default());
32 | // console.log(process.env.NODE_ENV);
33 | if (process.env.NODE_ENV === 'development') {
34 | app.use(koaStatic(path.resolve(__dirname, "./public")));
35 | }
36 | else {
37 | app.use(koaStatic(path.resolve(__dirname, "../public")));
38 | }
39 | // 路由配置
40 | router.get("/", sample_1.default);
41 | for (var i in index_1.default) {
42 | index_1.default[i].forEach(function (item) {
43 | if (item.method == 'get') {
44 | router.get(item.url, item.function);
45 | }
46 | else if (item.method == 'post') {
47 | router.post(item.url, item.function);
48 | }
49 | });
50 | }
51 | //正常请求的日志
52 | // app.use(koaLogger(logger.success));
53 | app
54 | .use(router.routes()) //把路由都引入进来
55 | .use(router.allowedMethods());
56 | // 收集错误日志
57 | // app.use(koaLogger(logger.error));
58 | console.log("listen 9090");
59 | app.listen(9090);
60 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/config/default.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | exports.default = {
4 | port: 3000,
5 | database: {
6 | HOST: '127.0.0.1',
7 | PORT: '3306',
8 | USER: 'root',
9 | PASSWORD: '18819640516',
10 | DATABASE: 'front_logger_db' //选中数据库
11 | },
12 | useRedis: true,
13 | redis: {
14 | exprires: 60000 * 5,
15 | port: 6379,
16 | host: "127.0.0.1",
17 | password: "",
18 | prefix: "front-logger:",
19 | keyPrefix: "front-logger:" // 存诸前缀
20 | },
21 | secret: "gesafe",
22 | // 生产环境配置文件
23 | prod: {
24 | database: {
25 | HOST: 'rm-2ze8wa1j31ay60omx.mysql.rds.aliyuncs.com',
26 | PORT: '3306',
27 | USER: 'front_logger_db',
28 | PASSWORD: 'front_logger_db!@#QWE',
29 | DATABASE: 'front_logger_db' //选中数据库
30 | },
31 | redis: {
32 | exprires: 60000 * 5,
33 | port: 6379,
34 | host: "r-2zeoy97gwck0jyyv6s.redis.rds.aliyuncs.com",
35 | password: "sKzJedjM5OsWr2Ra",
36 | prefix: "front-logger:",
37 | keyPrefix: "front-logger:" // 存诸前缀
38 | }
39 | },
40 | // daditest
41 | test: {
42 | database: {
43 | HOST: 'rm-8vb94upn9y782wh4e20800.mysql.zhangbei.rds.aliyuncs.com',
44 | PORT: '3306',
45 | USER: 'front_logger_db',
46 | PASSWORD: 'front_logger_db!@#QWE',
47 | DATABASE: 'front_logger_db' //选中数据库
48 | },
49 | redis: {
50 | exprires: 60000 * 5,
51 | port: 6379,
52 | host: "r-8vby8jsgwho40hv6y1.redis.zhangbei.rds.aliyuncs.com",
53 | password: "dVzVkKjUnAs4pXBD",
54 | prefix: "front-logger:",
55 | keyPrefix: "front-logger:" // 存诸前缀
56 | }
57 | }
58 | };
59 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/base/model/baseModel.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | /**
3 | * 基础实例类
4 | */
5 | Object.defineProperty(exports, "__esModule", { value: true });
6 | var BaseEntity = /** @class */ (function () {
7 | function BaseEntity(id, updateDate, createDate) {
8 | this.id = id;
9 | this.updateDate = updateDate;
10 | this.createDate = createDate;
11 | }
12 | return BaseEntity;
13 | }());
14 | exports.default = BaseEntity;
15 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/comment/schema/commentSchema.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | function default_1(sequelize, DataTypes) {
4 | return sequelize.define("comment", {
5 | id: {
6 | type: DataTypes.STRING,
7 | allowNull: false,
8 | primaryKey: true,
9 | comment: "主键"
10 | },
11 | title: {
12 | type: DataTypes.STRING,
13 | allowNull: true,
14 | comment: "评论标题、名称"
15 | },
16 | type: {
17 | type: DataTypes.STRING,
18 | allowNull: true,
19 | comment: "类型 现在只有异常解决类型"
20 | },
21 | content: {
22 | type: DataTypes.TEXT,
23 | allowNull: true,
24 | comment: "内容"
25 | },
26 | bId: {
27 | type: DataTypes.STRING,
28 | allowNull: true,
29 | comment: "业务ID"
30 | },
31 | bName: {
32 | type: DataTypes.STRING,
33 | allowNull: true,
34 | comment: "业务名称"
35 | }
36 | }, {
37 | tableName: "comment",
38 | createdAt: false,
39 | updatedAt: false //去掉默认字段
40 | });
41 | }
42 | exports.default = default_1;
43 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/ipAuth/schema/ipAuthSchema.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | function default_1(sequelize, DataTypes) {
4 | return sequelize.define("ip_auth", {
5 | id: {
6 | type: DataTypes.STRING,
7 | allowNull: false,
8 | primaryKey: true,
9 | comment: "主键"
10 | },
11 | name: {
12 | type: DataTypes.STRING,
13 | allowNull: false,
14 | comment: "环境名称"
15 | },
16 | type: {
17 | type: DataTypes.INTEGER,
18 | allowNull: true,
19 | comment: "类型 1 允许访问的域名 2 禁止访问的域名 3 禁止ip列表"
20 | },
21 | domain: {
22 | type: DataTypes.TEXT,
23 | allowNull: false,
24 | comment: "允许域名JSON数据"
25 | },
26 | description: {
27 | type: DataTypes.STRING(1024),
28 | allowNull: true,
29 | comment: "描述"
30 | },
31 | createDate: {
32 | type: DataTypes.DATE,
33 | allowNull: true,
34 | primaryKey: false,
35 | // field: "create_date",
36 | comment: "创建日期"
37 | },
38 | updateDate: {
39 | type: DataTypes.DATE,
40 | allowNull: true,
41 | primaryKey: false,
42 | // field: "update_date",
43 | comment: "修改日期"
44 | }
45 | }, {
46 | tableName: "ip_auth",
47 | createdAt: false,
48 | updatedAt: false //去掉默认字段
49 | });
50 | }
51 | exports.default = default_1;
52 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/perform/schema/performSchema.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | function default_1(sequelize, DataTypes) {
4 | return sequelize.define("perform", {
5 | id: {
6 | type: DataTypes.STRING,
7 | allowNull: false,
8 | primaryKey: true,
9 | comment: "主键"
10 | },
11 | type: {
12 | type: DataTypes.STRING,
13 | allowNull: true,
14 | comment: "类型"
15 | }
16 | }, {
17 | tableName: "perform",
18 | createdAt: false,
19 | updatedAt: false //去掉默认字段
20 | });
21 | }
22 | exports.default = default_1;
23 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/system/auth/model/user.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | var User = /** @class */ (function () {
4 | function User() {
5 | }
6 | return User;
7 | }());
8 | exports.default = User;
9 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/system/config/schema/configSchema.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | function default_1(sequelize, DataTypes) {
4 | return sequelize.define("sys_config", {
5 | id: {
6 | type: DataTypes.STRING(64),
7 | allowNull: false,
8 | primaryKey: true,
9 | comment: "主键"
10 | },
11 | paramKey: {
12 | type: DataTypes.STRING,
13 | allowNull: false,
14 | comment: "key"
15 | },
16 | paramValue: {
17 | type: DataTypes.STRING,
18 | allowNull: false,
19 | comment: "value"
20 | },
21 | remark: {
22 | type: DataTypes.TEXT,
23 | allowNull: true,
24 | comment: "备注"
25 | },
26 | retainField1: {
27 | type: DataTypes.STRING,
28 | allowNull: true,
29 | comment: "保留字段"
30 | },
31 | isDel: {
32 | type: DataTypes.INTEGER,
33 | allowNull: true,
34 | comment: "物理删除 0 不删除 1 删除"
35 | },
36 | createDate: {
37 | type: DataTypes.DATE,
38 | allowNull: true,
39 | primaryKey: false,
40 | // field: "create_date",
41 | comment: "创建日期"
42 | },
43 | updateDate: {
44 | type: DataTypes.DATE,
45 | allowNull: true,
46 | primaryKey: false,
47 | // field: "update_date",
48 | comment: "修改日期"
49 | }
50 | }, {
51 | tableName: "sys_config",
52 | createdAt: false,
53 | updatedAt: false //去掉默认字段
54 | });
55 | }
56 | exports.default = default_1;
57 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/system/config/service/configService.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __importDefault = (this && this.__importDefault) || function (mod) {
16 | return (mod && mod.__esModule) ? mod : { "default": mod };
17 | };
18 | Object.defineProperty(exports, "__esModule", { value: true });
19 | var baseService_1 = __importDefault(require("../../../base/service/baseService"));
20 | var mysql_1 = __importDefault(require("../../../../utils/mysql"));
21 | var sequelize_1 = __importDefault(require("sequelize"));
22 | var configSchema_1 = __importDefault(require("../schema/configSchema"));
23 | var configDao = configSchema_1.default(mysql_1.default, sequelize_1.default);
24 | // 重新生成表
25 | // configDao.sync({ alter: true, force: true });
26 | var ConfigService = /** @class */ (function (_super) {
27 | __extends(ConfigService, _super);
28 | function ConfigService() {
29 | return _super.call(this, configDao) || this;
30 | }
31 | return ConfigService;
32 | }(baseService_1.default));
33 | var configService = new ConfigService();
34 | exports.default = configService;
35 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/system/dict/controller/dictController.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __importDefault = (this && this.__importDefault) || function (mod) {
16 | return (mod && mod.__esModule) ? mod : { "default": mod };
17 | };
18 | Object.defineProperty(exports, "__esModule", { value: true });
19 | var dictService_1 = __importDefault(require("../service/dictService"));
20 | var baseController_1 = __importDefault(require("../../../base/controller/baseController"));
21 | var DictController = /** @class */ (function (_super) {
22 | __extends(DictController, _super);
23 | function DictController(entityService, prefix, option) {
24 | return _super.call(this, entityService, prefix, option) || this;
25 | }
26 | /**
27 | * getCustomRouter
28 | * 自定义扩展路由
29 | */
30 | DictController.prototype.getCustomRouter = function () {
31 | return [
32 | // 自定义扩展
33 | // {
34 | // url: this.profix + "/info",
35 | // method: "post",
36 | // function: async (ctx: Context) => {}
37 | // }
38 | ];
39 | };
40 | return DictController;
41 | }(baseController_1.default));
42 | var dictController = new DictController(dictService_1.default, "/api/dict", {
43 | infoCacheable: false,
44 | findCacheable: false
45 | });
46 | var dictRouter = dictController
47 | .getBaseRouter()
48 | .concat(dictController.getCustomRouter());
49 | exports.default = dictRouter;
50 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/system/dict/service/dictService.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __importDefault = (this && this.__importDefault) || function (mod) {
16 | return (mod && mod.__esModule) ? mod : { "default": mod };
17 | };
18 | Object.defineProperty(exports, "__esModule", { value: true });
19 | var baseService_1 = __importDefault(require("../../../base/service/baseService"));
20 | var mysql_1 = __importDefault(require("../../../../utils/mysql"));
21 | var sequelize_1 = __importDefault(require("sequelize"));
22 | var dictSchema_1 = __importDefault(require("../schema/dictSchema"));
23 | var dictDao = dictSchema_1.default(mysql_1.default, sequelize_1.default);
24 | // 重新生成表
25 | // dictDao.sync({ alter: true, force: true });
26 | var DictService = /** @class */ (function (_super) {
27 | __extends(DictService, _super);
28 | function DictService() {
29 | return _super.call(this, dictDao) || this;
30 | }
31 | return DictService;
32 | }(baseService_1.default));
33 | var dictService = new DictService();
34 | exports.default = dictService;
35 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/system/menu/controller/menuController.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __importDefault = (this && this.__importDefault) || function (mod) {
16 | return (mod && mod.__esModule) ? mod : { "default": mod };
17 | };
18 | Object.defineProperty(exports, "__esModule", { value: true });
19 | var menuService_1 = __importDefault(require("../service/menuService"));
20 | var baseController_1 = __importDefault(require("../../../base/controller/baseController"));
21 | var MenuController = /** @class */ (function (_super) {
22 | __extends(MenuController, _super);
23 | function MenuController(entityService, prefix, option) {
24 | return _super.call(this, entityService, prefix, option) || this;
25 | }
26 | /**
27 | * getCustomRouter
28 | * 自定义扩展路由
29 | */
30 | MenuController.prototype.getCustomRouter = function () {
31 | return [
32 | // 自定义扩展
33 | // {
34 | // url: this.profix + "/info",
35 | // method: "post",
36 | // function: async (ctx: Context) => {}
37 | // }
38 | ];
39 | };
40 | return MenuController;
41 | }(baseController_1.default));
42 | var menuController = new MenuController(menuService_1.default, "/api/menu", {
43 | infoCacheable: false,
44 | findCacheable: false
45 | });
46 | var menuRouter = menuController
47 | .getBaseRouter()
48 | .concat(menuController.getCustomRouter());
49 | exports.default = menuRouter;
50 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/system/menu/service/menuService.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __importDefault = (this && this.__importDefault) || function (mod) {
16 | return (mod && mod.__esModule) ? mod : { "default": mod };
17 | };
18 | Object.defineProperty(exports, "__esModule", { value: true });
19 | var baseService_1 = __importDefault(require("../../../base/service/baseService"));
20 | var mysql_1 = __importDefault(require("../../../../utils/mysql"));
21 | var sequelize_1 = __importDefault(require("sequelize"));
22 | var menuSchema_1 = __importDefault(require("../schema/menuSchema"));
23 | var MenuDao = menuSchema_1.default(mysql_1.default, sequelize_1.default);
24 | // 重新生成表
25 | // MenuDao.sync({ alter: true, force: true });
26 | var MenuService = /** @class */ (function (_super) {
27 | __extends(MenuService, _super);
28 | function MenuService() {
29 | return _super.call(this, MenuDao) || this;
30 | }
31 | return MenuService;
32 | }(baseService_1.default));
33 | var menuService = new MenuService();
34 | exports.default = menuService;
35 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/system/org/controller/orgController.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __importDefault = (this && this.__importDefault) || function (mod) {
16 | return (mod && mod.__esModule) ? mod : { "default": mod };
17 | };
18 | Object.defineProperty(exports, "__esModule", { value: true });
19 | var orgService_1 = __importDefault(require("../service/orgService"));
20 | var baseController_1 = __importDefault(require("../../../base/controller/baseController"));
21 | var OrgController = /** @class */ (function (_super) {
22 | __extends(OrgController, _super);
23 | function OrgController(entityService, prefix, option) {
24 | return _super.call(this, entityService, prefix, option) || this;
25 | }
26 | /**
27 | * getCustomRouter
28 | * 自定义扩展路由
29 | */
30 | OrgController.prototype.getCustomRouter = function () {
31 | return [
32 | // 自定义扩展
33 | // {
34 | // url: this.profix + "/info",
35 | // method: "post",
36 | // function: async (ctx: Context) => {}
37 | // }
38 | ];
39 | };
40 | return OrgController;
41 | }(baseController_1.default));
42 | var orgController = new OrgController(orgService_1.default, "/api/org", {
43 | infoCacheable: false,
44 | findCacheable: false
45 | });
46 | var orgRouter = orgController
47 | .getBaseRouter()
48 | .concat(orgController.getCustomRouter());
49 | exports.default = orgRouter;
50 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/system/org/service/orgService.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __importDefault = (this && this.__importDefault) || function (mod) {
16 | return (mod && mod.__esModule) ? mod : { "default": mod };
17 | };
18 | Object.defineProperty(exports, "__esModule", { value: true });
19 | var baseService_1 = __importDefault(require("../../../base/service/baseService"));
20 | var mysql_1 = __importDefault(require("../../../../utils/mysql"));
21 | var sequelize_1 = __importDefault(require("sequelize"));
22 | var orgSchema_1 = __importDefault(require("../schema/orgSchema"));
23 | var OrgDao = orgSchema_1.default(mysql_1.default, sequelize_1.default);
24 | // 重新生成表
25 | // OrgDao.sync({ alter: true, force: true });
26 | var OrgService = /** @class */ (function (_super) {
27 | __extends(OrgService, _super);
28 | function OrgService() {
29 | return _super.call(this, OrgDao) || this;
30 | }
31 | return OrgService;
32 | }(baseService_1.default));
33 | var orgService = new OrgService();
34 | exports.default = orgService;
35 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/system/role/controller/roleController.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __importDefault = (this && this.__importDefault) || function (mod) {
16 | return (mod && mod.__esModule) ? mod : { "default": mod };
17 | };
18 | Object.defineProperty(exports, "__esModule", { value: true });
19 | var roleService_1 = __importDefault(require("../service/roleService"));
20 | var baseController_1 = __importDefault(require("../../../base/controller/baseController"));
21 | var RoleController = /** @class */ (function (_super) {
22 | __extends(RoleController, _super);
23 | function RoleController(entityService, prefix, option) {
24 | return _super.call(this, entityService, prefix, option) || this;
25 | }
26 | /**
27 | * getCustomRouter
28 | * 自定义扩展路由
29 | */
30 | RoleController.prototype.getCustomRouter = function () {
31 | return [
32 | // 自定义扩展
33 | // {
34 | // url: this.profix + "/info",
35 | // method: "post",
36 | // function: async (ctx: Context) => {}
37 | // }
38 | ];
39 | };
40 | return RoleController;
41 | }(baseController_1.default));
42 | var roleController = new RoleController(roleService_1.default, "/api/role", {
43 | infoCacheable: false,
44 | findCacheable: false
45 | });
46 | var roleRouter = roleController
47 | .getBaseRouter()
48 | .concat(roleController.getCustomRouter());
49 | exports.default = roleRouter;
50 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/system/role/schema/roleMenuSchema.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | function default_1(sequelize, DataTypes) {
4 | return sequelize.define("sys_role_menu", {
5 | id: {
6 | type: DataTypes.STRING(64),
7 | allowNull: false,
8 | primaryKey: true,
9 | comment: "主键"
10 | },
11 | roleId: {
12 | type: DataTypes.STRING(64),
13 | allowNull: false,
14 | comment: "角色Id"
15 | },
16 | menuId: {
17 | type: DataTypes.STRING(64),
18 | allowNull: false,
19 | comment: "菜单Id"
20 | },
21 | createDate: {
22 | type: DataTypes.DATE,
23 | allowNull: true,
24 | primaryKey: false,
25 | // field: "create_date",
26 | comment: "创建日期"
27 | }
28 | }, {
29 | tableName: "sys_role_menu",
30 | createdAt: false,
31 | updatedAt: false //去掉默认字段
32 | });
33 | }
34 | exports.default = default_1;
35 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/system/role/schema/roleSchema.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | function default_1(sequelize, DataTypes) {
4 | return sequelize.define("sys_role", {
5 | id: {
6 | type: DataTypes.STRING(64),
7 | allowNull: false,
8 | primaryKey: true,
9 | comment: "主键"
10 | },
11 | name: {
12 | type: DataTypes.STRING,
13 | allowNull: false,
14 | comment: "角色名称"
15 | },
16 | remark: {
17 | type: DataTypes.TEXT,
18 | allowNull: true,
19 | comment: "备注"
20 | },
21 | isAdmin: {
22 | type: DataTypes.INTEGER,
23 | allowNull: true,
24 | comment: "是否为管理员"
25 | },
26 | retainField1: {
27 | type: DataTypes.STRING,
28 | allowNull: true,
29 | comment: "保留字段"
30 | },
31 | retainField2: {
32 | type: DataTypes.STRING,
33 | allowNull: true,
34 | comment: "保留字段"
35 | },
36 | retainField3: {
37 | type: DataTypes.STRING,
38 | allowNull: true,
39 | comment: "保留字段"
40 | },
41 | createDate: {
42 | type: DataTypes.DATE,
43 | allowNull: true,
44 | primaryKey: false,
45 | // field: "create_date",
46 | comment: "创建日期"
47 | },
48 | updateDate: {
49 | type: DataTypes.DATE,
50 | allowNull: true,
51 | primaryKey: false,
52 | // field: "update_date",
53 | comment: "修改日期"
54 | }
55 | }, {
56 | tableName: "sys_role",
57 | createdAt: false,
58 | updatedAt: false //去掉默认字段
59 | });
60 | }
61 | exports.default = default_1;
62 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/system/role/service/roleService.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __extends = (this && this.__extends) || (function () {
3 | var extendStatics = function (d, b) {
4 | extendStatics = Object.setPrototypeOf ||
5 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 | return extendStatics(d, b);
8 | };
9 | return function (d, b) {
10 | extendStatics(d, b);
11 | function __() { this.constructor = d; }
12 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13 | };
14 | })();
15 | var __importDefault = (this && this.__importDefault) || function (mod) {
16 | return (mod && mod.__esModule) ? mod : { "default": mod };
17 | };
18 | Object.defineProperty(exports, "__esModule", { value: true });
19 | var baseService_1 = __importDefault(require("../../../base/service/baseService"));
20 | var mysql_1 = __importDefault(require("../../../../utils/mysql"));
21 | var sequelize_1 = __importDefault(require("sequelize"));
22 | var roleSchema_1 = __importDefault(require("../schema/roleSchema"));
23 | var roleMenuSchema_1 = __importDefault(require("..//schema/roleMenuSchema"));
24 | var RoleDao = roleSchema_1.default(mysql_1.default, sequelize_1.default);
25 | // 用于更新角色 批量保存角色 菜单关联表
26 | var RoleMenuDao = roleMenuSchema_1.default(mysql_1.default, sequelize_1.default);
27 | // 重新生成表
28 | // RoleDao.sync({ alter: true, force: true });
29 | // RoleMenuDao.sync({ alter: true, force: true });
30 | var RoleService = /** @class */ (function (_super) {
31 | __extends(RoleService, _super);
32 | function RoleService() {
33 | return _super.call(this, RoleDao) || this;
34 | }
35 | return RoleService;
36 | }(baseService_1.default));
37 | var roleService = new RoleService();
38 | exports.default = roleService;
39 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/module/system/user/schema/userRoleSchema.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | function default_1(sequelize, DataTypes) {
4 | return sequelize.define("sys_user_role", {
5 | id: {
6 | type: DataTypes.STRING(64),
7 | allowNull: false,
8 | primaryKey: true,
9 | comment: "主键"
10 | },
11 | roleId: {
12 | type: DataTypes.STRING(64),
13 | allowNull: false,
14 | comment: "角色Id"
15 | },
16 | userId: {
17 | type: DataTypes.STRING(64),
18 | allowNull: false,
19 | comment: "用户Id"
20 | },
21 | createDate: {
22 | type: DataTypes.DATE,
23 | allowNull: true,
24 | primaryKey: false,
25 | // field: "create_date",
26 | comment: "创建日期"
27 | }
28 | }, {
29 | tableName: "sys_user_role",
30 | createdAt: false,
31 | updatedAt: false //去掉默认字段
32 | });
33 | }
34 | exports.default = default_1;
35 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/router/index.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
4 | };
5 | Object.defineProperty(exports, "__esModule", { value: true });
6 | var userController_1 = __importDefault(require("../module/system/user/controller/userController"));
7 | var authController_1 = __importDefault(require("../module/system/auth/controller/authController"));
8 | var reportController_1 = __importDefault(require("../module/report/controller/reportController"));
9 | var projectController_1 = __importDefault(require("../module/project/controller/projectController"));
10 | var ipAuthController_1 = __importDefault(require("../module/ipAuth/controller/ipAuthController"));
11 | var roleController_1 = __importDefault(require("../module/system/role/controller/roleController"));
12 | var menuController_1 = __importDefault(require("../module/system/menu/controller/menuController"));
13 | var orgController_1 = __importDefault(require("../module/system/org/controller/orgController"));
14 | var configController_1 = __importDefault(require("../module/system/config/controller/configController"));
15 | var dictController_1 = __importDefault(require("../module/system/dict/controller/dictController"));
16 | var dashboardController_1 = __importDefault(require("../module/dashboard/controller/dashboardController"));
17 | exports.default = {
18 | userController: userController_1.default,
19 | authController: authController_1.default,
20 | reportController: reportController_1.default,
21 | projectController: projectController_1.default,
22 | ipAuthController: ipAuthController_1.default,
23 | roleController: roleController_1.default,
24 | menuController: menuController_1.default,
25 | orgController: orgController_1.default,
26 | configController: configController_1.default,
27 | dictController: dictController_1.default,
28 | dashboardController: dashboardController_1.default
29 | };
30 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/router/router.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | exports.default = {
4 | getName: function () { }
5 | };
6 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/router/sample.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | Object.defineProperty(exports, "__esModule", { value: true });
3 | var main = function (ctx) {
4 | ctx.response.body = 'front-logger';
5 | };
6 | exports.default = main;
7 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/utils/mysql.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
4 | };
5 | Object.defineProperty(exports, "__esModule", { value: true });
6 | var Sequelize = require("sequelize");
7 | // const config = require("../../config/default");
8 | var default_1 = __importDefault(require("../../config/default"));
9 | // console.log(process.env.NODE_ENV);
10 | var localConfig = default_1.default;
11 | if (process.env.NODE_ENV == "test") {
12 | localConfig = default_1.default.test;
13 | }
14 | else if (process.env.NODE_ENV == "prod") {
15 | localConfig = default_1.default.prod;
16 | }
17 | // console.log(localConfig);
18 | // const mysql = new Sequelize(config.mysql.default, {
19 | // define: {
20 | // timestamps: false,
21 | // },
22 | // operatorsAliases: false
23 | // });
24 | var sequelized = new Sequelize(localConfig.database.DATABASE, localConfig.database.USER, localConfig.database.PASSWORD, {
25 | host: localConfig.database.HOST,
26 | dialect: "mysql",
27 | pool: {
28 | max: 5,
29 | min: 0,
30 | idle: 30000
31 | },
32 | // 添加这个配置 格式化日期
33 | dialectOptions: {
34 | dateStrings: true,
35 | typeCast: true
36 | },
37 | 'define': {
38 | // 字段以下划线(_)来分割(默认是驼峰命名风格)
39 | 'underscored': true
40 | },
41 | // 时区东八区
42 | timezone: '+08:00'
43 | });
44 | exports.default = sequelized;
45 |
--------------------------------------------------------------------------------
/rebugger-service/server/build/src/utils/redis.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
4 | };
5 | Object.defineProperty(exports, "__esModule", { value: true });
6 | /* eslint-disable quotes */
7 | var Redis = require("ioredis");
8 | var default_1 = __importDefault(require("../../config/default"));
9 | console.log("NODE_ENV: " + process.env.NODE_ENV);
10 | var localConfig = default_1.default;
11 | if (process.env.NODE_ENV == "test") {
12 | localConfig = default_1.default.test;
13 | }
14 | else if (process.env.NODE_ENV == "prod") {
15 | localConfig = default_1.default.prod;
16 | }
17 | // console.log(localConfig);
18 | var redis = {
19 | port: localConfig.redis.port,
20 | host: localConfig.redis.host,
21 | password: localConfig.redis.password,
22 | prefix: localConfig.redis.prefix,
23 | keyPrefix: localConfig.redis.keyPrefix,
24 | ttl: 60 * 60 * 23,
25 | family: 4,
26 | db: 0
27 | };
28 | var newRedis = new Redis(redis);
29 | module.exports = newRedis;
30 |
--------------------------------------------------------------------------------
/rebugger-service/server/config/default.ts:
--------------------------------------------------------------------------------
1 | export default{
2 | port: 3000,
3 | database: {
4 | HOST: '127.0.0.1', //数据库地址
5 | PORT: '3306',
6 | USER: 'root', //数据库用户
7 | PASSWORD: '18819640516', //数据库密码
8 | DATABASE: 'front_logger_db' //选中数据库
9 | },
10 | useRedis:true, // 缓存使用 redis
11 | redis:{
12 | exprires:60000 * 5, //默认缓存时间 单位ms 本地缓存ms单位 redis设置s 已在redis工具统一使用ms
13 | port: 6379, // Redis port
14 | host: "127.0.0.1", // Redis host
15 | password: "",
16 | prefix: "front-logger:", // 存诸前缀
17 | keyPrefix: "front-logger:" // 存诸前缀
18 | },
19 | secret:"gesafe",
20 | // 生产环境配置文件
21 | prod: {
22 | database: {
23 | HOST: 'xxxxxx.com', //数据库地址
24 | PORT: '3306',
25 | USER: 'front_logger_db', //数据库用户
26 | PASSWORD: 'xxxx', //数据库密码
27 | DATABASE: 'front_logger_db' //选中数据库
28 | },
29 | redis:{
30 | exprires:60000 * 5, //默认缓存时间 单位ms 本地缓存ms单位 redis设置s 已在redis工具统一使用ms
31 | port: 6379, // Redis port
32 | host: "xxxx.com", // Redis host
33 | password: "xxxxx",
34 | prefix: "front-logger:", // 存诸前缀
35 | keyPrefix: "front-logger:" // 存诸前缀
36 | }
37 | },
38 | // test
39 | test: {
40 | database: {
41 | HOST: 'xxxxxx.com', //数据库地址
42 | PORT: '3306',
43 | USER: 'front_logger_db', //数据库用户
44 | PASSWORD: 'xxxxx', //数据库密码
45 | DATABASE: 'front_logger_db' //选中数据库
46 | },
47 | redis:{
48 | exprires:60000 * 5, //默认缓存时间 单位ms 本地缓存ms单位 redis设置s 已在redis工具统一使用ms
49 | port: 6379, // Redis port
50 | host: "xxxxx.com", // Redis host
51 | password: "xxxxx",
52 | prefix: "front-logger:", // 存诸前缀
53 | keyPrefix: "front-logger:" // 存诸前缀
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/rebugger-service/server/public/1.txt:
--------------------------------------------------------------------------------
1 | 日志,权限
--------------------------------------------------------------------------------
/rebugger-service/server/public/SQL语句.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/purestart/rebugger/e68a2dc4e2a49fb6e509f744c472203962b00e3a/rebugger-service/server/public/SQL语句.txt
--------------------------------------------------------------------------------
/rebugger-service/server/public/script.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/rebugger-service/server/public/static/app.css:
--------------------------------------------------------------------------------
1 | .app{
2 | color: #fefefe;
3 | }
--------------------------------------------------------------------------------
/rebugger-service/server/src/middleware/check.ts:
--------------------------------------------------------------------------------
1 | const bluebird = require("bluebird");
2 | const jwt = require("jsonwebtoken");
3 | const verify = bluebird.promisify(jwt.verify);
4 | import config from "../../config/default";
5 |
6 | async function check(ctx, next) {
7 | let url = ctx.request.url;
8 | // 登录 和上报 不用检查 url.indexOf("/report/") != -1
9 | if (url == "/api/auth/login" || url == "/api/report/create" || url == "/api/report/createList") await next();
10 | else {
11 | // 规定token写在header 的 'autohrization'
12 | let token = ctx.request.headers["token"];
13 | // console.log(token);
14 | if (!token) {
15 | //没有token
16 | ctx.body = {
17 | code: 401,
18 | status: 401,
19 | message: "没有token"
20 | };
21 | } else {
22 | try {
23 | // 解码
24 | let payload = await verify(token, config.secret);
25 | let { time, timeout } = payload;
26 | // console.log(payload);
27 | let data = new Date().getTime();
28 | if (data - time <= timeout) {
29 | // 未过期
30 | await next();
31 | } else {
32 | //过期
33 | ctx.body = {
34 | code: 401,
35 | status: 401,
36 | message: "token 已过期"
37 | };
38 | }
39 | } catch (error) {
40 | console.log(error);
41 | //过期
42 | ctx.body = {
43 | code: 401,
44 | status: 401,
45 | message: "无效的token"
46 | };
47 | }
48 | }
49 | }
50 | }
51 |
52 | export default check;
53 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/middleware/error.ts:
--------------------------------------------------------------------------------
1 | import { Context } from 'koa';
2 | // import * as compose from 'koa-compose';
3 | let compose = require("koa-compose");
4 | import logger from './logger';
5 | // var process = require('child_process');
6 |
7 | const handler = async (ctx: Context, next: () => void) => {
8 | try {
9 | await next();
10 | } catch (error) {
11 | // ctx.log.error(error);
12 | // console.log(process.env.NODE_ENV);
13 | if (!process.env.NODE_ENV || process.env.NODE_ENV === 'development') {
14 | console.log("异常捕获", error);
15 | }
16 |
17 | // let errMsg = "";
18 | // console.log(ctx.request.body);
19 | let errorObj ={
20 | message:"",
21 | url:ctx.request.url,
22 | method:ctx.request.method,
23 | body:JSON.stringify(ctx.request.body),
24 | query:JSON.stringify(ctx.request.query),
25 | stack:""
26 | }
27 | if (error.isBoom) {
28 | errorObj.message = error.output.payload;
29 | ctx.body = {
30 | code:503,
31 | data:error.stack,
32 | message:error.output.payload
33 | };
34 | // ctx.status = error.output.statusCode;
35 | ctx.status = 200;
36 |
37 | } else {
38 | // General Exception
39 | let errMsg =error.message +": "+ (error.parent ? error.parent.message:'');
40 | errorObj.message = errMsg;
41 | ctx.body = {
42 | code:503,
43 | data:error.stack,
44 | message:errMsg
45 | };
46 | // ctx.status = error.statusCode || 500;
47 | ctx.status = 200;
48 |
49 | }
50 | logger.logger.log("error", errorObj);
51 | return;
52 | }
53 | };
54 |
55 | export default () => compose([
56 | handler,
57 | ]);
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/base/model/baseModel.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * 基础实例类
3 | */
4 |
5 | export default abstract class BaseEntity {
6 |
7 | public id: string;
8 |
9 | public updateDate: string;
10 |
11 | public createDate: string;
12 |
13 | constructor(id: string, updateDate: string, createDate:string) {
14 | this.id = id;
15 | this.updateDate = updateDate;
16 | this.createDate = createDate;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/comment/schema/commentSchema.ts:
--------------------------------------------------------------------------------
1 | export default function(sequelize: any, DataTypes: any) {
2 | return sequelize.define(
3 | "comment",
4 | {
5 | id: {
6 | type: DataTypes.STRING,
7 | allowNull: false,
8 | primaryKey: true,
9 | comment:"主键"
10 | },
11 | title:{
12 | type: DataTypes.STRING,
13 | allowNull: true,
14 | comment:"评论标题、名称"
15 | },
16 | type:{
17 | type: DataTypes.STRING,
18 | allowNull: true,
19 | comment:"类型 现在只有异常解决类型"
20 | },
21 | content:{
22 | type: DataTypes.TEXT,
23 | allowNull: true,
24 | comment:"内容"
25 | },
26 | bId:{
27 | type: DataTypes.STRING,
28 | allowNull: true,
29 | comment:"业务ID"
30 | },
31 | bName:{
32 | type: DataTypes.STRING,
33 | allowNull: true,
34 | comment:"业务名称"
35 | }
36 | },
37 | {
38 | tableName: "comment",
39 | createdAt: false, //去掉默认字段
40 | updatedAt: false //去掉默认字段
41 | }
42 | );
43 | }
44 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/dashboard/controller/dashboardController.ts:
--------------------------------------------------------------------------------
1 | import dashboardService from '../service/dashboardService';
2 | import { Context } from 'koa';
3 |
4 | export default [
5 | {
6 | url: "/api/dashboard/statInfo",
7 | method: "post",
8 | function: async (ctx: Context) => {
9 | let params:any = ctx.request.body;
10 | let ret = await dashboardService.stat(params);
11 | if(ret){
12 | ctx.body={
13 | code:200,
14 | data:ret
15 | };
16 | }else{
17 | ctx.response.body = {
18 | code: 503,
19 | data: null,
20 | message: "服务器异常,请稍后再试"
21 | };
22 | }
23 | }
24 | }
25 | ]
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/ipAuth/controller/ipAuthController.ts:
--------------------------------------------------------------------------------
1 | import IpAuthService from "../service/ipAuthService";
2 | import BaseController from "../../base/controller/baseController";
3 | import { Context } from "koa";
4 |
5 | class IpAuthController extends BaseController {
6 | constructor(entityService, prefix, option?: any) {
7 | super(entityService, prefix, option);
8 | }
9 |
10 | /**
11 | * getCustomRouter
12 | * 自定义扩展路由
13 | */
14 | public getCustomRouter() {
15 | return [
16 | // 自定义扩展
17 | // {
18 | // url: this.profix + "/info",
19 | // method: "post",
20 | // function: async (ctx: Context) => {}
21 | // }
22 | ];
23 | }
24 | }
25 |
26 | let ipAuthController = new IpAuthController(IpAuthService, "/ipAuth", {
27 | infoCacheable: true,
28 | findCacheable: false
29 | });
30 | let projectRouter = ipAuthController
31 | .getBaseRouter()
32 | .concat(ipAuthController.getCustomRouter());
33 |
34 | export default projectRouter;
35 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/ipAuth/schema/ipAuthSchema.ts:
--------------------------------------------------------------------------------
1 | export default function(sequelize: any, DataTypes: any) {
2 | return sequelize.define(
3 | "ip_auth",
4 | {
5 | id: {
6 | type: DataTypes.STRING,
7 | allowNull: false,
8 | primaryKey: true,
9 | comment:"主键"
10 | },
11 | name:{
12 | type: DataTypes.STRING,
13 | allowNull: false,
14 | comment:"环境名称"
15 | },
16 | type:{
17 | type: DataTypes.INTEGER,
18 | allowNull: true,
19 | comment:"类型 1 允许访问的域名 2 禁止访问的域名 3 禁止ip列表"
20 | },
21 | domain:{
22 | type: DataTypes.TEXT,
23 | allowNull: false,
24 | comment:"允许域名JSON数据"
25 | },
26 | description:{
27 | type: DataTypes.STRING(1024),
28 | allowNull: true,
29 | comment:"描述"
30 | },
31 | createDate: {
32 | type: DataTypes.DATE,
33 | allowNull: true,
34 | primaryKey: false,
35 | // field: "create_date",
36 | comment:"创建日期"
37 | },
38 | updateDate: {
39 | type: DataTypes.DATE,
40 | allowNull: true,
41 | primaryKey: false,
42 | // field: "update_date",
43 | comment:"修改日期"
44 | }
45 | },
46 | {
47 | tableName: "ip_auth",
48 | createdAt: false, //去掉默认字段
49 | updatedAt: false //去掉默认字段
50 | }
51 | );
52 | }
53 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/perform/schema/performSchema.ts:
--------------------------------------------------------------------------------
1 | export default function(sequelize: any, DataTypes: any) {
2 | return sequelize.define(
3 | "perform",
4 | {
5 | id: {
6 | type: DataTypes.STRING,
7 | allowNull: false,
8 | primaryKey: true,
9 | comment:"主键"
10 | },
11 | type:{
12 | type: DataTypes.STRING,
13 | allowNull: true,
14 | comment:"类型"
15 | }
16 | },
17 | {
18 | tableName: "perform",
19 | createdAt: false, //去掉默认字段
20 | updatedAt: false //去掉默认字段
21 | }
22 | );
23 | }
24 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/project/controller/projectController.ts:
--------------------------------------------------------------------------------
1 | import ProjectService from "../service/projectService";
2 | import BaseController from "../../base/controller/baseController";
3 | import { Context } from "koa";
4 | class ProjectController extends BaseController {
5 | constructor(entityService, prefix, option?: any) {
6 | super(entityService, prefix, option);
7 | }
8 |
9 | /**
10 | * getCustomRouter
11 | * 自定义扩展路由
12 | */
13 | public getCustomRouter() {
14 | return [
15 | // 自定义扩展
16 | // {
17 | // url: this.profix + "/info",
18 | // method: "post",
19 | // function: async (ctx: Context) => {}
20 | // }
21 | ];
22 | }
23 | }
24 |
25 | let projectController = new ProjectController(ProjectService, "/api/project", {
26 | infoCacheable: false,
27 | findCacheable: true
28 | });
29 | let projectRouter = projectController
30 | .getBaseRouter()
31 | .concat(projectController.getCustomRouter());
32 |
33 | export default projectRouter;
34 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/auth/controller/authController.ts:
--------------------------------------------------------------------------------
1 | import authService from '../service/authService';
2 | import { Context } from 'koa';
3 |
4 | export default [
5 | {
6 | url: "/api/auth/login",
7 | method: "post",
8 | function: async (ctx: Context) => {
9 | let params:any = ctx.request.body;
10 | let ret = await authService.login(params)
11 | ctx.body=ret;
12 | }
13 | }
14 | ]
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/auth/model/user.ts:
--------------------------------------------------------------------------------
1 | export default class User {
2 |
3 |
4 | }
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/auth/service/authService.ts:
--------------------------------------------------------------------------------
1 | import mysql from '../../../../utils/mysql';
2 | import sequelize from 'sequelize';
3 | import userSchema from "../../user/schema/userSchema";
4 | const UserDao = userSchema(mysql, sequelize); // 引入user的表结构
5 | const jwt = require('jsonwebtoken');
6 | import config from '../../../../../config/default';
7 | import md5 from 'js-md5';
8 |
9 | class authService {
10 | constructor() {
11 | }
12 | /**
13 | * login 46f94c8de14fb36680850768ff1b7f2a
14 | */
15 | public async login(params : any) {
16 | if(params.password){
17 | params.password = md5(params.password);
18 | }
19 |
20 | if(params.userName && params.password){
21 | let ret = await this.loginByLoginName(params.userName, params.password);
22 | if(ret){
23 | ret.password = "";
24 | // 帐号密码正确 创建token
25 | //payload中写入一些值 time:创建日期 timeout:多长时间后过期
26 | let payload = {userId:ret.id,time:new Date().getTime(),timeout:1000*60*60*2}
27 | let token = jwt.sign(payload, config.secret);
28 | return {
29 | code: 200,
30 | data: ret,
31 | token
32 | }
33 | }else{
34 | return {
35 | code: 503,
36 | data: null,
37 | message: "登录失败,账号或密码错误!"
38 | }
39 | }
40 | }else{
41 | return {
42 | code: 503,
43 | data: null,
44 | message: "登录失败,账号或密码错误!"
45 | }
46 | }
47 | }
48 |
49 | /**
50 | * name
51 | */
52 | public async loginByLoginName(loginName: string, password: string) {
53 | return await UserDao.findOne({
54 | where: {
55 | loginName,
56 | password
57 | }
58 | });
59 | }
60 |
61 | /**
62 | * loginByEmail
63 | */
64 | public async loginByEmail(email: string, password: string) {
65 | return await UserDao.findOne({
66 | where: {
67 | email,
68 | password
69 | }
70 | });
71 | }
72 |
73 | }
74 | const authServiceImpl = new authService();
75 | export default authServiceImpl;
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/config/controller/configController.ts:
--------------------------------------------------------------------------------
1 | import ConfigService from "../service/configService";
2 | import BaseController from "../../../base/controller/baseController";
3 | import { Context } from "koa";
4 | class ConfigController extends BaseController {
5 | constructor(entityService, prefix, option?: any) {
6 | super(entityService, prefix, option);
7 | }
8 |
9 | /**
10 | * getCustomRouter
11 | * 自定义扩展路由
12 | */
13 | public getCustomRouter() {
14 | return [
15 | // 自定义扩展
16 | // {
17 | // url: this.profix + "/info",
18 | // method: "post",
19 | // function: async (ctx: Context) => {}
20 | // }
21 | ];
22 | }
23 | }
24 |
25 | let configController = new ConfigController(ConfigService, "/api/config", {
26 | infoCacheable: false,
27 | findCacheable: false
28 | });
29 | let configRouter = configController
30 | .getBaseRouter()
31 | .concat(configController.getCustomRouter());
32 |
33 | export default configRouter;
34 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/config/schema/configSchema.ts:
--------------------------------------------------------------------------------
1 | export default function(sequelize: any, DataTypes: any) {
2 | return sequelize.define(
3 | "sys_config",
4 | {
5 | id: {
6 | type: DataTypes.STRING(64),
7 | allowNull: false,
8 | primaryKey: true,
9 | comment:"主键"
10 | },
11 | paramKey:{
12 | type: DataTypes.STRING,
13 | allowNull: false,
14 | comment:"key"
15 | },
16 | paramValue:{
17 | type: DataTypes.STRING,
18 | allowNull: false,
19 | comment:"value"
20 | },
21 | remark:{
22 | type: DataTypes.TEXT,
23 | allowNull: true,
24 | comment:"备注"
25 | },
26 | retainField1:{
27 | type: DataTypes.STRING,
28 | allowNull: true,
29 | comment:"保留字段"
30 | },
31 | isDel:{
32 | type: DataTypes.INTEGER,
33 | allowNull: true,
34 | comment:"物理删除 0 不删除 1 删除"
35 | },
36 | createDate: {
37 | type: DataTypes.DATE,
38 | allowNull: true,
39 | primaryKey: false,
40 | // field: "create_date",
41 | comment:"创建日期"
42 | },
43 | updateDate: {
44 | type: DataTypes.DATE,
45 | allowNull: true,
46 | primaryKey: false,
47 | // field: "update_date",
48 | comment:"修改日期"
49 | }
50 | },
51 | {
52 | tableName: "sys_config",
53 | createdAt: false, //去掉默认字段
54 | updatedAt: false //去掉默认字段
55 | }
56 | );
57 | }
58 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/config/service/configService.ts:
--------------------------------------------------------------------------------
1 | import BaseService from "../../../base/service/baseService";
2 | import mysql from "../../../../utils/mysql";
3 | import sequelize from "sequelize";
4 | import configSchema from "../schema/configSchema";
5 |
6 | const configDao = configSchema(mysql, sequelize);
7 |
8 | // 重新生成表
9 | // configDao.sync({ alter: true, force: true });
10 |
11 | class ConfigService extends BaseService {
12 | constructor() {
13 | super(configDao);
14 | }
15 | }
16 | const configService = new ConfigService();
17 | export default configService;
18 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/dict/controller/dictController.ts:
--------------------------------------------------------------------------------
1 | import DictService from "../service/dictService";
2 | import BaseController from "../../../base/controller/baseController";
3 | import { Context } from "koa";
4 | class DictController extends BaseController {
5 | constructor(entityService, prefix, option?: any) {
6 | super(entityService, prefix, option);
7 | }
8 |
9 | /**
10 | * getCustomRouter
11 | * 自定义扩展路由
12 | */
13 | public getCustomRouter() {
14 | return [
15 | // 自定义扩展
16 | // {
17 | // url: this.profix + "/info",
18 | // method: "post",
19 | // function: async (ctx: Context) => {}
20 | // }
21 | ];
22 | }
23 | }
24 |
25 | let dictController = new DictController(DictService, "/api/dict", {
26 | infoCacheable: false,
27 | findCacheable: false
28 | });
29 | let dictRouter = dictController
30 | .getBaseRouter()
31 | .concat(dictController.getCustomRouter());
32 |
33 | export default dictRouter;
34 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/dict/schema/dictSchema.ts:
--------------------------------------------------------------------------------
1 | export default function(sequelize: any, DataTypes: any) {
2 | return sequelize.define(
3 | "sys_dict",
4 | {
5 | id: {
6 | type: DataTypes.STRING(64),
7 | allowNull: false,
8 | primaryKey: true,
9 | comment:"主键"
10 | },
11 | name:{
12 | type: DataTypes.STRING,
13 | allowNull: false,
14 | comment:"字典名称"
15 | },
16 | type:{
17 | type: DataTypes.STRING,
18 | allowNull: false,
19 | comment:"字典类型"
20 | },
21 | code:{
22 | type: DataTypes.STRING,
23 | allowNull: false,
24 | comment:"字典码"
25 | },
26 | value:{
27 | type: DataTypes.STRING,
28 | allowNull: false,
29 | comment:"字典值"
30 | },
31 | seq:{
32 | type: DataTypes.INTEGER,
33 | allowNull: false,
34 | comment:"排序"
35 | },
36 | remark:{
37 | type: DataTypes.TEXT,
38 | allowNull: true,
39 | comment:"备注"
40 | },
41 | retainField1:{
42 | type: DataTypes.STRING,
43 | allowNull: true,
44 | comment:"保留字段"
45 | },
46 | isDel:{
47 | type: DataTypes.INTEGER,
48 | allowNull: true,
49 | comment:"物理删除 0 不删除 1 删除"
50 | },
51 | createDate: {
52 | type: DataTypes.DATE,
53 | allowNull: true,
54 | primaryKey: false,
55 | // field: "create_date",
56 | comment:"创建日期"
57 | },
58 | updateDate: {
59 | type: DataTypes.DATE,
60 | allowNull: true,
61 | primaryKey: false,
62 | // field: "update_date",
63 | comment:"修改日期"
64 | }
65 | },
66 | {
67 | tableName: "sys_dict",
68 | createdAt: false, //去掉默认字段
69 | updatedAt: false //去掉默认字段
70 | }
71 | );
72 | }
73 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/dict/service/dictService.ts:
--------------------------------------------------------------------------------
1 | import BaseService from "../../../base/service/baseService";
2 | import mysql from "../../../../utils/mysql";
3 | import sequelize from "sequelize";
4 | import dictSchema from "../schema/dictSchema";
5 |
6 | const dictDao = dictSchema(mysql, sequelize);
7 |
8 | // 重新生成表
9 | // dictDao.sync({ alter: true, force: true });
10 |
11 | class DictService extends BaseService {
12 | constructor() {
13 | super(dictDao);
14 | }
15 | }
16 | const dictService = new DictService();
17 | export default dictService;
18 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/menu/controller/menuController.ts:
--------------------------------------------------------------------------------
1 | import MenuService from "../service/menuService";
2 | import BaseController from "../../../base/controller/baseController";
3 | import { Context } from "koa";
4 | class MenuController extends BaseController {
5 | constructor(entityService, prefix, option?: any) {
6 | super(entityService, prefix, option);
7 | }
8 |
9 | /**
10 | * getCustomRouter
11 | * 自定义扩展路由
12 | */
13 | public getCustomRouter() {
14 | return [
15 | // 自定义扩展
16 | // {
17 | // url: this.profix + "/info",
18 | // method: "post",
19 | // function: async (ctx: Context) => {}
20 | // }
21 | ];
22 | }
23 | }
24 |
25 | let menuController = new MenuController(MenuService, "/api/menu", {
26 | infoCacheable: false,
27 | findCacheable: false
28 | });
29 | let menuRouter = menuController
30 | .getBaseRouter()
31 | .concat(menuController.getCustomRouter());
32 |
33 | export default menuRouter;
34 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/menu/service/menuService.ts:
--------------------------------------------------------------------------------
1 | import BaseService from "../../../base/service/baseService";
2 | import mysql from "../../../../utils/mysql";
3 | import sequelize from "sequelize";
4 | import menuSchema from "../schema/menuSchema";
5 |
6 |
7 | const MenuDao = menuSchema(mysql, sequelize);
8 |
9 | // 重新生成表
10 |
11 | // MenuDao.sync({ alter: true, force: true });
12 |
13 | class MenuService extends BaseService {
14 | constructor() {
15 | super(MenuDao);
16 | }
17 | }
18 | const menuService = new MenuService();
19 | export default menuService;
20 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/org/controller/orgController.ts:
--------------------------------------------------------------------------------
1 | import OrgService from "../service/orgService";
2 | import BaseController from "../../../base/controller/baseController";
3 | import { Context } from "koa";
4 | class OrgController extends BaseController {
5 | constructor(entityService, prefix, option?: any) {
6 | super(entityService, prefix, option);
7 | }
8 |
9 | /**
10 | * getCustomRouter
11 | * 自定义扩展路由
12 | */
13 | public getCustomRouter() {
14 | return [
15 | // 自定义扩展
16 | // {
17 | // url: this.profix + "/info",
18 | // method: "post",
19 | // function: async (ctx: Context) => {}
20 | // }
21 | ];
22 | }
23 | }
24 |
25 | let orgController = new OrgController(OrgService, "/api/org", {
26 | infoCacheable: false,
27 | findCacheable: false
28 | });
29 | let orgRouter = orgController
30 | .getBaseRouter()
31 | .concat(orgController.getCustomRouter());
32 |
33 | export default orgRouter;
34 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/org/schema/orgSchema.ts:
--------------------------------------------------------------------------------
1 | export default function(sequelize: any, DataTypes: any) {
2 | return sequelize.define(
3 | "sys_org",
4 | {
5 | id: {
6 | type: DataTypes.STRING(64),
7 | allowNull: false,
8 | primaryKey: true,
9 | comment:"主键"
10 | },
11 | name:{
12 | type: DataTypes.STRING,
13 | allowNull: false,
14 | comment:"组织名称"
15 | },
16 | code:{
17 | type: DataTypes.STRING,
18 | allowNull: false,
19 | comment:"组织编码"
20 | },
21 | parentId:{
22 | type: DataTypes.STRING,
23 | allowNull: false,
24 | comment:"父级Id"
25 | },
26 | remark:{
27 | type: DataTypes.TEXT,
28 | allowNull: true,
29 | comment:"备注"
30 | },
31 | retainField1:{
32 | type: DataTypes.STRING,
33 | allowNull: true,
34 | comment:"保留字段"
35 | },
36 | retainField2:{
37 | type: DataTypes.STRING,
38 | allowNull: true,
39 | comment:"保留字段"
40 | },
41 | retainField3:{
42 | type: DataTypes.STRING,
43 | allowNull: true,
44 | comment:"保留字段"
45 | },
46 | isDel:{
47 | type: DataTypes.INTEGER,
48 | allowNull: true,
49 | comment:"物理删除 0 不删除 1 删除"
50 | },
51 | createDate: {
52 | type: DataTypes.DATE,
53 | allowNull: true,
54 | primaryKey: false,
55 | // field: "create_date",
56 | comment:"创建日期"
57 | },
58 | updateDate: {
59 | type: DataTypes.DATE,
60 | allowNull: true,
61 | primaryKey: false,
62 | // field: "update_date",
63 | comment:"修改日期"
64 | }
65 | },
66 | {
67 | tableName: "sys_org",
68 | createdAt: false, //去掉默认字段
69 | updatedAt: false //去掉默认字段
70 | }
71 | );
72 | }
73 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/org/service/orgService.ts:
--------------------------------------------------------------------------------
1 | import BaseService from "../../../base/service/baseService";
2 | import mysql from "../../../../utils/mysql";
3 | import sequelize from "sequelize";
4 | import orgSchema from "../schema/orgSchema";
5 |
6 | const OrgDao = orgSchema(mysql, sequelize);
7 |
8 | // 重新生成表
9 | // OrgDao.sync({ alter: true, force: true });
10 |
11 | class OrgService extends BaseService {
12 | constructor() {
13 | super(OrgDao);
14 | }
15 | }
16 | const orgService = new OrgService();
17 | export default orgService;
18 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/role/controller/roleController.ts:
--------------------------------------------------------------------------------
1 | import RoleService from "../service/roleService";
2 | import BaseController from "../../../base/controller/baseController";
3 | import { Context } from "koa";
4 | class RoleController extends BaseController {
5 | constructor(entityService, prefix, option?: any) {
6 | super(entityService, prefix, option);
7 | }
8 |
9 | /**
10 | * getCustomRouter
11 | * 自定义扩展路由
12 | */
13 | public getCustomRouter() {
14 | return [
15 | // 自定义扩展
16 | // {
17 | // url: this.profix + "/info",
18 | // method: "post",
19 | // function: async (ctx: Context) => {}
20 | // }
21 | ];
22 | }
23 | }
24 |
25 | let roleController = new RoleController(RoleService, "/api/role", {
26 | infoCacheable: false,
27 | findCacheable: false
28 | });
29 | let roleRouter = roleController
30 | .getBaseRouter()
31 | .concat(roleController.getCustomRouter());
32 |
33 | export default roleRouter;
34 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/role/schema/roleMenuSchema.ts:
--------------------------------------------------------------------------------
1 | export default function(sequelize: any, DataTypes: any) {
2 | return sequelize.define(
3 | "sys_role_menu",
4 | {
5 | id: {
6 | type: DataTypes.STRING(64),
7 | allowNull: false,
8 | primaryKey: true,
9 | comment:"主键"
10 | },
11 | roleId:{
12 | type: DataTypes.STRING(64),
13 | allowNull: false,
14 | comment:"角色Id"
15 | },
16 | menuId:{
17 | type: DataTypes.STRING(64),
18 | allowNull: false,
19 | comment:"菜单Id"
20 | },
21 | createDate: {
22 | type: DataTypes.DATE,
23 | allowNull: true,
24 | primaryKey: false,
25 | // field: "create_date",
26 | comment:"创建日期"
27 | }
28 | },
29 | {
30 | tableName: "sys_role_menu",
31 | createdAt: false, //去掉默认字段
32 | updatedAt: false //去掉默认字段
33 | }
34 | );
35 | }
36 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/role/schema/roleSchema.ts:
--------------------------------------------------------------------------------
1 | export default function(sequelize: any, DataTypes: any) {
2 | return sequelize.define(
3 | "sys_role",
4 | {
5 | id: {
6 | type: DataTypes.STRING(64),
7 | allowNull: false,
8 | primaryKey: true,
9 | comment:"主键"
10 | },
11 | name:{
12 | type: DataTypes.STRING,
13 | allowNull: false,
14 | comment:"角色名称"
15 | },
16 | remark:{
17 | type: DataTypes.TEXT,
18 | allowNull: true,
19 | comment:"备注"
20 | },
21 | isAdmin:{
22 | type: DataTypes.INTEGER,
23 | allowNull: true,
24 | comment:"是否为管理员"
25 | },
26 | retainField1:{
27 | type: DataTypes.STRING,
28 | allowNull: true,
29 | comment:"保留字段"
30 | },
31 | retainField2:{
32 | type: DataTypes.STRING,
33 | allowNull: true,
34 | comment:"保留字段"
35 | },
36 | retainField3:{
37 | type: DataTypes.STRING,
38 | allowNull: true,
39 | comment:"保留字段"
40 | },
41 | createDate: {
42 | type: DataTypes.DATE,
43 | allowNull: true,
44 | primaryKey: false,
45 | // field: "create_date",
46 | comment:"创建日期"
47 | },
48 | updateDate: {
49 | type: DataTypes.DATE,
50 | allowNull: true,
51 | primaryKey: false,
52 | // field: "update_date",
53 | comment:"修改日期"
54 | }
55 | },
56 | {
57 | tableName: "sys_role",
58 | createdAt: false, //去掉默认字段
59 | updatedAt: false //去掉默认字段
60 | }
61 | );
62 | }
63 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/role/service/roleService.ts:
--------------------------------------------------------------------------------
1 | import BaseService from "../../../base/service/baseService";
2 | import mysql from "../../../../utils/mysql";
3 | import sequelize from "sequelize";
4 | import roleSchema from "../schema/roleSchema";
5 | import roleMenuSchema from '..//schema/roleMenuSchema';
6 |
7 | const RoleDao = roleSchema(mysql, sequelize);
8 | // 用于更新角色 批量保存角色 菜单关联表
9 | const RoleMenuDao = roleMenuSchema(mysql, sequelize);
10 |
11 | // 重新生成表
12 | // RoleDao.sync({ alter: true, force: true });
13 | // RoleMenuDao.sync({ alter: true, force: true });
14 |
15 | class RoleService extends BaseService {
16 | constructor() {
17 | super(RoleDao);
18 | }
19 | }
20 | const roleService = new RoleService();
21 | export default roleService;
22 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/user/controller/userController.ts:
--------------------------------------------------------------------------------
1 | import UserService from "../service/userService";
2 | import BaseController from "../../../base/controller/baseController";
3 | import { Context } from "koa";
4 | class UserController extends BaseController {
5 | constructor(entityService, prefix, option?: any) {
6 | super(entityService, prefix, option);
7 | }
8 |
9 | /**
10 | * getCustomRouter
11 | * 自定义扩展路由
12 | */
13 | public getCustomRouter() {
14 | return [
15 | // 自定义扩展
16 | {
17 | url: this.profix + "/updatePassword",
18 | method: "post",
19 | function: async (ctx: Context) => {
20 | let obj = ctx.request.body;
21 | const ret = await this.entityService.updatePassword(obj);
22 | if (ret) {
23 | ctx.response.body = {
24 | code: 200,
25 | data: ret
26 | };
27 | } else {
28 | ctx.response.body = {
29 | code: 503,
30 | data: null,
31 | message: "修改失败,请稍后再试"
32 | };
33 | }
34 | }
35 | }
36 | ];
37 | }
38 | }
39 |
40 | let userController = new UserController(UserService, "/api/user", {
41 | infoCacheable: false,
42 | findCacheable: false
43 | });
44 | let userRouter = userController
45 | .getBaseRouter()
46 | .concat(userController.getCustomRouter());
47 |
48 | export default userRouter;
49 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/module/system/user/schema/userRoleSchema.ts:
--------------------------------------------------------------------------------
1 | export default function(sequelize: any, DataTypes: any) {
2 | return sequelize.define(
3 | "sys_user_role",
4 | {
5 | id: {
6 | type: DataTypes.STRING(64),
7 | allowNull: false,
8 | primaryKey: true,
9 | comment:"主键"
10 | },
11 | roleId:{
12 | type: DataTypes.STRING(64),
13 | allowNull: false,
14 | comment:"角色Id"
15 | },
16 | userId:{
17 | type: DataTypes.STRING(64),
18 | allowNull: false,
19 | comment:"用户Id"
20 | },
21 | createDate: {
22 | type: DataTypes.DATE,
23 | allowNull: true,
24 | primaryKey: false,
25 | // field: "create_date",
26 | comment:"创建日期"
27 | }
28 | },
29 | {
30 | tableName: "sys_user_role",
31 | createdAt: false, //去掉默认字段
32 | updatedAt: false //去掉默认字段
33 | }
34 | );
35 | }
36 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/router/index.ts:
--------------------------------------------------------------------------------
1 | import userController from '../module/system/user/controller/userController';
2 | import authController from '../module/system/auth/controller/authController';
3 | import reportController from '../module/report/controller/reportController';
4 | import projectController from '../module/project/controller/projectController';
5 | import ipAuthController from '../module/ipAuth/controller/ipAuthController';
6 | import roleController from '../module/system/role/controller/roleController';
7 | import menuController from '../module/system/menu/controller/menuController';
8 | import orgController from '../module/system/org/controller/orgController';
9 | import configController from '../module/system/config/controller/configController';
10 | import dictController from '../module/system/dict/controller/dictController';
11 | import dashboardController from '../module/dashboard/controller/dashboardController';
12 |
13 | export default {
14 | userController,
15 | authController,
16 | reportController,
17 | projectController,
18 | ipAuthController,
19 | roleController,
20 | menuController,
21 | orgController,
22 | configController,
23 | dictController,
24 | dashboardController
25 | };
26 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/router/sample.ts:
--------------------------------------------------------------------------------
1 | import { Context } from 'koa';
2 | const main = (ctx:Context) => {
3 | ctx.response.body = 'front-logger';
4 | };
5 |
6 | export default main;
--------------------------------------------------------------------------------
/rebugger-service/server/src/utils/cacheUtil.ts:
--------------------------------------------------------------------------------
1 | /*
2 | * Description:缓存工具类
3 | * Author:詹陈龙
4 | * Update:
5 | */
6 |
7 | import baseCache from "memory-cache";
8 | import sysConfig from "../../config/default";
9 | import redisUtil from "./redisUtil";
10 |
11 | class CacheUtil {
12 | constructor() {}
13 | /**
14 | * get
15 | */
16 | public async get(key) {
17 | if (sysConfig.useRedis) {
18 | return await redisUtil.get(key);
19 | }
20 | return baseCache.get(key);
21 | }
22 |
23 | /**
24 | * set
25 | * exprires 统一设定为 ms redis单位为s 需要除以1000
26 | */
27 | public set(key, value: any, exprires: any) {
28 | if (sysConfig.useRedis) {
29 | redisUtil.set(key, value);
30 | exprires = exprires?exprires:sysConfig.redis.exprires;
31 | if(exprires>1000){
32 | exprires = exprires / 1000;
33 | }
34 | // console.log(exprires);
35 | redisUtil.expire(key, exprires);
36 | } else {
37 | baseCache.put(
38 | key,
39 | value,
40 | exprires ? exprires : sysConfig.redis.exprires
41 | );
42 | }
43 | }
44 | }
45 |
46 | const cacheUtil = new CacheUtil();
47 | export default cacheUtil;
48 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/utils/mysql.ts:
--------------------------------------------------------------------------------
1 | const Sequelize = require("sequelize");
2 | // const config = require("../../config/default");
3 | import config from '../../config/default';
4 |
5 | // console.log(process.env.NODE_ENV);
6 | let localConfig: any = config;
7 | if(process.env.NODE_ENV == "test"){
8 | localConfig = config.test;
9 | }else if(process.env.NODE_ENV == "prod"){
10 | localConfig = config.prod;
11 | }
12 | // console.log(localConfig);
13 | // const mysql = new Sequelize(config.mysql.default, {
14 | // define: {
15 | // timestamps: false,
16 | // },
17 | // operatorsAliases: false
18 | // });
19 |
20 | var sequelized = new Sequelize(
21 | localConfig.database.DATABASE,
22 | localConfig.database.USER,
23 | localConfig.database.PASSWORD,
24 | {
25 | host: localConfig.database.HOST,
26 | dialect: "mysql",
27 | pool: {
28 | max: 5,
29 | min: 0,
30 | idle: 30000
31 | },
32 | // 添加这个配置 格式化日期
33 | dialectOptions: {
34 | dateStrings: true,
35 | typeCast: true
36 | },
37 | 'define': {
38 | // 字段以下划线(_)来分割(默认是驼峰命名风格)
39 | 'underscored': true
40 | },
41 | // 时区东八区
42 | timezone: '+08:00'
43 | }
44 | );
45 |
46 | export default sequelized;
47 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/utils/redis.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable quotes */
2 | const Redis = require("ioredis");
3 | import config from '../../config/default';
4 |
5 | console.log("NODE_ENV: " + process.env.NODE_ENV);
6 |
7 | let localConfig: any = config;
8 | if(process.env.NODE_ENV == "test"){
9 | localConfig = config.test;
10 | }else if(process.env.NODE_ENV == "prod"){
11 | localConfig = config.prod;
12 | }
13 | // console.log(localConfig);
14 |
15 | const redis = {
16 | port: localConfig.redis.port, // Redis port
17 | host: localConfig.redis.host, // Redis host
18 | password: localConfig.redis.password,
19 | prefix: localConfig.redis.prefix, // 存诸前缀
20 | keyPrefix: localConfig.redis.keyPrefix,
21 | ttl: 60 * 60 * 23, // 默认过期时间
22 | family: 4,
23 | db: 0
24 | };
25 | const newRedis = new Redis(redis);
26 | module.exports = newRedis;
27 |
--------------------------------------------------------------------------------
/rebugger-service/server/src/utils/redisUtil.ts:
--------------------------------------------------------------------------------
1 | const redis = require("./redis");
2 |
3 | class RedisUtil {
4 | constructor() {}
5 | /**
6 | * get
7 | */
8 | public async get(key) {
9 | return await redis.get(key);
10 | }
11 |
12 | /**
13 | * set
14 | */
15 | public async set(key, value: any) {
16 | redis.set(key, value);
17 | }
18 |
19 | /**
20 | * 设置过期时间
21 | */
22 | public expire(key, expire) {
23 | redis.expire(key, expire);
24 | }
25 | }
26 | const redisUtil = new RedisUtil();
27 | export default redisUtil;
28 |
--------------------------------------------------------------------------------
/rebugger-service/test.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | apps: [
3 | {
4 | name: "rebugger-server",
5 | script: "server/build/app.js",
6 | // watch: true,
7 | // watch: [
8 | // // 监控变化的目录,一旦变化,自动重启
9 | // "server"
10 | // ],
11 | instances: "max",
12 | ignore_watch: [
13 | // 从监控目录中排除
14 | "node_modules",
15 | "logs",
16 | "server/logs"
17 | ],
18 | error_file: "./logs/app-err.log", // 错误日志路径
19 | out_file: "./logs/app-out.log", // 普通日志路径
20 | env: {
21 | NODE_ENV: "development"
22 | },
23 | env_dev: {
24 | NODE_ENV: "development"
25 | },
26 | env_test: {
27 | NODE_ENV: "test"
28 | },
29 | env_prod: {
30 | NODE_ENV: "prod"
31 | }
32 | }
33 | ]
34 | };
35 |
--------------------------------------------------------------------------------