Skip to content

Commit

Permalink
feat: 分配角色
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxian521 committed Aug 28, 2023
1 parent 7793bb8 commit 7233bcc
Show file tree
Hide file tree
Showing 9 changed files with 1,013 additions and 900 deletions.
47 changes: 42 additions & 5 deletions mock/system.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { MockMethod } from "vite-plugin-mock";

export default [
// 用户
// 用户管理
{
url: "/user",
method: "post",
Expand Down Expand Up @@ -57,7 +57,46 @@ export default [
};
}
},
// 角色
// 用户管理-获取所有角色列表
{
url: "/list-all-role",
method: "get",
response: () => {
return {
success: true,
data: [
{ id: 1, name: "超级管理员" },
{ id: 2, name: "普通角色" }
]
};
}
},
// 用户管理-根据userId,获取对应角色id列表(userId:用户id)
{
url: "/list-role-ids",
method: "post",
response: ({ body }) => {
if (body.userId) {
if (body.userId == 1) {
return {
success: true,
data: [1]
};
} else if (body.userId == 2) {
return {
success: true,
data: [2]
};
}
} else {
return {
success: false,
data: []
};
}
}
},
// 角色管理
{
url: "/role",
method: "post",
Expand All @@ -66,7 +105,6 @@ export default [
{
createTime: 1605456000000, // 时间戳(毫秒ms)
updateTime: 1684512000000,
creator: "admin",
id: 1,
name: "超级管理员",
code: "admin",
Expand All @@ -76,7 +114,6 @@ export default [
{
createTime: 1605456000000,
updateTime: 1684512000000,
creator: "admin",
id: 2,
name: "普通角色",
code: "common",
Expand All @@ -100,7 +137,7 @@ export default [
};
}
},
// 部门
// 部门管理
{
url: "/dept",
method: "post",
Expand Down
60 changes: 30 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"@howdyjs/mouse-menu": "^2.0.9",
"@logicflow/core": "^1.2.10",
"@logicflow/extension": "^1.2.10",
"@logicflow/core": "^1.2.12",
"@logicflow/extension": "^1.2.13",
"@pureadmin/descriptions": "^1.1.1",
"@pureadmin/table": "^2.3.3",
"@pureadmin/utils": "^1.9.7",
"@vueuse/core": "^10.3.0",
"@vueuse/core": "^10.4.0",
"@vueuse/motion": "^2.0.0",
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "^5.1.12",
"@zxcvbn-ts/core": "^3.0.3",
"animate.css": "^4.1.1",
"axios": "^1.4.0",
"axios": "^1.5.0",
"china-area-data": "^5.0.1",
"cropperjs": "^1.5.13",
"cropperjs": "^1.6.0",
"dayjs": "^1.11.9",
"echarts": "^5.4.3",
"el-table-infinite-scroll": "^3.0.1",
"element-plus": "^2.3.9",
"intro.js": "^7.0.1",
"element-plus": "^2.3.12",
"intro.js": "^7.2.0",
"js-cookie": "^3.0.5",
"jsbarcode": "^3.11.5",
"md-editor-v3": "2.7.2",
Expand All @@ -59,12 +59,12 @@
"nprogress": "^0.2.0",
"path": "^0.12.7",
"pinia": "^2.1.6",
"pinyin-pro": "^3.16.2",
"pinyin-pro": "^3.16.3",
"qrcode": "^1.5.3",
"qs": "^6.11.2",
"responsive-storage": "^2.2.0",
"sortablejs": "^1.15.0",
"swiper": "^10.1.0",
"swiper": "^10.2.0",
"typeit": "^8.7.1",
"v-contextmenu": "3.0.0",
"v3-infinite-loading": "^1.3.1",
Expand All @@ -77,16 +77,16 @@
"vue-tippy": "^6.3.1",
"vue-types": "^5.1.1",
"vue-virtual-scroller": "2.0.0-beta.7",
"vue-waterfall-plugin-next": "^2.2.2",
"vue-waterfall-plugin-next": "^2.2.3",
"vue3-danmaku": "^1.5.1",
"vuedraggable": "^4.1.0",
"wavesurfer.js": "^7.1.2",
"xgplayer": "^3.0.7",
"wavesurfer.js": "^7.1.5",
"xgplayer": "^3.0.8",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@commitlint/cli": "^17.6.6",
"@commitlint/config-conventional": "^17.6.6",
"@commitlint/cli": "^17.7.1",
"@commitlint/config-conventional": "^17.7.0",
"@iconify-icons/ep": "^1.2.12",
"@iconify-icons/ri": "^1.2.10",
"@iconify/vue": "^4.1.1",
Expand All @@ -95,47 +95,47 @@
"@types/intro.js": "^5.1.1",
"@types/js-cookie": "^3.0.3",
"@types/mockjs": "^1.0.7",
"@types/node": "^18.17.4",
"@types/node": "^18.17.12",
"@types/nprogress": "0.2.0",
"@types/qrcode": "^1.5.1",
"@types/qs": "^6.9.7",
"@types/sortablejs": "^1.15.1",
"@typescript-eslint/eslint-plugin": "^5.60.0",
"@typescript-eslint/parser": "^5.60.0",
"@vitejs/plugin-vue": "^4.2.3",
"@vitejs/plugin-vue-jsx": "^3.0.1",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@vitejs/plugin-vue": "^4.3.3",
"@vitejs/plugin-vue-jsx": "^3.0.2",
"@vue/eslint-config-prettier": "^7.1.0",
"@vue/eslint-config-typescript": "^11.0.3",
"autoprefixer": "^10.4.14",
"autoprefixer": "^10.4.15",
"cloc": "^2.11.0",
"cssnano": "^6.0.1",
"eslint": "^8.43.0",
"eslint": "^8.48.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.15.1",
"eslint-plugin-vue": "^9.17.0",
"husky": "^8.0.3",
"lint-staged": "^13.2.2",
"lint-staged": "^13.3.0",
"picocolors": "^1.0.0",
"postcss": "^8.4.27",
"postcss": "^8.4.28",
"postcss-html": "^1.5.0",
"postcss-import": "^15.1.0",
"postcss-scss": "^4.0.6",
"postcss-scss": "^4.0.7",
"prettier": "^2.8.8",
"pretty-quick": "^3.1.3",
"rimraf": "^5.0.1",
"rollup-plugin-visualizer": "^5.9.2",
"sass": "^1.65.1",
"sass": "^1.66.1",
"sass-loader": "^13.3.2",
"stylelint": "^15.9.0",
"stylelint": "^15.10.3",
"stylelint-config-html": "^1.1.0",
"stylelint-config-recess-order": "^4.2.0",
"stylelint-config-recess-order": "^4.3.0",
"stylelint-config-recommended": "^12.0.0",
"stylelint-config-recommended-scss": "^12.0.0",
"stylelint-config-recommended-vue": "^1.4.0",
"stylelint-config-recommended-vue": "^1.5.0",
"stylelint-config-standard": "^33.0.0",
"stylelint-config-standard-scss": "^9.0.0",
"stylelint-order": "^6.0.3",
"stylelint-prettier": "^3.0.0",
"stylelint-scss": "^5.0.1",
"stylelint-scss": "^5.1.0",
"svgo": "^3.0.2",
"tailwindcss": "^3.3.3",
"terser": "^5.19.2",
Expand Down
Loading

0 comments on commit 7233bcc

Please sign in to comment.