Skip to content

Commit 7233bcc

Browse files
committed
feat: 分配角色
1 parent 7793bb8 commit 7233bcc

File tree

9 files changed

+1013
-900
lines changed

9 files changed

+1013
-900
lines changed

mock/system.ts

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { MockMethod } from "vite-plugin-mock";
22

33
export default [
4-
// 用户
4+
// 用户管理
55
{
66
url: "/user",
77
method: "post",
@@ -57,7 +57,46 @@ export default [
5757
};
5858
}
5959
},
60-
// 角色
60+
// 用户管理-获取所有角色列表
61+
{
62+
url: "/list-all-role",
63+
method: "get",
64+
response: () => {
65+
return {
66+
success: true,
67+
data: [
68+
{ id: 1, name: "超级管理员" },
69+
{ id: 2, name: "普通角色" }
70+
]
71+
};
72+
}
73+
},
74+
// 用户管理-根据userId,获取对应角色id列表(userId:用户id)
75+
{
76+
url: "/list-role-ids",
77+
method: "post",
78+
response: ({ body }) => {
79+
if (body.userId) {
80+
if (body.userId == 1) {
81+
return {
82+
success: true,
83+
data: [1]
84+
};
85+
} else if (body.userId == 2) {
86+
return {
87+
success: true,
88+
data: [2]
89+
};
90+
}
91+
} else {
92+
return {
93+
success: false,
94+
data: []
95+
};
96+
}
97+
}
98+
},
99+
// 角色管理
61100
{
62101
url: "/role",
63102
method: "post",
@@ -66,7 +105,6 @@ export default [
66105
{
67106
createTime: 1605456000000, // 时间戳(毫秒ms)
68107
updateTime: 1684512000000,
69-
creator: "admin",
70108
id: 1,
71109
name: "超级管理员",
72110
code: "admin",
@@ -76,7 +114,6 @@ export default [
76114
{
77115
createTime: 1605456000000,
78116
updateTime: 1684512000000,
79-
creator: "admin",
80117
id: 2,
81118
name: "普通角色",
82119
code: "common",
@@ -100,7 +137,7 @@ export default [
100137
};
101138
}
102139
},
103-
// 部门
140+
// 部门管理
104141
{
105142
url: "/dept",
106143
method: "post",

package.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,25 @@
3131
"dependencies": {
3232
"@amap/amap-jsapi-loader": "^1.0.1",
3333
"@howdyjs/mouse-menu": "^2.0.9",
34-
"@logicflow/core": "^1.2.10",
35-
"@logicflow/extension": "^1.2.10",
34+
"@logicflow/core": "^1.2.12",
35+
"@logicflow/extension": "^1.2.13",
3636
"@pureadmin/descriptions": "^1.1.1",
3737
"@pureadmin/table": "^2.3.3",
3838
"@pureadmin/utils": "^1.9.7",
39-
"@vueuse/core": "^10.3.0",
39+
"@vueuse/core": "^10.4.0",
4040
"@vueuse/motion": "^2.0.0",
4141
"@wangeditor/editor": "^5.1.23",
4242
"@wangeditor/editor-for-vue": "^5.1.12",
4343
"@zxcvbn-ts/core": "^3.0.3",
4444
"animate.css": "^4.1.1",
45-
"axios": "^1.4.0",
45+
"axios": "^1.5.0",
4646
"china-area-data": "^5.0.1",
47-
"cropperjs": "^1.5.13",
47+
"cropperjs": "^1.6.0",
4848
"dayjs": "^1.11.9",
4949
"echarts": "^5.4.3",
5050
"el-table-infinite-scroll": "^3.0.1",
51-
"element-plus": "^2.3.9",
52-
"intro.js": "^7.0.1",
51+
"element-plus": "^2.3.12",
52+
"intro.js": "^7.2.0",
5353
"js-cookie": "^3.0.5",
5454
"jsbarcode": "^3.11.5",
5555
"md-editor-v3": "2.7.2",
@@ -59,12 +59,12 @@
5959
"nprogress": "^0.2.0",
6060
"path": "^0.12.7",
6161
"pinia": "^2.1.6",
62-
"pinyin-pro": "^3.16.2",
62+
"pinyin-pro": "^3.16.3",
6363
"qrcode": "^1.5.3",
6464
"qs": "^6.11.2",
6565
"responsive-storage": "^2.2.0",
6666
"sortablejs": "^1.15.0",
67-
"swiper": "^10.1.0",
67+
"swiper": "^10.2.0",
6868
"typeit": "^8.7.1",
6969
"v-contextmenu": "3.0.0",
7070
"v3-infinite-loading": "^1.3.1",
@@ -77,16 +77,16 @@
7777
"vue-tippy": "^6.3.1",
7878
"vue-types": "^5.1.1",
7979
"vue-virtual-scroller": "2.0.0-beta.7",
80-
"vue-waterfall-plugin-next": "^2.2.2",
80+
"vue-waterfall-plugin-next": "^2.2.3",
8181
"vue3-danmaku": "^1.5.1",
8282
"vuedraggable": "^4.1.0",
83-
"wavesurfer.js": "^7.1.2",
84-
"xgplayer": "^3.0.7",
83+
"wavesurfer.js": "^7.1.5",
84+
"xgplayer": "^3.0.8",
8585
"xlsx": "^0.18.5"
8686
},
8787
"devDependencies": {
88-
"@commitlint/cli": "^17.6.6",
89-
"@commitlint/config-conventional": "^17.6.6",
88+
"@commitlint/cli": "^17.7.1",
89+
"@commitlint/config-conventional": "^17.7.0",
9090
"@iconify-icons/ep": "^1.2.12",
9191
"@iconify-icons/ri": "^1.2.10",
9292
"@iconify/vue": "^4.1.1",
@@ -95,47 +95,47 @@
9595
"@types/intro.js": "^5.1.1",
9696
"@types/js-cookie": "^3.0.3",
9797
"@types/mockjs": "^1.0.7",
98-
"@types/node": "^18.17.4",
98+
"@types/node": "^18.17.12",
9999
"@types/nprogress": "0.2.0",
100100
"@types/qrcode": "^1.5.1",
101101
"@types/qs": "^6.9.7",
102102
"@types/sortablejs": "^1.15.1",
103-
"@typescript-eslint/eslint-plugin": "^5.60.0",
104-
"@typescript-eslint/parser": "^5.60.0",
105-
"@vitejs/plugin-vue": "^4.2.3",
106-
"@vitejs/plugin-vue-jsx": "^3.0.1",
103+
"@typescript-eslint/eslint-plugin": "^5.62.0",
104+
"@typescript-eslint/parser": "^5.62.0",
105+
"@vitejs/plugin-vue": "^4.3.3",
106+
"@vitejs/plugin-vue-jsx": "^3.0.2",
107107
"@vue/eslint-config-prettier": "^7.1.0",
108108
"@vue/eslint-config-typescript": "^11.0.3",
109-
"autoprefixer": "^10.4.14",
109+
"autoprefixer": "^10.4.15",
110110
"cloc": "^2.11.0",
111111
"cssnano": "^6.0.1",
112-
"eslint": "^8.43.0",
112+
"eslint": "^8.48.0",
113113
"eslint-plugin-prettier": "^4.2.1",
114-
"eslint-plugin-vue": "^9.15.1",
114+
"eslint-plugin-vue": "^9.17.0",
115115
"husky": "^8.0.3",
116-
"lint-staged": "^13.2.2",
116+
"lint-staged": "^13.3.0",
117117
"picocolors": "^1.0.0",
118-
"postcss": "^8.4.27",
118+
"postcss": "^8.4.28",
119119
"postcss-html": "^1.5.0",
120120
"postcss-import": "^15.1.0",
121-
"postcss-scss": "^4.0.6",
121+
"postcss-scss": "^4.0.7",
122122
"prettier": "^2.8.8",
123123
"pretty-quick": "^3.1.3",
124124
"rimraf": "^5.0.1",
125125
"rollup-plugin-visualizer": "^5.9.2",
126-
"sass": "^1.65.1",
126+
"sass": "^1.66.1",
127127
"sass-loader": "^13.3.2",
128-
"stylelint": "^15.9.0",
128+
"stylelint": "^15.10.3",
129129
"stylelint-config-html": "^1.1.0",
130-
"stylelint-config-recess-order": "^4.2.0",
130+
"stylelint-config-recess-order": "^4.3.0",
131131
"stylelint-config-recommended": "^12.0.0",
132132
"stylelint-config-recommended-scss": "^12.0.0",
133-
"stylelint-config-recommended-vue": "^1.4.0",
133+
"stylelint-config-recommended-vue": "^1.5.0",
134134
"stylelint-config-standard": "^33.0.0",
135135
"stylelint-config-standard-scss": "^9.0.0",
136136
"stylelint-order": "^6.0.3",
137137
"stylelint-prettier": "^3.0.0",
138-
"stylelint-scss": "^5.0.1",
138+
"stylelint-scss": "^5.1.0",
139139
"svgo": "^3.0.2",
140140
"tailwindcss": "^3.3.3",
141141
"terser": "^5.19.2",

0 commit comments

Comments
 (0)