diff --git a/sso-auth-center-service/pom.xml b/sso-auth-center-service/pom.xml index df01345..c829466 100755 --- a/sso-auth-center-service/pom.xml +++ b/sso-auth-center-service/pom.xml @@ -12,7 +12,7 @@ 程序员小强-统一认证中心 - sso-auth-center + sso-auth-center-admin sso-framework sso-business sso-common diff --git a/sso-auth-center-service/sso-auth-center-admin/pom.xml b/sso-auth-center-service/sso-auth-center-admin/pom.xml index 59e875e..9e2b2aa 100755 --- a/sso-auth-center-service/sso-auth-center-admin/pom.xml +++ b/sso-auth-center-service/sso-auth-center-admin/pom.xml @@ -9,7 +9,7 @@ 4.0.0 jar - sso-auth-center + sso-auth-center-admin web服务入口 diff --git a/sso-auth-center-vue/.editorconfig b/sso-auth-center-vue/.editorconfig new file mode 100755 index 0000000..7034f9b --- /dev/null +++ b/sso-auth-center-vue/.editorconfig @@ -0,0 +1,22 @@ +# 告诉EditorConfig插件,这是根文件,不用继续往上查找 +root = true + +# 匹配全部文件 +[*] +# 设置字符集 +charset = utf-8 +# 缩进风格,可选space、tab +indent_style = space +# 缩进的空格数 +indent_size = 2 +# 结尾换行符,可选lf、cr、crlf +end_of_line = lf +# 在文件结尾插入新行 +insert_final_newline = true +# 删除一行中的前后空格 +trim_trailing_whitespace = true + +# 匹配md结尾的文件 +[*.md] +insert_final_newline = false +trim_trailing_whitespace = false diff --git a/sso-auth-center-vue/.env.development b/sso-auth-center-vue/.env.development new file mode 100755 index 0000000..80846b8 --- /dev/null +++ b/sso-auth-center-vue/.env.development @@ -0,0 +1,6 @@ +# just a flag +ENV = 'development' + +# base api +# VUE_APP_BASE_API = '/dev-api' +VUE_APP_BASE_API = 'http://localhost:9901/api' diff --git a/sso-auth-center-vue/.env.production b/sso-auth-center-vue/.env.production new file mode 100755 index 0000000..80c8103 --- /dev/null +++ b/sso-auth-center-vue/.env.production @@ -0,0 +1,6 @@ +# just a flag +ENV = 'production' + +# base api +VUE_APP_BASE_API = '/prod-api' + diff --git a/sso-auth-center-vue/.env.staging b/sso-auth-center-vue/.env.staging new file mode 100755 index 0000000..a8793a0 --- /dev/null +++ b/sso-auth-center-vue/.env.staging @@ -0,0 +1,8 @@ +NODE_ENV = production + +# just a flag +ENV = 'staging' + +# base api +VUE_APP_BASE_API = '/stage-api' + diff --git a/sso-auth-center-vue/.eslintignore b/sso-auth-center-vue/.eslintignore new file mode 100755 index 0000000..e6529fc --- /dev/null +++ b/sso-auth-center-vue/.eslintignore @@ -0,0 +1,4 @@ +build/*.js +src/assets +public +dist diff --git a/sso-auth-center-vue/.eslintrc.js b/sso-auth-center-vue/.eslintrc.js new file mode 100755 index 0000000..82bbdee --- /dev/null +++ b/sso-auth-center-vue/.eslintrc.js @@ -0,0 +1,199 @@ +// ESlint 检查配置 +module.exports = { + root: true, + parserOptions: { + parser: 'babel-eslint', + sourceType: 'module' + }, + env: { + browser: true, + node: true, + es6: true, + }, + extends: ['plugin:vue/recommended', 'eslint:recommended'], + + // add your custom rules here + //it is base on https://github.com/vuejs/eslint-config-vue + rules: { + "vue/max-attributes-per-line": [2, { + "singleline": 10, + "multiline": { + "max": 1, + "allowFirstLine": false + } + }], + "vue/singleline-html-element-content-newline": "off", + "vue/multiline-html-element-content-newline":"off", + "vue/name-property-casing": ["error", "PascalCase"], + "vue/no-v-html": "off", + 'accessor-pairs': 2, + 'arrow-spacing': [2, { + 'before': true, + 'after': true + }], + 'block-spacing': [2, 'always'], + 'brace-style': [2, '1tbs', { + 'allowSingleLine': true + }], + 'camelcase': [0, { + 'properties': 'always' + }], + 'comma-dangle': [2, 'never'], + 'comma-spacing': [2, { + 'before': false, + 'after': true + }], + 'comma-style': [2, 'last'], + 'constructor-super': 2, + 'curly': [2, 'multi-line'], + 'dot-location': [2, 'property'], + 'eol-last': 2, + 'eqeqeq': ["error", "always", {"null": "ignore"}], + 'generator-star-spacing': [2, { + 'before': true, + 'after': true + }], + 'handle-callback-err': [2, '^(err|error)$'], + 'indent': [2, 2, { + 'SwitchCase': 1 + }], + 'jsx-quotes': [2, 'prefer-single'], + 'key-spacing': [2, { + 'beforeColon': false, + 'afterColon': true + }], + 'keyword-spacing': [2, { + 'before': true, + 'after': true + }], + 'new-cap': [2, { + 'newIsCap': true, + 'capIsNew': false + }], + 'new-parens': 2, + 'no-array-constructor': 2, + 'no-caller': 2, + 'no-console': 'off', + 'no-class-assign': 2, + 'no-cond-assign': 2, + 'no-const-assign': 2, + 'no-control-regex': 0, + 'no-delete-var': 2, + 'no-dupe-args': 2, + 'no-dupe-class-members': 2, + 'no-dupe-keys': 2, + 'no-duplicate-case': 2, + 'no-empty-character-class': 2, + 'no-empty-pattern': 2, + 'no-eval': 2, + 'no-ex-assign': 2, + 'no-extend-native': 2, + 'no-extra-bind': 2, + 'no-extra-boolean-cast': 2, + 'no-extra-parens': [2, 'functions'], + 'no-fallthrough': 2, + 'no-floating-decimal': 2, + 'no-func-assign': 2, + 'no-implied-eval': 2, + 'no-inner-declarations': [2, 'functions'], + 'no-invalid-regexp': 2, + 'no-irregular-whitespace': 2, + 'no-iterator': 2, + 'no-label-var': 2, + 'no-labels': [2, { + 'allowLoop': false, + 'allowSwitch': false + }], + 'no-lone-blocks': 2, + 'no-mixed-spaces-and-tabs': 2, + 'no-multi-spaces': 2, + 'no-multi-str': 2, + 'no-multiple-empty-lines': [2, { + 'max': 1 + }], + 'no-native-reassign': 2, + 'no-negated-in-lhs': 2, + 'no-new-object': 2, + 'no-new-require': 2, + 'no-new-symbol': 2, + 'no-new-wrappers': 2, + 'no-obj-calls': 2, + 'no-octal': 2, + 'no-octal-escape': 2, + 'no-path-concat': 2, + 'no-proto': 2, + 'no-redeclare': 2, + 'no-regex-spaces': 2, + 'no-return-assign': [2, 'except-parens'], + 'no-self-assign': 2, + 'no-self-compare': 2, + 'no-sequences': 2, + 'no-shadow-restricted-names': 2, + 'no-spaced-func': 2, + 'no-sparse-arrays': 2, + 'no-this-before-super': 2, + 'no-throw-literal': 2, + 'no-trailing-spaces': 2, + 'no-undef': 2, + 'no-undef-init': 2, + 'no-unexpected-multiline': 2, + 'no-unmodified-loop-condition': 2, + 'no-unneeded-ternary': [2, { + 'defaultAssignment': false + }], + 'no-unreachable': 2, + 'no-unsafe-finally': 2, + 'no-unused-vars': [2, { + 'vars': 'all', + 'args': 'none' + }], + 'no-useless-call': 2, + 'no-useless-computed-key': 2, + 'no-useless-constructor': 2, + 'no-useless-escape': 0, + 'no-whitespace-before-property': 2, + 'no-with': 2, + 'one-var': [2, { + 'initialized': 'never' + }], + 'operator-linebreak': [2, 'after', { + 'overrides': { + '?': 'before', + ':': 'before' + } + }], + 'padded-blocks': [2, 'never'], + 'quotes': [2, 'single', { + 'avoidEscape': true, + 'allowTemplateLiterals': true + }], + 'semi': [2, 'never'], + 'semi-spacing': [2, { + 'before': false, + 'after': true + }], + 'space-before-blocks': [2, 'always'], + 'space-before-function-paren': [2, 'never'], + 'space-in-parens': [2, 'never'], + 'space-infix-ops': 2, + 'space-unary-ops': [2, { + 'words': true, + 'nonwords': false + }], + 'spaced-comment': [2, 'always', { + 'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] + }], + 'template-curly-spacing': [2, 'never'], + 'use-isnan': 2, + 'valid-typeof': 2, + 'wrap-iife': [2, 'any'], + 'yield-star-spacing': [2, 'both'], + 'yoda': [2, 'never'], + 'prefer-const': 2, + 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, + 'object-curly-spacing': [2, 'always', { + objectsInObjects: false + }], + 'array-bracket-spacing': [2, 'never'] + } +} diff --git a/sso-auth-center-vue/.gitignore b/sso-auth-center-vue/.gitignore new file mode 100755 index 0000000..9ad28d2 --- /dev/null +++ b/sso-auth-center-vue/.gitignore @@ -0,0 +1,16 @@ +.DS_Store +node_modules/ +dist/ +npm-debug.log* +yarn-debug.log* +yarn-error.log* +package-lock.json +tests/**/coverage/ + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln diff --git a/sso-auth-center-vue/.travis.yml b/sso-auth-center-vue/.travis.yml new file mode 100755 index 0000000..f4be7a0 --- /dev/null +++ b/sso-auth-center-vue/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: 10 +script: npm run test +notifications: + email: false diff --git a/sso-auth-center-vue/LICENSE b/sso-auth-center-vue/LICENSE new file mode 100755 index 0000000..6151575 --- /dev/null +++ b/sso-auth-center-vue/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-present PanJiaChen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/sso-auth-center-vue/README-zh.md b/sso-auth-center-vue/README-zh.md new file mode 100755 index 0000000..e69de29 diff --git a/sso-auth-center-vue/README.md b/sso-auth-center-vue/README.md new file mode 100755 index 0000000..e69de29 diff --git a/sso-auth-center-vue/babel.config.js b/sso-auth-center-vue/babel.config.js new file mode 100755 index 0000000..fb82b27 --- /dev/null +++ b/sso-auth-center-vue/babel.config.js @@ -0,0 +1,14 @@ +module.exports = { + presets: [ + // https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app + '@vue/cli-plugin-babel/preset' + ], + 'env': { + 'development': { + // babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require(). + // This plugin can significantly increase the speed of hot updates, when you have a large number of pages. + // https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html + 'plugins': ['dynamic-import-node'] + } + } +} diff --git a/sso-auth-center-vue/build/index.js b/sso-auth-center-vue/build/index.js new file mode 100755 index 0000000..0c57de2 --- /dev/null +++ b/sso-auth-center-vue/build/index.js @@ -0,0 +1,35 @@ +const { run } = require('runjs') +const chalk = require('chalk') +const config = require('../vue.config.js') +const rawArgv = process.argv.slice(2) +const args = rawArgv.join(' ') + +if (process.env.npm_config_preview || rawArgv.includes('--preview')) { + const report = rawArgv.includes('--report') + + run(`vue-cli-service build ${args}`) + + const port = 9526 + const publicPath = config.publicPath + + var connect = require('connect') + var serveStatic = require('serve-static') + const app = connect() + + app.use( + publicPath, + serveStatic('./dist', { + index: ['index.html', '/'] + }) + ) + + app.listen(port, function () { + console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) + if (report) { + console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) + } + + }) +} else { + run(`vue-cli-service build ${args}`) +} diff --git a/sso-auth-center-vue/jest.config.js b/sso-auth-center-vue/jest.config.js new file mode 100755 index 0000000..143cdc8 --- /dev/null +++ b/sso-auth-center-vue/jest.config.js @@ -0,0 +1,24 @@ +module.exports = { + moduleFileExtensions: ['js', 'jsx', 'json', 'vue'], + transform: { + '^.+\\.vue$': 'vue-jest', + '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': + 'jest-transform-stub', + '^.+\\.jsx?$': 'babel-jest' + }, + moduleNameMapper: { + '^@/(.*)$': '/src/$1' + }, + snapshotSerializers: ['jest-serializer-vue'], + testMatch: [ + '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' + ], + collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'], + coverageDirectory: '/tests/unit/coverage', + // 'collectCoverage': true, + 'coverageReporters': [ + 'lcov', + 'text-summary' + ], + testURL: 'http://localhost/' +} diff --git a/sso-auth-center-vue/jsconfig.json b/sso-auth-center-vue/jsconfig.json new file mode 100755 index 0000000..ed079e2 --- /dev/null +++ b/sso-auth-center-vue/jsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@/*": ["src/*"] + } + }, + "exclude": ["node_modules", "dist"] +} diff --git a/sso-auth-center-vue/package.json b/sso-auth-center-vue/package.json new file mode 100755 index 0000000..5d9372d --- /dev/null +++ b/sso-auth-center-vue/package.json @@ -0,0 +1,69 @@ +{ + "name": "vue-admin-template", + "version": "4.4.0", + "description": "A vue admin template with Element UI & axios & iconfont & permission control & lint", + "author": "Pan ", + "scripts": { + "dev": "vue-cli-service serve", + "build:prod": "vue-cli-service build", + "build:stage": "vue-cli-service build --mode staging", + "preview": "node build/index.js --preview", + "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml", + "lint": "eslint --ext .js,.vue src", + "test:unit": "jest --clearCache && vue-cli-service test:unit", + "test:ci": "npm run lint && npm run test:unit" + }, + "dependencies": { + "axios": "0.18.1", + "clean": "^4.0.2", + "core-js": "3.6.5", + "element-ui": "2.13.2", + "js-cookie": "2.2.0", + "jsencrypt": "^3.0.0-rc.1", + "normalize.css": "7.0.0", + "nprogress": "0.2.0", + "path-to-regexp": "2.4.0", + "sortablejs": "^1.13.0", + "vue": "2.6.10", + "vue-cropper": "^0.5.6", + "vue-router": "3.0.6", + "vuex": "3.1.0" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "4.4.4", + "@vue/cli-plugin-eslint": "4.4.4", + "@vue/cli-plugin-unit-jest": "4.4.4", + "@vue/cli-service": "4.4.4", + "@vue/test-utils": "1.0.0-beta.29", + "@riophae/vue-treeselect": "0.4.0", + "autoprefixer": "9.5.1", + "babel-eslint": "10.1.0", + "babel-jest": "23.6.0", + "babel-plugin-dynamic-import-node": "2.3.3", + "chalk": "2.4.2", + "connect": "3.6.6", + "eslint": "6.7.2", + "eslint-plugin-vue": "6.2.2", + "html-webpack-plugin": "3.2.0", + "less": "^4.0.0", + "less-loader": "^7.2.0", + "mockjs": "1.0.1-beta3", + "runjs": "4.3.2", + "sass": "1.26.8", + "sass-loader": "8.0.2", + "script-ext-html-webpack-plugin": "2.1.3", + "serve-static": "1.13.2", + "svg-sprite-loader": "4.1.3", + "svgo": "1.2.2", + "vue-template-compiler": "2.6.10" + }, + "browserslist": [ + "> 1%", + "last 2 versions" + ], + "engines": { + "node": ">=8.9", + "npm": ">= 3.0.0" + }, + "license": "MIT" +} diff --git a/sso-auth-center-vue/postcss.config.js b/sso-auth-center-vue/postcss.config.js new file mode 100755 index 0000000..10473ef --- /dev/null +++ b/sso-auth-center-vue/postcss.config.js @@ -0,0 +1,8 @@ +// https://github.com/michael-ciniawsky/postcss-load-config + +module.exports = { + 'plugins': { + // to edit target browsers: use "browserslist" field in package.json + 'autoprefixer': {} + } +} diff --git a/sso-auth-center-vue/public/favicon.ico b/sso-auth-center-vue/public/favicon.ico new file mode 100644 index 0000000..80ff02c Binary files /dev/null and b/sso-auth-center-vue/public/favicon.ico differ diff --git a/sso-auth-center-vue/public/index.html b/sso-auth-center-vue/public/index.html new file mode 100755 index 0000000..fa2be91 --- /dev/null +++ b/sso-auth-center-vue/public/index.html @@ -0,0 +1,17 @@ + + + + + + + + <%= webpackConfig.name %> + + + +
+ + + diff --git a/sso-auth-center-vue/src/App.vue b/sso-auth-center-vue/src/App.vue new file mode 100755 index 0000000..ec9032c --- /dev/null +++ b/sso-auth-center-vue/src/App.vue @@ -0,0 +1,11 @@ + + + diff --git a/sso-auth-center-vue/src/api/dept.js b/sso-auth-center-vue/src/api/dept.js new file mode 100755 index 0000000..ab701b6 --- /dev/null +++ b/sso-auth-center-vue/src/api/dept.js @@ -0,0 +1,77 @@ +import request from '@/utils/request' + +// 查询部门管理树-列表 +export function listDeptMgmtTree(query) { + return request({ + url: '/dept/listDeptMgmtTree', + method: 'get', + params: query + }) +} + +// 查询部门选项树-列表 +export function listDeptOptionTree(query) { + return request({ + url: '/dept/listDeptOptionTree', + method: 'get', + params: query + }) +} + +// 查询部门列表(排除节点) +export function listDeptExcludeChild(deptId) { + return request({ + url: '/system/dept/list/exclude/' + deptId, + method: 'get' + }) +} + +// 查询部门详细 +export function getDeptDetail(deptId) { + return request({ + url: '/dept/detail/' + deptId, + method: 'get' + }) +} + +// 查询部门下拉树结构 +export function treeselect() { + return request({ + url: '/dept/listDeptOptionTree', + method: 'get' + }) +} + +// 根据角色ID查询部门树结构 +export function roleDeptTreeselect(roleId) { + return request({ + url: '/system/dept/roleDeptTreeselect/' + roleId, + method: 'get' + }) +} + +// 新增部门 +export function addDept(data) { + return request({ + url: '/dept/add', + method: 'post', + data: data + }) +} + +// 修改部门 +export function updateDept(data) { + return request({ + url: '/dept/update', + method: 'put', + data: data + }) +} + +// 删除部门 +export function delDept(deptId) { + return request({ + url: '/dept/delete/' + deptId, + method: 'delete' + }) +} diff --git a/sso-auth-center-vue/src/api/login.js b/sso-auth-center-vue/src/api/login.js new file mode 100755 index 0000000..4ebcafd --- /dev/null +++ b/sso-auth-center-vue/src/api/login.js @@ -0,0 +1,40 @@ +import request from '@/utils/request' + +// 登录方法 +export function login(username, password, captchaCode, requestId) { + const data = { + username, + password, + captchaCode, + requestId + } + return request({ + url: '/login', + method: 'post', + data: data + }) +} + +// 获取用户详细信息 +export function getUserInfo() { + return request({ + url: '/getUserInfo', + method: 'get' + }) +} + +// 退出方法 +export function logout() { + return request({ + url: '/logout', + method: 'post' + }) +} + +// 获取验证码 +export function getCaptchaImage() { + return request({ + url: '/captchaImage', + method: 'get' + }) +} diff --git a/sso-auth-center-vue/src/api/loginlog.js b/sso-auth-center-vue/src/api/loginlog.js new file mode 100755 index 0000000..08b1b3a --- /dev/null +++ b/sso-auth-center-vue/src/api/loginlog.js @@ -0,0 +1,11 @@ +import request from '@/utils/request' + +// 分页列表 +export function listLoginLog(query) { + return request({ + url: '/login/log/listPage', + method: 'get', + params: query + }) +} + diff --git a/sso-auth-center-vue/src/api/menu.js b/sso-auth-center-vue/src/api/menu.js new file mode 100755 index 0000000..8f2dd20 --- /dev/null +++ b/sso-auth-center-vue/src/api/menu.js @@ -0,0 +1,79 @@ +import request from '@/utils/request' + +// 获取路由 +export const getRouters = () => { + return request({ + url: '/getRouters', + method: 'get' + }) +} + +// 查询菜单列表 +export function listMenuTree(query) { + return request({ + url: '/menu/listMenuTree', + method: 'get', + params: query + }) +} + +// 查询菜单选项列表 +export function listMenuOptionTree(query) { + return request({ + url: '/menu/listMenuOptionTree', + method: 'get', + params: query + }) +} + +// 查询菜单详细 +export function getMenuDetail(menuId) { + return request({ + url: '/menu/detail/' + menuId, + method: 'get' + }) +} + + +// 新增菜单 +export function addMenu(data) { + return request({ + url: '/menu/add', + method: 'post', + data: data + }) +} + +// 修改菜单 +export function updateMenu(data) { + return request({ + url: '/menu/update', + method: 'put', + data: data + }) +} + +// 删除菜单 +export function delMenu(menuId) { + return request({ + url: '/menu/delete/' + menuId, + method: 'delete' + }) +} + +// 查询菜单下拉树结构 +export function treeselect() { + return request({ + url: '/menu/listMenuTree', + method: 'get' + }) +} + +// 根据角色ID查询菜单下拉树结构 +export function roleMenuTreeselect(roleId) { + return request({ + url: '/system/menu/roleMenuTreeselect/' + roleId, + method: 'get' + }) +} + diff --git a/sso-auth-center-vue/src/api/role.js b/sso-auth-center-vue/src/api/role.js new file mode 100755 index 0000000..3382a66 --- /dev/null +++ b/sso-auth-center-vue/src/api/role.js @@ -0,0 +1,64 @@ +import request from '@/utils/request' + +export function listPage(query) { + return request({ + url: '/role/listPage', + method: 'get', + params: query + }) +} + +//下拉选项 +export function listRoleOption(query) { + return request({ + url: '/role/listOption', + method: 'get', + params: query + }) +} + +// 查询角色详细 +export function getRoleDetail(roleId) { + return request({ + url: '/role/detail/' + roleId, + method: 'get' + }) +} + +// 新增角色 +export function addRole(data) { + return request({ + url: '/role/add', + method: 'post', + data: data + }) +} + +// 修改角色 +export function updateRole(data) { + return request({ + url: '/role/update', + method: 'put', + data: data + }) +} + +// 删除角色 +export function delRole(menuId) { + return request({ + url: '/role/delete/' + menuId, + method: 'delete' + }) +} + +// 移除角色用户绑定关系 +export function removeUserRole(roleId, userId) { + const data = { 'roleId': roleId, 'userId': userId } + return request({ + url: '/role/removeUser', + method: 'put', + data: data + }) +} + + diff --git a/sso-auth-center-vue/src/api/system.js b/sso-auth-center-vue/src/api/system.js new file mode 100755 index 0000000..60b4b69 --- /dev/null +++ b/sso-auth-center-vue/src/api/system.js @@ -0,0 +1,81 @@ +import request from '@/utils/request' + +// 我的平台列表 +export function platformMyList(query) { + return request({ + url: '/system/myList', + method: 'get', + params: query + }) +} + +// 我的平台排序 +export function sortMySystem(sysCodeList) { + const data = { 'sysCodeList': sysCodeList } + return request({ + url: '/system/sortMy', + method: 'post', + data: data + }) +} + +// 平台管理列表 +export function platformMgmtList(query) { + return request({ + url: '/system/mgmtList', + method: 'get', + params: query + }) +} + +// 系统详情 +export function getDetailBySysCode(query) { + return request({ + url: '/system/getDetailBySysCode?sysCode=' + query, + method: 'get' + }) +} + +// 新增平台 +export function addSystem(data) { + return request({ + url: '/system/add', + method: 'post', + data: data + }) +} + +// 修改平台 +export function updateSystem(data) { + return request({ + url: '/system/update', + method: 'put', + data: data + }) +} + +// 修改秘钥 +export function updateSecret(data) { + return request({ + url: '/system/updateSecret', + method: 'put', + data: data + }) +} + +// 修改图标 +export function uploadSysIcon(sysId, data) { + return request({ + url: '/system/uploadIcon/' + sysId, + method: 'post', + data: data + }) +} + +// 删除平台 +export function delSystem(sysId) { + return request({ + url: '/system/delete/' + sysId, + method: 'delete' + }) +} diff --git a/sso-auth-center-vue/src/api/systemMgmt.js b/sso-auth-center-vue/src/api/systemMgmt.js new file mode 100755 index 0000000..0bc9581 --- /dev/null +++ b/sso-auth-center-vue/src/api/systemMgmt.js @@ -0,0 +1,40 @@ +import request from '@/utils/request' + +// 系统管理员-用户分页列表 +export function listPageSystemMgmt(query) { + return request({ + url: '/systemMgmt/listPage', + method: 'get', + params: query + }) +} + +// 新增-管理员权限 +export function addSystemMgmt(data) { + return request({ + url: '/systemMgmt/add', + method: 'post', + data: data + }) +} + +// 移除-用户管理员权限 +export function removeUserSystemMgmt(sysCode, userId) { + const data = { 'sysCode': sysCode, 'userId': userId } + return request({ + url: '/systemMgmt/remove', + method: 'put', + data: data + }) +} + +// 修改状态-用户管理员权限 +export function updateSystemMgmtStatus(id, status) { + const data = { 'id': id, 'status': status } + return request({ + url: '/systemMgmt/updateStatus', + method: 'put', + data: data + }) +} + diff --git a/sso-auth-center-vue/src/api/table.js b/sso-auth-center-vue/src/api/table.js new file mode 100755 index 0000000..2752f52 --- /dev/null +++ b/sso-auth-center-vue/src/api/table.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function getList(params) { + return request({ + url: '/vue-admin-template/table/list', + method: 'get', + params + }) +} diff --git a/sso-auth-center-vue/src/api/user.js b/sso-auth-center-vue/src/api/user.js new file mode 100755 index 0000000..b1e0ebd --- /dev/null +++ b/sso-auth-center-vue/src/api/user.js @@ -0,0 +1,201 @@ +import request from '@/utils/request' + +export function login(data) { + return request({ + url: '/login', + method: 'post', + data + }) +} + +export function getInfo(token) { + return request({ + url: '/getUserInfo', + method: 'get', + params: { token } + }) +} + +export function logout() { + return request({ + url: '/logout', + method: 'post' + }) +} + +// 查询用户列表 +export function listUser(query) { + return request({ + url: '/user/listPage', + method: 'get', + params: query + }) +} + +// 根据用户名或者手机号-模糊查询用户下拉列表 +export function listUserOption(keywords) { + if (null === keywords || undefined === keywords) { + keywords = '' + } + return request({ + url: '/user/listUserOption?keywords=' + keywords, + method: 'get' + }) +} + +// 查询用户详细 +export function getDeptDetail(data) { + return request({ + url: '/user/detail', + method: 'post', + data: data + }) +} + +// 根据手机号查询 +export function getUserByPhone(phone) { + return request({ + url: '/user/getUserByPhone/' + phone, + method: 'get' + }) +} + +// 根据用户名查询 +export function getUserByUserName(username) { + return request({ + url: '/user/getUserByUserName/' + username, + method: 'get' + }) +} + +// 新增用户 +export function addUser(data) { + return request({ + url: '/user/add', + method: 'post', + data: data + }) +} + +// 修改用户 +export function updateUser(data) { + return request({ + url: '/user/update', + method: 'put', + data: data + }) +} + +// 移除用户系统关系 +export function removeUserSystem(data) { + return request({ + url: '/user/removeUserSystem', + method: 'put', + data: data + }) +} + +// 删除用户 +export function delUser(data) { + return request({ + url: '/user/delete', + method: 'put', + data: data + }) +} + +// 导出用户 +export function exportUser(query) { + return request({ + url: '/system/user/export', + method: 'get', + params: query + }) +} + +// 用户密码重置 +export function resetUserPwd(userId, password) { + const data = { + userId, + password + } + return request({ + url: '/user/resetPwd', + method: 'put', + data: data + }) +} + +// 用户状态修改 +export function changeUserStatus(userId, status) { + const data = { + userId, + status + } + return request({ + url: '/system/user/changeStatus', + method: 'put', + data: data + }) +} + +// 查询用户个人信息 +export function getUserProfile() { + return request({ + url: '/user/profile/detail', + method: 'get' + }) +} + +// 修改用户个人信息 +export function updateUserProfile(data) { + return request({ + url: '/user/profile/update', + method: 'put', + data: data + }) +} + +// 用户密码重置 +export function updateUserPwd(userId, oldPassword, newPassword) { + const data = { 'userId': userId, 'oldPassword': oldPassword, 'newPassword': newPassword } + return request({ + url: '/user/profile/updatePwd', + method: 'put', + data: data + }) +} + +// 用户头像上传 +export function uploadAvatar(data) { + return request({ + url: '/user/profile/avatar', + method: 'post', + data: data + }) +} + +// 在线用户列表 +export function listPageOnlineUser(query) { + return request({ + url: '/user/online/listPage', + method: 'get', + params: query + }) +} + +// 查看已登录子系统列表 +export function listOnlineSys(userId) { + return request({ + url: '/user/online/listOnlineSys/' + userId, + method: 'get' + }) +} + +// 强退用户 +export function retreatUser(userId) { + return request({ + url: '/user/online/retreatUser/' + userId, + method: 'put' + }) +} diff --git a/sso-auth-center-vue/src/assets/404_images/404.png b/sso-auth-center-vue/src/assets/404_images/404.png new file mode 100755 index 0000000..3d8e230 Binary files /dev/null and b/sso-auth-center-vue/src/assets/404_images/404.png differ diff --git a/sso-auth-center-vue/src/assets/404_images/404_cloud.png b/sso-auth-center-vue/src/assets/404_images/404_cloud.png new file mode 100755 index 0000000..c6281d0 Binary files /dev/null and b/sso-auth-center-vue/src/assets/404_images/404_cloud.png differ diff --git a/sso-auth-center-vue/src/assets/icons/index.js b/sso-auth-center-vue/src/assets/icons/index.js new file mode 100755 index 0000000..d79e164 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/index.js @@ -0,0 +1,9 @@ +import Vue from 'vue' +import SvgIcon from '@/components/SvgIcon'// svg component + +// register globally +Vue.component('svg-icon', SvgIcon) + +const req = require.context('./svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys().map(requireContext) +requireAll(req) diff --git a/sso-auth-center-vue/src/assets/icons/svg/404.svg b/sso-auth-center-vue/src/assets/icons/svg/404.svg new file mode 100755 index 0000000..6df5019 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/404.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/Moneyin_Income.svg b/sso-auth-center-vue/src/assets/icons/svg/Moneyin_Income.svg new file mode 100644 index 0000000..a46d463 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/Moneyin_Income.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/add-cart.svg b/sso-auth-center-vue/src/assets/icons/svg/add-cart.svg new file mode 100644 index 0000000..a2a9eb1 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/add-cart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/bug.svg b/sso-auth-center-vue/src/assets/icons/svg/bug.svg new file mode 100755 index 0000000..05a150d --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/bug.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/build.svg b/sso-auth-center-vue/src/assets/icons/svg/build.svg new file mode 100755 index 0000000..97c4688 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/build.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/cart- full.svg b/sso-auth-center-vue/src/assets/icons/svg/cart- full.svg new file mode 100644 index 0000000..bf8557c --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/cart- full.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/cascader.svg b/sso-auth-center-vue/src/assets/icons/svg/cascader.svg new file mode 100755 index 0000000..e256024 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/cascader.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/chart.svg b/sso-auth-center-vue/src/assets/icons/svg/chart.svg new file mode 100755 index 0000000..27728fb --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/chart.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/checkbox.svg b/sso-auth-center-vue/src/assets/icons/svg/checkbox.svg new file mode 100755 index 0000000..013fd3a --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/checkbox.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/clipboard.svg b/sso-auth-center-vue/src/assets/icons/svg/clipboard.svg new file mode 100755 index 0000000..90923ff --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/clipboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/code.svg b/sso-auth-center-vue/src/assets/icons/svg/code.svg new file mode 100755 index 0000000..ed4d23c --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/code.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/color.svg b/sso-auth-center-vue/src/assets/icons/svg/color.svg new file mode 100755 index 0000000..44a81aa --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/color.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/component.svg b/sso-auth-center-vue/src/assets/icons/svg/component.svg new file mode 100755 index 0000000..29c3458 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/component.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/dashboard.svg b/sso-auth-center-vue/src/assets/icons/svg/dashboard.svg new file mode 100644 index 0000000..5317d37 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/dashboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/data-center.svg b/sso-auth-center-vue/src/assets/icons/svg/data-center.svg new file mode 100644 index 0000000..cf59431 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/data-center.svg @@ -0,0 +1 @@ + diff --git a/sso-auth-center-vue/src/assets/icons/svg/date-range.svg b/sso-auth-center-vue/src/assets/icons/svg/date-range.svg new file mode 100755 index 0000000..fda571e --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/date-range.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/date.svg b/sso-auth-center-vue/src/assets/icons/svg/date.svg new file mode 100755 index 0000000..52dc73e --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/date.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/dict.svg b/sso-auth-center-vue/src/assets/icons/svg/dict.svg new file mode 100755 index 0000000..4849377 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/dict.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/documentation.svg b/sso-auth-center-vue/src/assets/icons/svg/documentation.svg new file mode 100755 index 0000000..7043122 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/documentation.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/download-exc.svg b/sso-auth-center-vue/src/assets/icons/svg/download-exc.svg new file mode 100644 index 0000000..4937175 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/download-exc.svg @@ -0,0 +1 @@ + diff --git a/sso-auth-center-vue/src/assets/icons/svg/download.svg b/sso-auth-center-vue/src/assets/icons/svg/download.svg new file mode 100755 index 0000000..c896951 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/download.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/drag.svg b/sso-auth-center-vue/src/assets/icons/svg/drag.svg new file mode 100755 index 0000000..4185d3c --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/drag.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/druid.svg b/sso-auth-center-vue/src/assets/icons/svg/druid.svg new file mode 100755 index 0000000..a2b4b4e --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/druid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/edit.svg b/sso-auth-center-vue/src/assets/icons/svg/edit.svg new file mode 100755 index 0000000..d26101f --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/edit.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/education.svg b/sso-auth-center-vue/src/assets/icons/svg/education.svg new file mode 100755 index 0000000..7bfb01d --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/education.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/email.svg b/sso-auth-center-vue/src/assets/icons/svg/email.svg new file mode 100755 index 0000000..74d25e2 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/email.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/example.svg b/sso-auth-center-vue/src/assets/icons/svg/example.svg new file mode 100644 index 0000000..46f42b5 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/example.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/excel.svg b/sso-auth-center-vue/src/assets/icons/svg/excel.svg new file mode 100755 index 0000000..74d97b8 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/excel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/exit-fullscreen.svg b/sso-auth-center-vue/src/assets/icons/svg/exit-fullscreen.svg new file mode 100755 index 0000000..485c128 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/exit-fullscreen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/eye-open.svg b/sso-auth-center-vue/src/assets/icons/svg/eye-open.svg new file mode 100644 index 0000000..88dcc98 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/eye-open.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/eye.svg b/sso-auth-center-vue/src/assets/icons/svg/eye.svg new file mode 100644 index 0000000..16ed2d8 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/eye.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/firePlan.svg b/sso-auth-center-vue/src/assets/icons/svg/firePlan.svg new file mode 100644 index 0000000..f7be927 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/firePlan.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/form.svg b/sso-auth-center-vue/src/assets/icons/svg/form.svg new file mode 100644 index 0000000..dcbaa18 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/form.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/fullscreen.svg b/sso-auth-center-vue/src/assets/icons/svg/fullscreen.svg new file mode 100755 index 0000000..0e86b6f --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/fullscreen.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/funds-income.svg b/sso-auth-center-vue/src/assets/icons/svg/funds-income.svg new file mode 100644 index 0000000..39c40fb --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/funds-income.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/github.svg b/sso-auth-center-vue/src/assets/icons/svg/github.svg new file mode 100755 index 0000000..db0a0d4 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/guide.svg b/sso-auth-center-vue/src/assets/icons/svg/guide.svg new file mode 100755 index 0000000..b271001 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/guide.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/icon.svg b/sso-auth-center-vue/src/assets/icons/svg/icon.svg new file mode 100755 index 0000000..82be8ee --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/input.svg b/sso-auth-center-vue/src/assets/icons/svg/input.svg new file mode 100755 index 0000000..ab91381 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/input.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/international.svg b/sso-auth-center-vue/src/assets/icons/svg/international.svg new file mode 100755 index 0000000..e9b56ee --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/international.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/job.svg b/sso-auth-center-vue/src/assets/icons/svg/job.svg new file mode 100755 index 0000000..2a93a25 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/job.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/language.svg b/sso-auth-center-vue/src/assets/icons/svg/language.svg new file mode 100755 index 0000000..0082b57 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/language.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/link.svg b/sso-auth-center-vue/src/assets/icons/svg/link.svg new file mode 100644 index 0000000..48197ba --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/link.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/list.svg b/sso-auth-center-vue/src/assets/icons/svg/list.svg new file mode 100755 index 0000000..20259ed --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/list.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/lock.svg b/sso-auth-center-vue/src/assets/icons/svg/lock.svg new file mode 100755 index 0000000..74fee54 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/lock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/log.svg b/sso-auth-center-vue/src/assets/icons/svg/log.svg new file mode 100644 index 0000000..a59523e --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/log.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/logTwo.svg b/sso-auth-center-vue/src/assets/icons/svg/logTwo.svg new file mode 100755 index 0000000..d879d33 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/logTwo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/logininfor.svg b/sso-auth-center-vue/src/assets/icons/svg/logininfor.svg new file mode 100755 index 0000000..267f844 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/logininfor.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/message.svg b/sso-auth-center-vue/src/assets/icons/svg/message.svg new file mode 100755 index 0000000..14ca817 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/message.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/money.svg b/sso-auth-center-vue/src/assets/icons/svg/money.svg new file mode 100755 index 0000000..c1580de --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/money.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/monitor.svg b/sso-auth-center-vue/src/assets/icons/svg/monitor.svg new file mode 100755 index 0000000..70db62b --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/monitor.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/nested.svg b/sso-auth-center-vue/src/assets/icons/svg/nested.svg new file mode 100644 index 0000000..06713a8 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/nested.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/number.svg b/sso-auth-center-vue/src/assets/icons/svg/number.svg new file mode 100755 index 0000000..ad5ce9a --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/number.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/online.svg b/sso-auth-center-vue/src/assets/icons/svg/online.svg new file mode 100755 index 0000000..330a202 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/online.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/onlineUser.svg b/sso-auth-center-vue/src/assets/icons/svg/onlineUser.svg new file mode 100644 index 0000000..85ebff7 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/onlineUser.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/operation.svg b/sso-auth-center-vue/src/assets/icons/svg/operation.svg new file mode 100644 index 0000000..ca55872 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/operation.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/password.svg b/sso-auth-center-vue/src/assets/icons/svg/password.svg new file mode 100644 index 0000000..6c64def --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/password.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/pdf.svg b/sso-auth-center-vue/src/assets/icons/svg/pdf.svg new file mode 100755 index 0000000..957aa0c --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/pdf.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/people.svg b/sso-auth-center-vue/src/assets/icons/svg/people.svg new file mode 100755 index 0000000..2bd54ae --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/people.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/peoples.svg b/sso-auth-center-vue/src/assets/icons/svg/peoples.svg new file mode 100755 index 0000000..aab852e --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/peoples.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/phone.svg b/sso-auth-center-vue/src/assets/icons/svg/phone.svg new file mode 100755 index 0000000..ab8e8c4 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/phone.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/post.svg b/sso-auth-center-vue/src/assets/icons/svg/post.svg new file mode 100755 index 0000000..2922c61 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/post.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/prompt.svg b/sso-auth-center-vue/src/assets/icons/svg/prompt.svg new file mode 100644 index 0000000..a975509 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/prompt.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/qq.svg b/sso-auth-center-vue/src/assets/icons/svg/qq.svg new file mode 100755 index 0000000..ee13d4e --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/qq.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/question.svg b/sso-auth-center-vue/src/assets/icons/svg/question.svg new file mode 100755 index 0000000..cf75bd4 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/question.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/radio.svg b/sso-auth-center-vue/src/assets/icons/svg/radio.svg new file mode 100755 index 0000000..0cde345 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/radio.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/rate.svg b/sso-auth-center-vue/src/assets/icons/svg/rate.svg new file mode 100755 index 0000000..aa3b14d --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/rate.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/role.svg b/sso-auth-center-vue/src/assets/icons/svg/role.svg new file mode 100644 index 0000000..e957178 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/role.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/row.svg b/sso-auth-center-vue/src/assets/icons/svg/row.svg new file mode 100755 index 0000000..0780992 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/row.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/sales.svg b/sso-auth-center-vue/src/assets/icons/svg/sales.svg new file mode 100644 index 0000000..4334c83 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/sales.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/search.svg b/sso-auth-center-vue/src/assets/icons/svg/search.svg new file mode 100755 index 0000000..84233dd --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/search.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/select.svg b/sso-auth-center-vue/src/assets/icons/svg/select.svg new file mode 100755 index 0000000..d628382 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/select.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/server.svg b/sso-auth-center-vue/src/assets/icons/svg/server.svg new file mode 100755 index 0000000..ca37b00 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/server.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/shopping.svg b/sso-auth-center-vue/src/assets/icons/svg/shopping.svg new file mode 100755 index 0000000..87513e7 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/shopping.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/size.svg b/sso-auth-center-vue/src/assets/icons/svg/size.svg new file mode 100755 index 0000000..ddb25b8 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/size.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/skill.svg b/sso-auth-center-vue/src/assets/icons/svg/skill.svg new file mode 100755 index 0000000..a3b7312 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/skill.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/slider.svg b/sso-auth-center-vue/src/assets/icons/svg/slider.svg new file mode 100755 index 0000000..fbe4f39 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/slider.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/star.svg b/sso-auth-center-vue/src/assets/icons/svg/star.svg new file mode 100755 index 0000000..6cf86e6 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/star.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/svg_ income.svg b/sso-auth-center-vue/src/assets/icons/svg/svg_ income.svg new file mode 100644 index 0000000..7fdede1 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/svg_ income.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/swagger.svg b/sso-auth-center-vue/src/assets/icons/svg/swagger.svg new file mode 100755 index 0000000..05d4e7b --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/swagger.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/switch.svg b/sso-auth-center-vue/src/assets/icons/svg/switch.svg new file mode 100755 index 0000000..0ba61e3 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/switch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/system.svg b/sso-auth-center-vue/src/assets/icons/svg/system.svg new file mode 100755 index 0000000..86cb938 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/system.svg @@ -0,0 +1,2 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/tab.svg b/sso-auth-center-vue/src/assets/icons/svg/tab.svg new file mode 100755 index 0000000..b4b48e4 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/tab.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/table.svg b/sso-auth-center-vue/src/assets/icons/svg/table.svg new file mode 100644 index 0000000..0e3dc9d --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/textarea.svg b/sso-auth-center-vue/src/assets/icons/svg/textarea.svg new file mode 100755 index 0000000..2709f29 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/textarea.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/theme.svg b/sso-auth-center-vue/src/assets/icons/svg/theme.svg new file mode 100755 index 0000000..5982a2f --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/theme.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/time-range.svg b/sso-auth-center-vue/src/assets/icons/svg/time-range.svg new file mode 100755 index 0000000..13c1202 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/time-range.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/time.svg b/sso-auth-center-vue/src/assets/icons/svg/time.svg new file mode 100755 index 0000000..b376e32 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/time.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/tool.svg b/sso-auth-center-vue/src/assets/icons/svg/tool.svg new file mode 100755 index 0000000..c813067 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/tool.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/tree-table.svg b/sso-auth-center-vue/src/assets/icons/svg/tree-table.svg new file mode 100755 index 0000000..8aafdb8 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/tree-table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/tree.svg b/sso-auth-center-vue/src/assets/icons/svg/tree.svg new file mode 100644 index 0000000..dd4b7dd --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/tree.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/upload.svg b/sso-auth-center-vue/src/assets/icons/svg/upload.svg new file mode 100755 index 0000000..bae49c0 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/upload.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/user.svg b/sso-auth-center-vue/src/assets/icons/svg/user.svg new file mode 100644 index 0000000..0ba0716 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/user.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/userMgmt.svg b/sso-auth-center-vue/src/assets/icons/svg/userMgmt.svg new file mode 100644 index 0000000..116da7e --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/userMgmt.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/validCode.svg b/sso-auth-center-vue/src/assets/icons/svg/validCode.svg new file mode 100755 index 0000000..cfb1021 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/validCode.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/wechat.svg b/sso-auth-center-vue/src/assets/icons/svg/wechat.svg new file mode 100755 index 0000000..c586e55 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/wechat.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svg/zip.svg b/sso-auth-center-vue/src/assets/icons/svg/zip.svg new file mode 100755 index 0000000..f806fc4 --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svg/zip.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/sso-auth-center-vue/src/assets/icons/svgo.yml b/sso-auth-center-vue/src/assets/icons/svgo.yml new file mode 100755 index 0000000..14f8f5c --- /dev/null +++ b/sso-auth-center-vue/src/assets/icons/svgo.yml @@ -0,0 +1,22 @@ +# replace default config + +# multipass: true +# full: true + +plugins: + + # - name + # + # or: + # - name: false + # - name: true + # + # or: + # - name: + # param1: 1 + # param2: 2 + +- removeAttrs: + attrs: + - 'fill' + - 'fill-rule' diff --git a/sso-auth-center-vue/src/assets/image/default-system.jpg b/sso-auth-center-vue/src/assets/image/default-system.jpg new file mode 100644 index 0000000..02c48a1 Binary files /dev/null and b/sso-auth-center-vue/src/assets/image/default-system.jpg differ diff --git a/sso-auth-center-vue/src/assets/image/login-background.jpg b/sso-auth-center-vue/src/assets/image/login-background.jpg new file mode 100644 index 0000000..002b87b Binary files /dev/null and b/sso-auth-center-vue/src/assets/image/login-background.jpg differ diff --git a/sso-auth-center-vue/src/assets/image/login-background1.jpg b/sso-auth-center-vue/src/assets/image/login-background1.jpg new file mode 100644 index 0000000..e1728ae Binary files /dev/null and b/sso-auth-center-vue/src/assets/image/login-background1.jpg differ diff --git a/sso-auth-center-vue/src/assets/image/profile.jpg b/sso-auth-center-vue/src/assets/image/profile.jpg new file mode 100644 index 0000000..cb3ed2e Binary files /dev/null and b/sso-auth-center-vue/src/assets/image/profile.jpg differ diff --git a/sso-auth-center-vue/src/assets/logo/logo.png b/sso-auth-center-vue/src/assets/logo/logo.png new file mode 100644 index 0000000..80ff02c Binary files /dev/null and b/sso-auth-center-vue/src/assets/logo/logo.png differ diff --git a/sso-auth-center-vue/src/components/HelpHint/index.vue b/sso-auth-center-vue/src/components/HelpHint/index.vue new file mode 100644 index 0000000..11afdf3 --- /dev/null +++ b/sso-auth-center-vue/src/components/HelpHint/index.vue @@ -0,0 +1,23 @@ + + + diff --git a/sso-auth-center-vue/src/components/IconSelect/index.vue b/sso-auth-center-vue/src/components/IconSelect/index.vue new file mode 100755 index 0000000..f910d7f --- /dev/null +++ b/sso-auth-center-vue/src/components/IconSelect/index.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/sso-auth-center-vue/src/components/IconSelect/requireIcons.js b/sso-auth-center-vue/src/components/IconSelect/requireIcons.js new file mode 100755 index 0000000..5d3005d --- /dev/null +++ b/sso-auth-center-vue/src/components/IconSelect/requireIcons.js @@ -0,0 +1,11 @@ + +const req = require.context('../../assets/icons/svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys() + +const re = /\.\/(.*)\.svg/ + +const icons = requireAll(req).map(i => { + return i.match(re)[1] +}) + +export default icons diff --git a/sso-auth-center-vue/src/components/Pagination/index.vue b/sso-auth-center-vue/src/components/Pagination/index.vue new file mode 100755 index 0000000..c449c6f --- /dev/null +++ b/sso-auth-center-vue/src/components/Pagination/index.vue @@ -0,0 +1,101 @@ + + + + + diff --git a/sso-auth-center-vue/src/components/SvgIcon/index.vue b/sso-auth-center-vue/src/components/SvgIcon/index.vue new file mode 100755 index 0000000..86f2b17 --- /dev/null +++ b/sso-auth-center-vue/src/components/SvgIcon/index.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/sso-auth-center-vue/src/directive/permission/hasPermission.js b/sso-auth-center-vue/src/directive/permission/hasPermission.js new file mode 100755 index 0000000..af92690 --- /dev/null +++ b/sso-auth-center-vue/src/directive/permission/hasPermission.js @@ -0,0 +1,23 @@ +import store from '@/store' + +export default { + inserted(el, binding, vnode) { + const { value } = binding + const all_permission = "**"; + const permissions = store.getters && store.getters.permissions + + if (value && value instanceof Array && value.length > 0) { + const permissionFlag = value + + const hasPermissions = permissions.some(permission => { + return all_permission === permission || permissionFlag.includes(permission) + }) + + if (!hasPermissions) { + el.parentNode && el.parentNode.removeChild(el) + } + } else { + throw new Error(`请设置操作权限标签值`) + } + } +} diff --git a/sso-auth-center-vue/src/directive/permission/hasRole.js b/sso-auth-center-vue/src/directive/permission/hasRole.js new file mode 100755 index 0000000..df0e15b --- /dev/null +++ b/sso-auth-center-vue/src/directive/permission/hasRole.js @@ -0,0 +1,23 @@ +import store from '@/store' + +export default { + inserted(el, binding, vnode) { + const { value } = binding + const super_admin = "admin"; + const roles = store.getters && store.getters.roles + + if (value && value instanceof Array && value.length > 0) { + const roleFlag = value + + const hasRole = roles.some(role => { + return super_admin === role || roleFlag.includes(role) + }) + + if (!hasRole) { + el.parentNode && el.parentNode.removeChild(el) + } + } else { + throw new Error(`请设置角色权限标签值"`) + } + } +} diff --git a/sso-auth-center-vue/src/directive/permission/index.js b/sso-auth-center-vue/src/directive/permission/index.js new file mode 100755 index 0000000..2c8e6b4 --- /dev/null +++ b/sso-auth-center-vue/src/directive/permission/index.js @@ -0,0 +1,15 @@ +import hasRole from './hasRole' +import hasPermi from './hasPermission' + +const install = function(Vue) { + Vue.directive('hasRole', hasRole) + Vue.directive('hasPermission', hasPermi) +} + +if (window.Vue) { + window['hasRole'] = hasRole + window['hasPermission'] = hasPermi + Vue.use(install); // eslint-disable-line +} + +export default install diff --git a/sso-auth-center-vue/src/layout/Logo.vue b/sso-auth-center-vue/src/layout/Logo.vue new file mode 100644 index 0000000..2d87b68 --- /dev/null +++ b/sso-auth-center-vue/src/layout/Logo.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/sso-auth-center-vue/src/layout/index.vue b/sso-auth-center-vue/src/layout/index.vue new file mode 100644 index 0000000..2dd5f67 --- /dev/null +++ b/sso-auth-center-vue/src/layout/index.vue @@ -0,0 +1,392 @@ + + + + + + + + diff --git a/sso-auth-center-vue/src/main.js b/sso-auth-center-vue/src/main.js new file mode 100755 index 0000000..0dcb477 --- /dev/null +++ b/sso-auth-center-vue/src/main.js @@ -0,0 +1,66 @@ +import Vue from 'vue' + +import 'normalize.css/normalize.css' // A modern alternative to CSS resets +import ElementUI from 'element-ui' +import 'element-ui/lib/theme-chalk/index.css' +import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n +import Pagination from '@/components/Pagination' + +import { handleTree, resetForm,hasSomePermission } from '@/utils/admin-util' + +import '@/styles/index.scss' // global css +import App from './App' +import store from './store' +import router from './router' +import permission from './directive/permission' + +import './assets/icons' // ico +import './permission' // permission control + +Vue.prototype.msgSuccess = function(msg) { + this.$message({ showClose: true, message: msg, type: 'success' }) +} + +Vue.prototype.msgError = function(msg) { + this.$message({ showClose: true, message: msg, type: 'error' }) +} + +Vue.prototype.msgInfo = function(msg) { + this.$message.info(msg) +} + +/** + * If you don't want to use mock-server + * you want to use MockJs for mock api + * you can execute: mockXHR() + * + * Currently MockJs will be used in the production environment, + * please remove it before going online ! ! ! + */ +if (process.env.NODE_ENV === 'production') { + const { mockXHR } = require('../mock') + mockXHR() +} + +// 全局方法挂载 +Vue.prototype.handleTree = handleTree +Vue.prototype.resetForm = resetForm +Vue.prototype.hasSomePermission = hasSomePermission + +// 全局组件挂载 +Vue.component('Pagination', Pagination) +Vue.use(permission) + +// set ElementUI lang to EN +Vue.use(ElementUI, { locale }) +// 如果想要中文版 element-ui,按如下方式声明 +// Vue.use(ElementUI) + +Vue.config.productionTip = false + +new Vue({ + el: '#app', + router, + store, + render: h => h(App) +}) diff --git a/sso-auth-center-vue/src/permission.js b/sso-auth-center-vue/src/permission.js new file mode 100755 index 0000000..1dfcc60 --- /dev/null +++ b/sso-auth-center-vue/src/permission.js @@ -0,0 +1,57 @@ +import router from './router' +import store from './store' +import { Message } from 'element-ui' +import NProgress from 'nprogress' +import 'nprogress/nprogress.css' +import { getToken } from '@/utils/token' +// NProgress Configuration +NProgress.configure({ showSpinner: false }) + +//免登录白名单 +const whiteList = ['/login'] + +router.beforeEach((to, from, next) => { + NProgress.start() + if (getToken()) { + //has token + if (to.path === '/login') { + let redirectUrl = to.query.redirectUrl + if (null !== redirectUrl && '' !== redirectUrl && redirectUrl !== undefined) { + window.location.href = redirectUrl + '?ssoToken=' + getToken() + }else { + next({ path: '/' }) + NProgress.done() + } + } else { + if (store.getters.name === '') { + // 判断当前用户是否已拉取完user_info信息 + store.dispatch('user/GetInfo').then(res => { + // 拉取user_info + const roles = res.data.roles + next({ ...to, replace: true }) + }) + .catch(err => { + store.dispatch('user/FedLogOut').then(() => { + Message.error(err) + next({ path: '/' }) + }) + }) + } else { + next() + } + } + } else { + // 没有token + if (whiteList.indexOf(to.path) !== -1) { + // 在免登录白名单,直接进入 + next() + } else { + next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 + NProgress.done() + } + } +}) + +router.afterEach(() => { + NProgress.done() +}) diff --git a/sso-auth-center-vue/src/router/index.js b/sso-auth-center-vue/src/router/index.js new file mode 100755 index 0000000..149e71f --- /dev/null +++ b/sso-auth-center-vue/src/router/index.js @@ -0,0 +1,232 @@ +import Vue from 'vue' +import Router from 'vue-router' +/* 布局组件 Layout */ +import Layout from '@/layout/index' + +Vue.use(Router) + +/** + * Note: sub-menu only appear when route children.length >= 1 + * Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html + * + * hidden: true if set true, item will not show in the sidebar(default is false) + * alwaysShow: true if set true, will always show the root menu + * if not set alwaysShow, when item has more than one children route, + * it will becomes nested mode, otherwise not show the root menu + * redirect: noRedirect if set noRedirect will no redirect in the breadcrumb + * name:'router-name' the name is used by (must set!!!) + * meta : { + roles: ['admin','editor'] control the page roles (you can set multiple roles) + title: 'title' the name show in sidebar and breadcrumb (recommend set) + icon: 'svg-name'/'el-icon-x' the icon show in the sidebar + breadcrumb: false if set false, the item will hidden in breadcrumb(default is true) + activeMenu: '/example/list' if set path, the sidebar will highlight the path you set + } + */ + +/** + * constantRoutes + * a base page that does not have permission requirements + * all roles can be accessed + */ +export const constantRoutes = [ + { + path: '/login', + component: () => import('@/views/login/index'), + hidden: true + }, + { + path: '/404', + component: () => import('@/views/404'), + hidden: true + }, + { + path: '/', + component: Layout, + redirect: '/myPlatform/index', + hidden: true + }, + { + path: '/user/profile', + component: Layout, + children: [ + { + path: 'index', + name: 'profile', + component: () => import('@/views/sso/user/profile/index'), + meta: { title: '个人详情', icon: '#' } + } + ] + }, + { + path: '/myPlatform', + component: Layout, + children: [ + { + path: 'index', + name: 'myPlatform', + component: () => import('@/views/sso/platform/platformMy'), + meta: { title: '我的平台', icon: '#' } + } + ] + }, + { + path: '/platformSort', + component: Layout, + children: [ + { + path: 'index', + name: 'platformSort', + component: () => import('@/views/sso/platform/platformSort'), + meta: { title: '平台排序', icon: '#' }, + hidden: true + } + ] + }, + { + path: '/platformMgmt', + component: Layout, + children: [ + { + path: 'index', + name: 'platformMgmt', + component: () => import('@/views/sso/platform/platformMgmt'), + meta: { title: '平台管理', icon: '#' } + } + ] + }, + { + path: '/user', + component: Layout, + children: [ + { + path: 'index', + name: 'user', + component: () => import('@/views/sso/user/index'), + meta: { title: '用户管理', icon: 'dept' } + } + ] + }, + { + path: '/dept', + component: Layout, + children: [ + { + path: 'index', + name: 'dept', + component: () => import('@/views/sso/dept/index'), + meta: { title: '部门管理', icon: 'dept' } + } + ] + }, + { + path: '/menu', + component: Layout, + children: [ + { + path: 'index', + name: 'menu', + component: () => import('@/views/sso/menu/index'), + meta: { title: '菜单管理', icon: 'menu' } + } + ] + }, + { + path: '/role', + component: Layout, + children: [ + { + path: 'index', + name: 'role', + component: () => import('@/views/sso/role/index'), + meta: { title: '角色管理', icon: 'dept' } + } + ] + }, + { + path: '/userRole', + component: Layout, + children: [ + { + path: 'index', + name: 'userRole', + component: () => import('@/views/sso/role/userRoleIndex'), + meta: { title: '角色用户', icon: 'dept' }, + hidden: true + } + ] + }, + { + path: '/systemMgmt', + component: Layout, + children: [ + { + path: 'index', + name: 'systemMgmt', + component: () => import('@/views/sso/platform/systemMgmtIndex'), + meta: { title: '系统管理', icon: '' }, + hidden: true + } + ] + }, + { + path: '/platformMgmt', + name: 'PlatformMgmtName', + component: Layout, + children: [ + { + path: 'platformDetail', + name: 'PlatformMgmtDetail', + component: () => import('@/views/sso/platform/platformDetail'), + meta: { title: 'platformMgmt', icon: 'platformMgmt' }, + hidden: true + } + ] + }, + { + path: '/log', + name: 'log', + component: Layout, + children: [ + { + path: 'index', + name: 'logIndex', + component: () => import('@/views/sso/log/index'), + meta: { title: '日志', icon: '' }, + hidden: true + } + ] + }, + { + path: '/userOnline', + name: 'userOnline', + component: Layout, + children: [ + { + path: 'index', + name: 'userOnline', + component: () => import('@/views/sso/user/online/index'), + meta: { title: '在线用户', icon: '' }, + hidden: true + } + ] + }, + // 404 page must be placed at the end !!! + { path: '*', redirect: '/404', hidden: true } +] + +const createRouter = () => new Router({ + mode: 'history', + scrollBehavior: () => ({ y: 0 }), + routes: constantRoutes +}) + +const router = createRouter() + +// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 +export function resetRouter() { + const newRouter = createRouter() + router.matcher = newRouter.matcher // reset router +} + +export default router diff --git a/sso-auth-center-vue/src/settings.js b/sso-auth-center-vue/src/settings.js new file mode 100755 index 0000000..674abca --- /dev/null +++ b/sso-auth-center-vue/src/settings.js @@ -0,0 +1,16 @@ +module.exports = { + + title: '小强认证中心', + + /** + * @type {boolean} true | false + * @description Whether fix the header + */ + fixedHeader: true, + + /** + * @type {boolean} true | false + * @description Whether show the logo in sidebar + */ + sidebarLogo: true +} diff --git a/sso-auth-center-vue/src/store/getters.js b/sso-auth-center-vue/src/store/getters.js new file mode 100755 index 0000000..7add241 --- /dev/null +++ b/sso-auth-center-vue/src/store/getters.js @@ -0,0 +1,12 @@ +const getters = { + sidebar: state => state.app.sidebar, + device: state => state.app.device, + token: state => state.user.token, + avatar: state => state.user.avatar, + name: state => state.user.name, + roles: state => state.user.roles, + permissions: state => state.user.permissions, + menuList: state => state.user.menuList, + menuMap: state => state.user.menuMap +} +export default getters diff --git a/sso-auth-center-vue/src/store/index.js b/sso-auth-center-vue/src/store/index.js new file mode 100755 index 0000000..9d6e5a4 --- /dev/null +++ b/sso-auth-center-vue/src/store/index.js @@ -0,0 +1,23 @@ +import Vue from 'vue' +import Vuex from 'vuex' +import getters from './getters' +import app from './modules/app' +import settings from './modules/settings' +import user from './modules/user' +import common from './modules/common' + +Vue.use(Vuex) + + +// 这里放全局参数 +const store = new Vuex.Store({ + modules: { + app, + settings, + user, + common + }, + getters +}) + +export default store diff --git a/sso-auth-center-vue/src/store/modules/app.js b/sso-auth-center-vue/src/store/modules/app.js new file mode 100755 index 0000000..7ea7e33 --- /dev/null +++ b/sso-auth-center-vue/src/store/modules/app.js @@ -0,0 +1,48 @@ +import Cookies from 'js-cookie' + +const state = { + sidebar: { + opened: Cookies.get('sidebarStatus') ? !!+Cookies.get('sidebarStatus') : true, + withoutAnimation: false + }, + device: 'desktop' +} + +const mutations = { + TOGGLE_SIDEBAR: state => { + state.sidebar.opened = !state.sidebar.opened + state.sidebar.withoutAnimation = false + if (state.sidebar.opened) { + Cookies.set('sidebarStatus', 1) + } else { + Cookies.set('sidebarStatus', 0) + } + }, + CLOSE_SIDEBAR: (state, withoutAnimation) => { + Cookies.set('sidebarStatus', 0) + state.sidebar.opened = false + state.sidebar.withoutAnimation = withoutAnimation + }, + TOGGLE_DEVICE: (state, device) => { + state.device = device + } +} + +const actions = { + toggleSideBar({ commit }) { + commit('TOGGLE_SIDEBAR') + }, + closeSideBar({ commit }, { withoutAnimation }) { + commit('CLOSE_SIDEBAR', withoutAnimation) + }, + toggleDevice({ commit }, device) { + commit('TOGGLE_DEVICE', device) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/sso-auth-center-vue/src/store/modules/common.js b/sso-auth-center-vue/src/store/modules/common.js new file mode 100644 index 0000000..17913f7 --- /dev/null +++ b/sso-auth-center-vue/src/store/modules/common.js @@ -0,0 +1,18 @@ +const common = { + state: { + isCollapse: false + }, + mutations: { + // 折叠侧边栏 + TOGGLE_SIDEBAR(state) { + state.isCollapse = !state.isCollapse + } + }, + actions: { + toggleSidebar({ commit }) { + commit('TOGGLE_SIDEBAR') + } + } +} + +export default common \ No newline at end of file diff --git a/sso-auth-center-vue/src/store/modules/permission.js b/sso-auth-center-vue/src/store/modules/permission.js new file mode 100755 index 0000000..deed451 --- /dev/null +++ b/sso-auth-center-vue/src/store/modules/permission.js @@ -0,0 +1,54 @@ +import { constantRoutes } from '@/router' +import { getRouters } from '@/api/menu' +import Layout from '@/layout/index' + +const permission = { + state: { + routes: [], + addRoutes: [] + }, + mutations: { + SET_ROUTES: (state, routes) => { + state.addRoutes = routes + state.routes = constantRoutes.concat(routes) + } + }, + actions: { + // 生成路由 + GenerateRoutes({ commit }) { + return new Promise(resolve => { + // 向后端请求路由数据 + getRouters().then(res => { + const accessedRoutes = filterAsyncRouter(res.data) + accessedRoutes.push({ path: '*', redirect: '/404', hidden: true }) + commit('SET_ROUTES', accessedRoutes) + resolve(accessedRoutes) + }) + }) + } + } +} + +// 遍历后台传来的路由字符串,转换为组件对象 +function filterAsyncRouter(asyncRouterMap) { + return asyncRouterMap.filter(route => { + if (route.component) { + // Layout组件特殊处理 + if (route.component === 'Layout') { + route.component = Layout + } else { + route.component = loadView(route.component) + } + } + if (route.children != null && route.children && route.children.length) { + route.children = filterAsyncRouter(route.children) + } + return true + }) +} + +export const loadView = (view) => { // 路由懒加载 + return (resolve) => require([`@/views/${view}`], resolve) +} + +export default permission diff --git a/sso-auth-center-vue/src/store/modules/settings.js b/sso-auth-center-vue/src/store/modules/settings.js new file mode 100755 index 0000000..b3f33f8 --- /dev/null +++ b/sso-auth-center-vue/src/store/modules/settings.js @@ -0,0 +1,32 @@ +import defaultSettings from '@/settings' + +const { showSettings, fixedHeader, sidebarLogo } = defaultSettings + +const state = { + showSettings: showSettings, + fixedHeader: fixedHeader, + sidebarLogo: sidebarLogo +} + +const mutations = { + CHANGE_SETTING: (state, { key, value }) => { + // eslint-disable-next-line no-prototype-builtins + if (state.hasOwnProperty(key)) { + state[key] = value + } + } +} + +const actions = { + changeSetting({ commit }, data) { + commit('CHANGE_SETTING', data) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} + diff --git a/sso-auth-center-vue/src/store/modules/user.js b/sso-auth-center-vue/src/store/modules/user.js new file mode 100755 index 0000000..d4f2a18 --- /dev/null +++ b/sso-auth-center-vue/src/store/modules/user.js @@ -0,0 +1,153 @@ +import { getUserInfo, login, logout } from '@/api/login' +import { getToken, removeToken, setToken } from '@/utils/token' +import { isExternal } from '@/utils/validate' + +const getDefaultState = () => { + return { + token: getToken(), + name: '', + avatar: '', + roles: null, + permissions: [], + //头部菜单(一级菜单) + menuList: [], + menuMap: [] + } +} + +const state = getDefaultState() + +const mutations = { + // RESET_STATE: (state) => { + // Object.assign(state, getDefaultState()) + // }, + SET_TOKEN: (state, token) => { + state.token = token + }, + SET_NAME: (state, name) => { + state.name = name + }, + SET_AVATAR: (state, avatar) => { + state.avatar = avatar + }, + SET_ROLES: (state, roles) => { + state.roles = roles + }, + SET_PERMISSIONS: (state, permissions) => { + state.permissions = permissions + }, + SET_MENU_LIST: (state, menuList) => { + state.menuList = menuList + }, + SET_MENU_MAP: (state, menuMap) => { + state.menuMap = menuMap + } +} + +const actions = { + // 登录 + Login({ commit }, userInfo) { + const username = userInfo.username.trim() + const password = userInfo.password + const captchaCode = userInfo.captchaCode + const requestId = userInfo.requestId + return new Promise((resolve, reject) => { + login(username, password, captchaCode, requestId).then(res => { + setToken(res.data.token) + commit('SET_TOKEN', res.data.token) + resolve() + }).catch(error => { + reject(error) + }) + }) + }, + // 获取用户信息 + GetInfo({ commit, state }) { + return new Promise((resolve, reject) => { + getUserInfo(state.token).then(res => { + const user = res.data.user + let avatar + + //用户头像-若不存在设置默认头像 + if (null == user.avatar || '' === user.avatar) { + avatar = require('@/assets/image/profile.jpg') + } else { + //如果是外链则不处理 + if (isExternal(user.avatar)) { + avatar = user.avatar + } else { + avatar = process.env.VUE_APP_BASE_API + user.avatar + } + } + //角色数组 + if (res.data.roleKeyList && res.data.roleKeyList.length > 0) { + commit('SET_ROLES', res.data.roleKeyList) + } else { + commit('SET_ROLES', []) + } + //权限数组 + if (res.data.permissionList && res.data.permissionList.length > 0) { + commit('SET_PERMISSIONS', res.data.permissionList) + } + + //菜单-数组 + if (res.data.menuList && res.data.menuList.length > 0) { + commit('SET_MENU_LIST', res.data.menuList) + let menuMap = new Map() + for (let i in res.data.menuList) { + const menu = res.data.menuList[i] + menuMap.set(menu.path, menu) + } + commit('SET_MENU_MAP', menuMap) + } else { + commit('SET_MENU_LIST', []) + commit('SET_MENU_MAP', new Map()) + } + + commit('SET_NAME', user.username) + commit('SET_AVATAR', avatar) + resolve(res) + }).catch(error => { + reject(error) + }) + }) + }, + + // 退出系统 + LogOut({ commit, state }) { + return new Promise((resolve, reject) => { + logout(state.token).then(() => { + commit('SET_TOKEN', '') + commit('SET_ROLES', []) + commit('SET_PERMISSIONS', []) + removeToken() + resolve() + }).catch(error => { + reject(error) + }) + }) + }, + // 前端 登出 + FedLogOut({ commit }) { + return new Promise(resolve => { + commit('SET_TOKEN', '') + removeToken() + resolve() + }) + }, + // remove token + resetToken({ commit }) { + return new Promise(resolve => { + removeToken() // must remove token first + commit('RESET_STATE') + resolve() + }) + } +} + +export default { + namespaced: true, + state, + mutations, + actions +} diff --git a/sso-auth-center-vue/src/styles/element-ui.scss b/sso-auth-center-vue/src/styles/element-ui.scss new file mode 100755 index 0000000..0062411 --- /dev/null +++ b/sso-auth-center-vue/src/styles/element-ui.scss @@ -0,0 +1,49 @@ +// cover some element-ui styles + +.el-breadcrumb__inner, +.el-breadcrumb__inner a { + font-weight: 400 !important; +} + +.el-upload { + input[type="file"] { + display: none !important; + } +} + +.el-upload__input { + display: none; +} + + +// to fixed https://github.com/ElemeFE/element/issues/2461 +.el-dialog { + transform: none; + left: 0; + position: relative; + margin: 0 auto; +} + +// refine element ui upload +.upload-container { + .el-upload { + width: 100%; + + .el-upload-dragger { + width: 100%; + height: 200px; + } + } +} + +// dropdown +.el-dropdown-menu { + a { + display: block + } +} + +// to fix el-date-picker css style +.el-range-separator { + box-sizing: content-box; +} diff --git a/sso-auth-center-vue/src/styles/index.scss b/sso-auth-center-vue/src/styles/index.scss new file mode 100755 index 0000000..3b4da51 --- /dev/null +++ b/sso-auth-center-vue/src/styles/index.scss @@ -0,0 +1,65 @@ +@import './variables.scss'; +@import './mixin.scss'; +@import './transition.scss'; +@import './element-ui.scss'; +@import './sidebar.scss'; + +body { + height: 100%; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; + font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; +} + +label { + font-weight: 700; +} + +html { + height: 100%; + box-sizing: border-box; +} + +#app { + height: 100%; +} + +*, +*:before, +*:after { + box-sizing: inherit; +} + +a:focus, +a:active { + outline: none; +} + +a, +a:focus, +a:hover { + cursor: pointer; + color: inherit; + text-decoration: none; +} + +div:focus { + outline: none; +} + +.clearfix { + &:after { + visibility: hidden; + display: block; + font-size: 0; + content: " "; + clear: both; + height: 0; + } +} + +// main-container global css +.app-container { + padding: 20px; +} diff --git a/sso-auth-center-vue/src/styles/mixin.scss b/sso-auth-center-vue/src/styles/mixin.scss new file mode 100755 index 0000000..36b74bb --- /dev/null +++ b/sso-auth-center-vue/src/styles/mixin.scss @@ -0,0 +1,28 @@ +@mixin clearfix { + &:after { + content: ""; + display: table; + clear: both; + } +} + +@mixin scrollBar { + &::-webkit-scrollbar-track-piece { + background: #d3dce6; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + border-radius: 20px; + } +} + +@mixin relative { + position: relative; + width: 100%; + height: 100%; +} diff --git a/sso-auth-center-vue/src/styles/sidebar.scss b/sso-auth-center-vue/src/styles/sidebar.scss new file mode 100755 index 0000000..94760cc --- /dev/null +++ b/sso-auth-center-vue/src/styles/sidebar.scss @@ -0,0 +1,226 @@ +#app { + + .main-container { + min-height: 100%; + transition: margin-left .28s; + margin-left: $sideBarWidth; + position: relative; + } + + .sidebar-container { + transition: width 0.28s; + width: $sideBarWidth !important; + background-color: $menuBg; + height: 100%; + position: fixed; + font-size: 0px; + top: 0; + bottom: 0; + left: 0; + z-index: 1001; + overflow: hidden; + + // reset element-ui css + .horizontal-collapse-transition { + transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out; + } + + .scrollbar-wrapper { + overflow-x: hidden !important; + } + + .el-scrollbar__bar.is-vertical { + right: 0px; + } + + .el-scrollbar { + height: 100%; + } + + &.has-logo { + .el-scrollbar { + height: calc(100% - 50px); + } + } + + .is-horizontal { + display: none; + } + + a { + display: inline-block; + width: 100%; + overflow: hidden; + } + + .svg-icon { + margin-right: 16px; + } + + .sub-el-icon { + margin-right: 12px; + margin-left: -2px; + } + + .el-menu { + border: none; + height: 100%; + width: 100% !important; + } + + // menu hover + .submenu-title-noDropdown, + .el-submenu__title { + &:hover { + background-color: $menuHover !important; + } + } + + .is-active>.el-submenu__title { + color: $subMenuActiveText !important; + } + + & .nest-menu .el-submenu>.el-submenu__title, + & .el-submenu .el-menu-item { + min-width: $sideBarWidth !important; + background-color: $subMenuBg !important; + + &:hover { + background-color: $subMenuHover !important; + } + } + } + + .hideSidebar { + .sidebar-container { + width: 54px !important; + } + + .main-container { + margin-left: 54px; + } + + .submenu-title-noDropdown { + padding: 0 !important; + position: relative; + + .el-tooltip { + padding: 0 !important; + + .svg-icon { + margin-left: 20px; + } + + .sub-el-icon { + margin-left: 19px; + } + } + } + + .el-submenu { + overflow: hidden; + + &>.el-submenu__title { + padding: 0 !important; + + .svg-icon { + margin-left: 20px; + } + + .sub-el-icon { + margin-left: 19px; + } + + .el-submenu__icon-arrow { + display: none; + } + } + } + + .el-menu--collapse { + .el-submenu { + &>.el-submenu__title { + &>span { + height: 0; + width: 0; + overflow: hidden; + visibility: hidden; + display: inline-block; + } + } + } + } + } + + .el-menu--collapse .el-menu .el-submenu { + min-width: $sideBarWidth !important; + } + + // mobile responsive + .mobile { + .main-container { + margin-left: 0px; + } + + .sidebar-container { + transition: transform .28s; + width: $sideBarWidth !important; + } + + &.hideSidebar { + .sidebar-container { + pointer-events: none; + transition-duration: 0.3s; + transform: translate3d(-$sideBarWidth, 0, 0); + } + } + } + + .withoutAnimation { + + .main-container, + .sidebar-container { + transition: none; + } + } +} + +// when menu collapsed +.el-menu--vertical { + &>.el-menu { + .svg-icon { + margin-right: 16px; + } + .sub-el-icon { + margin-right: 12px; + margin-left: -2px; + } + } + + .nest-menu .el-submenu>.el-submenu__title, + .el-menu-item { + &:hover { + // you can use $subMenuHover + background-color: $menuHover !important; + } + } + + // the scroll bar appears when the subMenu is too long + >.el-menu--popup { + max-height: 100vh; + overflow-y: auto; + + &::-webkit-scrollbar-track-piece { + background: #d3dce6; + } + + &::-webkit-scrollbar { + width: 6px; + } + + &::-webkit-scrollbar-thumb { + background: #99a9bf; + border-radius: 20px; + } + } +} diff --git a/sso-auth-center-vue/src/styles/transition.scss b/sso-auth-center-vue/src/styles/transition.scss new file mode 100755 index 0000000..4cb27cc --- /dev/null +++ b/sso-auth-center-vue/src/styles/transition.scss @@ -0,0 +1,48 @@ +// global transition css + +/* fade */ +.fade-enter-active, +.fade-leave-active { + transition: opacity 0.28s; +} + +.fade-enter, +.fade-leave-active { + opacity: 0; +} + +/* fade-transform */ +.fade-transform-leave-active, +.fade-transform-enter-active { + transition: all .5s; +} + +.fade-transform-enter { + opacity: 0; + transform: translateX(-30px); +} + +.fade-transform-leave-to { + opacity: 0; + transform: translateX(30px); +} + +/* breadcrumb transition */ +.breadcrumb-enter-active, +.breadcrumb-leave-active { + transition: all .5s; +} + +.breadcrumb-enter, +.breadcrumb-leave-active { + opacity: 0; + transform: translateX(20px); +} + +.breadcrumb-move { + transition: all .5s; +} + +.breadcrumb-leave-active { + position: absolute; +} diff --git a/sso-auth-center-vue/src/styles/variables.scss b/sso-auth-center-vue/src/styles/variables.scss new file mode 100755 index 0000000..286c3d7 --- /dev/null +++ b/sso-auth-center-vue/src/styles/variables.scss @@ -0,0 +1,25 @@ +// sidebar +$menuText:#bfcbd9; +$menuActiveText:#409EFF; +$subMenuActiveText:#f4f4f5; //https://github.com/ElemeFE/element/issues/12951 + +$menuBg:#304156; +$menuHover:#263445; + +$subMenuBg:#1f2d3d; +$subMenuHover:#001528; + +$sideBarWidth: 200px; + +// the :export directive is the magic sauce for webpack +// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass +:export { + menuText: $menuText; + menuActiveText: $menuActiveText; + subMenuActiveText: $subMenuActiveText; + menuBg: $menuBg; + menuHover: $menuHover; + subMenuBg: $subMenuBg; + subMenuHover: $subMenuHover; + sideBarWidth: $sideBarWidth; +} diff --git a/sso-auth-center-vue/src/utils/admin-util.js b/sso-auth-center-vue/src/utils/admin-util.js new file mode 100755 index 0000000..7e8bdae --- /dev/null +++ b/sso-auth-center-vue/src/utils/admin-util.js @@ -0,0 +1,98 @@ +const baseURL = process.env.VUE_APP_BASE_API + +// 日期格式化 +export function parseTime(time, pattern) { + if (arguments.length === 0 || !time) { + return null + } + const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { + time = parseInt(time) + } else if (typeof time === 'string') { + time = time.replace(new RegExp(/-/gm), '/') + } + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => { + let value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { + return ['日', '一', '二', '三', '四', '五', '六'][value] + } + if (result.length > 0 && value < 10) { + value = '0' + value + } + return value || 0 + }) + return time_str +} + +// 表单重置 +export function resetForm(refName) { + if (this.$refs[refName]) { + this.$refs[refName].resetFields() + } +} + +/** + * 构造树型结构数据 + * @param {*} data 数据源 + * @param {*} id id字段 默认 'id' + * @param {*} parentId 父节点字段 默认 'parentId' + * @param {*} children 孩子节点字段 默认 'children' + * @param {*} rootId 根Id 默认 0 + */ +export function handleTree(data, id, parentId, children, rootId) { + id = id || 'id' + parentId = parentId || 'parentId' + children = children || 'children' + rootId = rootId || Math.min.apply(Math, data.map(item => { + return item[parentId] + })) || 0 + //对源数据深度克隆 + const cloneData = JSON.parse(JSON.stringify(data)) + //循环所有项 + const treeData = cloneData.filter(father => { + let branchArr = cloneData.filter(child => { + //返回每一项的子级数组 + return father[id] === child[parentId] + }) + branchArr.length > 0 ? father.children = branchArr : '' + //返回第一层 + return father[parentId] === rootId + }) + return treeData != '' ? treeData : data +} + +import store from '@/store' + +/** + * 是否有权限 + * @returns + */ +export function hasSomePermission(permission) { + const all_permission = '**' + const permissions = store.getters && store.getters.permissions + + if (all_permission === permissions || permissions.includes(all_permission)) { + return true + } + return permissions.includes(permission) +} + diff --git a/sso-auth-center-vue/src/utils/errorCode.js b/sso-auth-center-vue/src/utils/errorCode.js new file mode 100755 index 0000000..d2111ee --- /dev/null +++ b/sso-auth-center-vue/src/utils/errorCode.js @@ -0,0 +1,6 @@ +export default { + '401': '认证失败,无法访问系统资源', + '403': '当前操作没有权限', + '404': '访问资源不存在', + 'default': '系统未知错误,请反馈给管理员' +} diff --git a/sso-auth-center-vue/src/utils/request.js b/sso-auth-center-vue/src/utils/request.js new file mode 100755 index 0000000..bdcda71 --- /dev/null +++ b/sso-auth-center-vue/src/utils/request.js @@ -0,0 +1,84 @@ +import axios from 'axios' +import { Message, MessageBox, Notification } from 'element-ui' +import store from '@/store' +import { getToken } from '@/utils/token' +import errorCode from '@/utils/errorCode' + +axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' + +// 创建axios实例 +const service = axios.create({ + // axios中请求配置有baseURL选项,表示请求URL公共部分 + baseURL: process.env.VUE_APP_BASE_API, + // 请求超时时间 withCredentials: true, + timeout: 10000 +}) + +// 请求统一拦截处理 +service.interceptors.request.use(config => { + // 是否需要设置 token + const isToken = (config.headers || {}).isToken === false + if (getToken() && !isToken) { + config.headers['Authorization'] = 'Bearer ' + getToken() //请求均需携带自定义token + } + return config + }, + error => { + //请求失败 + console.log(error) // for debug + // return Promise.reject(error) + return Promise.reject(error) + } +) + +// 响应拦截器 +service.interceptors.response.use(res => { + // 未设置状态码则默认成功状态 + const code = res.data.code || 200 + // 获取错误信息 + const msg = errorCode[code] || res.data.msg || errorCode['default'] + if (code === 401) { + MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { + confirmButtonText: '重新登录', + cancelButtonText: '取消', + type: 'warning' + } + ).then(() => { + store.dispatch('user/LogOut').then(() => { + location.href = '/' + }) + }) + } else if (code === 500) { + Message({ + message: msg, + type: 'error' + }) + return Promise.reject(new Error(msg)) + } else if (code !== 200) { + Notification.error({ + title: msg + }) + return Promise.reject('error') + } else { + return res.data + } + }, error => { + console.log('err' + error) + let { message } = error + if (message === 'Network Error') { + message = '服务端连接异常' + } else if (message.includes('timeout')) { + message = '系统接口请求超时' + } else if (message.includes('Request failed with status code')) { + message = '系统接口' + message.substr(message.length - 3) + '异常' + } + Message({ + message: message, + type: 'error', + duration: 5 * 1000 + }) + return Promise.reject(error) + } +) + +export default service diff --git a/sso-auth-center-vue/src/utils/rsaencrypt.js b/sso-auth-center-vue/src/utils/rsaencrypt.js new file mode 100755 index 0000000..1504bfc --- /dev/null +++ b/sso-auth-center-vue/src/utils/rsaencrypt.js @@ -0,0 +1,38 @@ +import JSEncrypt from 'jsencrypt/bin/jsencrypt' + +// RSA 密钥对生成 http://web.chacuo.net/netrsakeypair + +const publicKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLX5ZZbSJ2xPozC0HXPYJrovGS\n' + + 'DHzIOHvqfzttK6kLgUHLnguMeHz5NdObvkOBR93p5BawBbgnzhUqDCDh2L3P1HNK\n' + + 'BzAh7gRoncHCyeSk47w2xL1cqeRPymhryMu9O4TVAwPYy0k5JOsoFyMpwnpJxOMf\n' + + 'GGTgNBSxmoPT4pO2+wIDAQAB' + +const privateKey = 'MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAMtfllltInbE+jML\n' + + 'Qdc9gmui8ZIMfMg4e+p/O20rqQuBQcueC4x4fPk105u+Q4FH3enkFrAFuCfOFSoM\n' + + 'IOHYvc/Uc0oHMCHuBGidwcLJ5KTjvDbEvVyp5E/KaGvIy707hNUDA9jLSTkk6ygX\n' + + 'IynCeknE4x8YZOA0FLGag9Pik7b7AgMBAAECgYEApiXIafSb9FYGZc8rkhHBS/hJ\n' + + 'zNyA0P48Vh5tyUmjCDAoNZY/rxn8V4ifARzWf3bcGCnsUw/JHFPjvH8+GeR9ZCkf\n' + + 'yLZXOADW5hu93ybjce42R2DGUu6BorEKdLK/BjiYGIvvfqk0xOre8GANnoXReLgo\n' + + 'KWyNQVy9QcrecjNtm+kCQQDqnfSVjzcoplqGGqFLarFt9OnBZITwQv6TvoPpwyOv\n' + + 'B5LDzAt4rVrmDo9vHSAx4ycCU7F53XUkhm0EmMGHoV8NAkEA3eipMG4TMoC/vxKz\n' + + '8HsVxxb3JNs8tqh/eF0s5PCfDwsd792vOa5z6gMQ7ps7nT3vv8wVAKKJ4ui0iUtU\n' + + 'hUgsJwJBAJVvvIzSZrC2nKwUJC5UK+U8fPNYYjBii6JxU7Y+O+lNKpcZzSi1SlOE\n' + + 'bKm6ZHpCE+OwiTd07hswoBmwbnxENbUCQBNNuvIIkUjyZDu138tKmcFg4QzmuWhW\n' + + 'TghlapNbzypa2DbWfPiykUjJDX8EJ/Jswd9YXHdarE392j6bO/YAKj8CQQCBEZXS\n' + + 'XPC0JP8qe417W4GybWYcWnFqpTLwPEwsV0AfUBqzSbD2LPbaiZdk/+Oa3nYaLdOf\n' + + 'aCspsj2AUl7N8UZO' + +// 加密 +export function encrypt(txt) { + const encryptor = new JSEncrypt() + encryptor.setPublicKey(publicKey) // 设置公钥 + return encryptor.encrypt(txt) // 对数据进行加密 +} + +// 解密 +export function decrypt(txt) { + const encryptor = new JSEncrypt() + encryptor.setPrivateKey(privateKey) // 设置私钥 + return encryptor.decrypt(txt) // 对数据进行解密 +} + diff --git a/sso-auth-center-vue/src/utils/scroll-to.js b/sso-auth-center-vue/src/utils/scroll-to.js new file mode 100755 index 0000000..709fa57 --- /dev/null +++ b/sso-auth-center-vue/src/utils/scroll-to.js @@ -0,0 +1,58 @@ +Math.easeInOutQuad = function(t, b, c, d) { + t /= d / 2 + if (t < 1) { + return c / 2 * t * t + b + } + t-- + return -c / 2 * (t * (t - 2) - 1) + b +} + +// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts +var requestAnimFrame = (function() { + return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) } +})() + +/** + * Because it's so fucking difficult to detect the scrolling element, just move them all + * @param {number} amount + */ +function move(amount) { + document.documentElement.scrollTop = amount + document.body.parentNode.scrollTop = amount + document.body.scrollTop = amount +} + +function position() { + return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop +} + +/** + * @param {number} to + * @param {number} duration + * @param {Function} callback + */ +export function scrollTo(to, duration, callback) { + const start = position() + const change = to - start + const increment = 20 + let currentTime = 0 + duration = (typeof (duration) === 'undefined') ? 500 : duration + var animateScroll = function() { + // increment the time + currentTime += increment + // find the value with the quadratic in-out easing function + var val = Math.easeInOutQuad(currentTime, start, change, duration) + // move the document.body + move(val) + // do the animation unless its over + if (currentTime < duration) { + requestAnimFrame(animateScroll) + } else { + if (callback && typeof (callback) === 'function') { + // the animation is done so lets callback + callback() + } + } + } + animateScroll() +} diff --git a/sso-auth-center-vue/src/utils/token.js b/sso-auth-center-vue/src/utils/token.js new file mode 100755 index 0000000..08a43d6 --- /dev/null +++ b/sso-auth-center-vue/src/utils/token.js @@ -0,0 +1,15 @@ +import Cookies from 'js-cookie' + +const TokenKey = 'Admin-Token' + +export function getToken() { + return Cookies.get(TokenKey) +} + +export function setToken(token) { + return Cookies.set(TokenKey, token) +} + +export function removeToken() { + return Cookies.remove(TokenKey) +} diff --git a/sso-auth-center-vue/src/utils/validate.js b/sso-auth-center-vue/src/utils/validate.js new file mode 100755 index 0000000..8d962ad --- /dev/null +++ b/sso-auth-center-vue/src/utils/validate.js @@ -0,0 +1,20 @@ +/** + * Created by PanJiaChen on 16/11/18. + */ + +/** + * @param {string} path + * @returns {Boolean} + */ +export function isExternal(path) { + return /^(https?:|mailto:|tel:)/.test(path) +} + +/** + * @param {string} str + * @returns {Boolean} + */ +export function validUsername(str) { + const valid_map = ['admin', 'editor'] + return valid_map.indexOf(str.trim()) >= 0 +} diff --git a/sso-auth-center-vue/src/views/404.vue b/sso-auth-center-vue/src/views/404.vue new file mode 100755 index 0000000..85c80f1 --- /dev/null +++ b/sso-auth-center-vue/src/views/404.vue @@ -0,0 +1,225 @@ + + + + + diff --git a/sso-auth-center-vue/src/views/components/icons/element-icons.js b/sso-auth-center-vue/src/views/components/icons/element-icons.js new file mode 100755 index 0000000..ae33ba0 --- /dev/null +++ b/sso-auth-center-vue/src/views/components/icons/element-icons.js @@ -0,0 +1,3 @@ +const elementIcons = ['platform-eleme', 'eleme', 'delete-solid', 'delete', 's-tools', 'setting', 'user-solid', 'user', 'phone', 'phone-outline', 'more', 'more-outline', 'star-on', 'star-off', 's-goods', 'goods', 'warning', 'warning-outline', 'question', 'info', 'remove', 'circle-plus', 'success', 'error', 'zoom-in', 'zoom-out', 'remove-outline', 'circle-plus-outline', 'circle-check', 'circle-close', 's-help', 'help', 'minus', 'plus', 'check', 'close', 'picture', 'picture-outline', 'picture-outline-round', 'upload', 'upload2', 'download', 'camera-solid', 'camera', 'video-camera-solid', 'video-camera', 'message-solid', 'bell', 's-cooperation', 's-order', 's-platform', 's-fold', 's-unfold', 's-operation', 's-promotion', 's-home', 's-release', 's-ticket', 's-management', 's-open', 's-shop', 's-marketing', 's-flag', 's-comment', 's-finance', 's-claim', 's-custom', 's-opportunity', 's-data', 's-check', 's-grid', 'menu', 'share', 'd-caret', 'caret-left', 'caret-right', 'caret-bottom', 'caret-top', 'bottom-left', 'bottom-right', 'back', 'right', 'bottom', 'top', 'top-left', 'top-right', 'arrow-left', 'arrow-right', 'arrow-down', 'arrow-up', 'd-arrow-left', 'd-arrow-right', 'video-pause', 'video-play', 'refresh', 'refresh-right', 'refresh-left', 'finished', 'sort', 'sort-up', 'sort-down', 'rank', 'loading', 'view', 'c-scale-to-original', 'date', 'edit', 'edit-outline', 'folder', 'folder-opened', 'folder-add', 'folder-remove', 'folder-delete', 'folder-checked', 'tickets', 'document-remove', 'document-delete', 'document-copy', 'document-checked', 'document', 'document-add', 'printer', 'paperclip', 'takeaway-box', 'search', 'monitor', 'attract', 'mobile', 'scissors', 'umbrella', 'headset', 'brush', 'mouse', 'coordinate', 'magic-stick', 'reading', 'data-line', 'data-board', 'pie-chart', 'data-analysis', 'collection-tag', 'film', 'suitcase', 'suitcase-1', 'receiving', 'collection', 'files', 'notebook-1', 'notebook-2', 'toilet-paper', 'office-building', 'school', 'table-lamp', 'house', 'no-smoking', 'smoking', 'shopping-cart-full', 'shopping-cart-1', 'shopping-cart-2', 'shopping-bag-1', 'shopping-bag-2', 'sold-out', 'sell', 'present', 'box', 'bank-card', 'money', 'coin', 'wallet', 'discount', 'price-tag', 'news', 'guide', 'male', 'female', 'thumb', 'cpu', 'link', 'connection', 'open', 'turn-off', 'set-up', 'chat-round', 'chat-line-round', 'chat-square', 'chat-dot-round', 'chat-dot-square', 'chat-line-square', 'message', 'postcard', 'position', 'turn-off-microphone', 'microphone', 'close-notification', 'bangzhu', 'time', 'odometer', 'crop', 'aim', 'switch-button', 'full-screen', 'copy-document', 'mic', 'stopwatch', 'medal-1', 'medal', 'trophy', 'trophy-1', 'first-aid-kit', 'discover', 'place', 'location', 'location-outline', 'location-information', 'add-location', 'delete-location', 'map-location', 'alarm-clock', 'timer', 'watch-1', 'watch', 'lock', 'unlock', 'key', 'service', 'mobile-phone', 'bicycle', 'truck', 'ship', 'basketball', 'football', 'soccer', 'baseball', 'wind-power', 'light-rain', 'lightning', 'heavy-rain', 'sunrise', 'sunrise-1', 'sunset', 'sunny', 'cloudy', 'partly-cloudy', 'cloudy-and-sunny', 'moon', 'moon-night', 'dish', 'dish-1', 'food', 'chicken', 'fork-spoon', 'knife-fork', 'burger', 'tableware', 'sugar', 'dessert', 'ice-cream', 'hot-water', 'water-cup', 'coffee-cup', 'cold-drink', 'goblet', 'goblet-full', 'goblet-square', 'goblet-square-full', 'refrigerator', 'grape', 'watermelon', 'cherry', 'apple', 'pear', 'orange', 'coffee', 'ice-tea', 'ice-drink', 'milk-tea', 'potato-strips', 'lollipop', 'ice-cream-square', 'ice-cream-round'] + +export default elementIcons diff --git a/sso-auth-center-vue/src/views/components/icons/index.vue b/sso-auth-center-vue/src/views/components/icons/index.vue new file mode 100755 index 0000000..f422eee --- /dev/null +++ b/sso-auth-center-vue/src/views/components/icons/index.vue @@ -0,0 +1,87 @@ + + + + + diff --git a/sso-auth-center-vue/src/views/components/icons/svg-icons.js b/sso-auth-center-vue/src/views/components/icons/svg-icons.js new file mode 100755 index 0000000..9713fd8 --- /dev/null +++ b/sso-auth-center-vue/src/views/components/icons/svg-icons.js @@ -0,0 +1,10 @@ +const req = require.context('../../../assets/icons/svg', false, /\.svg$/) +const requireAll = requireContext => requireContext.keys() + +const re = /\.\/(.*)\.svg/ + +const svgIcons = requireAll(req).map(i => { + return i.match(re)[1] +}) + +export default svgIcons diff --git a/sso-auth-center-vue/src/views/login/index.vue b/sso-auth-center-vue/src/views/login/index.vue new file mode 100755 index 0000000..2e5bedc --- /dev/null +++ b/sso-auth-center-vue/src/views/login/index.vue @@ -0,0 +1,245 @@ + + + + + diff --git a/sso-auth-center-vue/src/views/sso/dept/index.vue b/sso-auth-center-vue/src/views/sso/dept/index.vue new file mode 100755 index 0000000..b0e5231 --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/dept/index.vue @@ -0,0 +1,339 @@ + + + + diff --git a/sso-auth-center-vue/src/views/sso/log/index.vue b/sso-auth-center-vue/src/views/sso/log/index.vue new file mode 100644 index 0000000..53f9582 --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/log/index.vue @@ -0,0 +1,158 @@ + + + + + + + diff --git a/sso-auth-center-vue/src/views/sso/menu/index.vue b/sso-auth-center-vue/src/views/sso/menu/index.vue new file mode 100755 index 0000000..5aaecea --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/menu/index.vue @@ -0,0 +1,499 @@ + + + + + diff --git a/sso-auth-center-vue/src/views/sso/platform/platformDetail.vue b/sso-auth-center-vue/src/views/sso/platform/platformDetail.vue new file mode 100755 index 0000000..f1fa9ae --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/platform/platformDetail.vue @@ -0,0 +1,467 @@ + + + + + diff --git a/sso-auth-center-vue/src/views/sso/platform/platformMgmt.vue b/sso-auth-center-vue/src/views/sso/platform/platformMgmt.vue new file mode 100755 index 0000000..02a7e03 --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/platform/platformMgmt.vue @@ -0,0 +1,263 @@ + + + + + diff --git a/sso-auth-center-vue/src/views/sso/platform/platformMy.vue b/sso-auth-center-vue/src/views/sso/platform/platformMy.vue new file mode 100755 index 0000000..3e0eb06 --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/platform/platformMy.vue @@ -0,0 +1,128 @@ + + + + + + diff --git a/sso-auth-center-vue/src/views/sso/platform/platformSort.vue b/sso-auth-center-vue/src/views/sso/platform/platformSort.vue new file mode 100755 index 0000000..6e4d3c9 --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/platform/platformSort.vue @@ -0,0 +1,149 @@ + + + + + + diff --git a/sso-auth-center-vue/src/views/sso/platform/sysIcon.vue b/sso-auth-center-vue/src/views/sso/platform/sysIcon.vue new file mode 100755 index 0000000..ecd029f --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/platform/sysIcon.vue @@ -0,0 +1,147 @@ + + + diff --git a/sso-auth-center-vue/src/views/sso/platform/systemMgmtIndex.vue b/sso-auth-center-vue/src/views/sso/platform/systemMgmtIndex.vue new file mode 100755 index 0000000..46d2878 --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/platform/systemMgmtIndex.vue @@ -0,0 +1,368 @@ + + + + + diff --git a/sso-auth-center-vue/src/views/sso/role/index.vue b/sso-auth-center-vue/src/views/sso/role/index.vue new file mode 100755 index 0000000..035fd6b --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/role/index.vue @@ -0,0 +1,448 @@ + + + + + diff --git a/sso-auth-center-vue/src/views/sso/role/userRoleIndex.vue b/sso-auth-center-vue/src/views/sso/role/userRoleIndex.vue new file mode 100755 index 0000000..d32389c --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/role/userRoleIndex.vue @@ -0,0 +1,243 @@ + + + + + diff --git a/sso-auth-center-vue/src/views/sso/user/index.vue b/sso-auth-center-vue/src/views/sso/user/index.vue new file mode 100755 index 0000000..a386064 --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/user/index.vue @@ -0,0 +1,719 @@ + + + diff --git a/sso-auth-center-vue/src/views/sso/user/online/index.vue b/sso-auth-center-vue/src/views/sso/user/online/index.vue new file mode 100644 index 0000000..9943e10 --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/user/online/index.vue @@ -0,0 +1,189 @@ + + + + + + + diff --git a/sso-auth-center-vue/src/views/sso/user/profile/index.vue b/sso-auth-center-vue/src/views/sso/user/profile/index.vue new file mode 100755 index 0000000..706cac7 --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/user/profile/index.vue @@ -0,0 +1,124 @@ + + + + + diff --git a/sso-auth-center-vue/src/views/sso/user/profile/resetPwd.vue b/sso-auth-center-vue/src/views/sso/user/profile/resetPwd.vue new file mode 100755 index 0000000..446ff0a --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/user/profile/resetPwd.vue @@ -0,0 +1,82 @@ + + + diff --git a/sso-auth-center-vue/src/views/sso/user/profile/userAvatar.vue b/sso-auth-center-vue/src/views/sso/user/profile/userAvatar.vue new file mode 100755 index 0000000..eb224a7 --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/user/profile/userAvatar.vue @@ -0,0 +1,144 @@ + + + diff --git a/sso-auth-center-vue/src/views/sso/user/profile/userInfo.vue b/sso-auth-center-vue/src/views/sso/user/profile/userInfo.vue new file mode 100755 index 0000000..c880935 --- /dev/null +++ b/sso-auth-center-vue/src/views/sso/user/profile/userInfo.vue @@ -0,0 +1,86 @@ + + + diff --git a/sso-auth-center-vue/vue.config.js b/sso-auth-center-vue/vue.config.js new file mode 100755 index 0000000..01f90bf --- /dev/null +++ b/sso-auth-center-vue/vue.config.js @@ -0,0 +1,129 @@ +'use strict' +const path = require('path') +const defaultSettings = require('./src/settings.js') + +function resolve(dir) { + return path.join(__dirname, dir) +} + +const name = defaultSettings.title || '小强认证中心' // page title + +// If your port is set to 80, +// use administrator privileges to execute the command line. +// For example, Mac: sudo npm run +// You can change the port by the following methods: +// port = 9528 npm run dev OR npm run dev --port = 9528 +const port = process.env.port || process.env.npm_config_port || 9528 // dev port + +// All configuration item explanations can be find in https://cli.vuejs.org/config/ +module.exports = { + /** + * You will need to set publicPath if you plan to deploy your site under a sub path, + * for example GitHub Pages. If you plan to deploy your site to https://foo.github.io/bar/, + * then publicPath should be set to "/bar/". + * In most cases please use '/' !!! + * Detail: https://cli.vuejs.org/config/#publicpath + */ + publicPath: '/', + outputDir: 'dist', + assetsDir: 'static', + lintOnSave: process.env.NODE_ENV === 'development', + productionSourceMap: false, + devServer: { + port: port, + open: true, + disableHostCheck: true, + overlay: { + warnings: false, + errors: true + }, + // before: require('./mock/mock-server.js') + }, + configureWebpack: { + // provide the app's title in webpack's name field, so that + // it can be accessed in index.html to inject the correct title. + name: name, + resolve: { + alias: { + '@': resolve('src') + } + } + }, + chainWebpack(config) { + // it can improve the speed of the first screen, it is recommended to turn on preload + config.plugin('preload').tap(() => [ + { + rel: 'preload', + // to ignore runtime.js + // https://github.com/vuejs/vue-cli/blob/dev/packages/@vue/cli-service/lib/config/app.js#L171 + fileBlacklist: [/\.map$/, /hot-update\.js$/, /runtime\..*\.js$/], + include: 'initial' + } + ]) + + // when there are many pages, it will cause too many meaningless requests + config.plugins.delete('prefetch') + + // set svg-sprite-loader + config.module + .rule('svg') + .exclude.add(resolve('src/assets/icons')) + .end() + config.module + .rule('icons') + .test(/\.svg$/) + .include.add(resolve('src/assets/icons')) + .end() + .use('svg-sprite-loader') + .loader('svg-sprite-loader') + .options({ + symbolId: 'icon-[name]' + }) + .end() + + config + .when(process.env.NODE_ENV !== 'development', + config => { + config + .plugin('ScriptExtHtmlWebpackPlugin') + .after('html') + .use('script-ext-html-webpack-plugin', [{ + // `runtime` must same as runtimeChunk name. default is `runtime` + inline: /runtime\..*\.js$/ + }]) + .end() + config + .optimization.splitChunks({ + chunks: 'all', + cacheGroups: { + libs: { + name: 'chunk-libs', + test: /[\\/]node_modules[\\/]/, + priority: 10, + chunks: 'initial' // only package third parties that are initially dependent + }, + elementUI: { + name: 'chunk-elementUI', // split elementUI into a single package + priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app + test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm + }, + commons: { + name: 'chunk-commons', + test: resolve('src/components'), // can customize your rules + minChunks: 3, // minimum common number + priority: 5, + reuseExistingChunk: true + } + } + }) + // https:// webpack.js.org/configuration/optimization/#optimizationruntimechunk + config.optimization.runtimeChunk('single'), + { + //防爬虫文件 + from: path.resolve(__dirname, './public/robots.txt'), + to: './',//到根目录下 + } + } + ) + } +}