Compare commits
915 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
78e61d89ba | |
|
|
4908b6230b | |
|
|
f6d4f5c6e3 | |
|
|
1580c1e672 | |
|
|
6ff45b2644 | |
|
|
ae77c82304 | |
|
|
41c2d6fc2a | |
|
|
d0e9e07e9c | |
|
|
210626b21f | |
|
|
85ab6236e7 | |
|
|
0037e65ca0 | |
|
|
adec3f0608 | |
|
|
e7adf59b88 | |
|
|
21a17945fa | |
|
|
b7abcd8374 | |
|
|
2eeb642f07 | |
|
|
4512af436d | |
|
|
6a8964f086 | |
|
|
75b2eb067d | |
|
|
2eaabefeac | |
|
|
c3ab80967c | |
|
|
892e3ac822 | |
|
|
e2b4bb0420 | |
|
|
d6b4806e43 | |
|
|
7df1b02476 | |
|
|
6d9cbe218c | |
|
|
302299bbb0 | |
|
|
437301d5d9 | |
|
|
dc121ff4aa | |
|
|
c4cda3f4ad | |
|
|
e067c04464 | |
|
|
af03fefc83 | |
|
|
2d49f2a56e | |
|
|
2af351f898 | |
|
|
a709c8f06e | |
|
|
b00775f988 | |
|
|
48711178ec | |
|
|
07bb636109 | |
|
|
24e0fa863e | |
|
|
fb6d93fbab | |
|
|
db18477786 | |
|
|
91575613a8 | |
|
|
a5354083b9 | |
|
|
1665fa2793 | |
|
|
df8d6bcd33 | |
|
|
2fecc6273b | |
|
|
8b252709a4 | |
|
|
b2cb085f21 | |
|
|
1b1bc96bd5 | |
|
|
a416d55780 | |
|
|
1994aff544 | |
|
|
b18eced03d | |
|
|
ee2fef02f8 | |
|
|
ad954dacb7 | |
|
|
10de4eb96d | |
|
|
a5b612c8e4 | |
|
|
ebc848b5b5 | |
|
|
f31c207551 | |
|
|
dd338b56da | |
|
|
7c3d7b384c | |
|
|
0647ca8b66 | |
|
|
f3477f75e6 | |
|
|
22fa7ac6f6 | |
|
|
924aafae86 | |
|
|
5280fb5a0d | |
|
|
d3c6ba2598 | |
|
|
08308d61c7 | |
|
|
356b451b2a | |
|
|
a606973cbe | |
|
|
19fb27502b | |
|
|
d7b309afd9 | |
|
|
d9bfc3e322 | |
|
|
74045776d6 | |
|
|
5fcec99e6c | |
|
|
102a5ac575 | |
|
|
3786f3671d | |
|
|
49e6fbf2ff | |
|
|
81a8192de7 | |
|
|
a366d09659 | |
|
|
2fe7341fa7 | |
|
|
a3615e5c6c | |
|
|
68eac98acf | |
|
|
d4bae9745c | |
|
|
23ae0eb43b | |
|
|
308d497d74 | |
|
|
7af254ee51 | |
|
|
2ad13c9f72 | |
|
|
56d50d10e9 | |
|
|
0b21d15f26 | |
|
|
7421d7ccce | |
|
|
84ba2dbd93 | |
|
|
55447c72e9 | |
|
|
26c63520f2 | |
|
|
8b52b90670 | |
|
|
05ca78e82f | |
|
|
b155059d66 | |
|
|
f8ad7ea3ce | |
|
|
feff419641 | |
|
|
33a0806cbe | |
|
|
230e2bb3f4 | |
|
|
24d9ccba40 | |
|
|
dc24ed81b8 | |
|
|
504a4e8e66 | |
|
|
775234dabe | |
|
|
7fdd20c054 | |
|
|
1eeed86b65 | |
|
|
7c9903e057 | |
|
|
20dd6d37ea | |
|
|
89a04423cd | |
|
|
c42b4cad02 | |
|
|
4b21a3bc48 | |
|
|
1ef82d75b1 | |
|
|
c10a3b6dbb | |
|
|
b93c9bfc5d | |
|
|
cd5556d188 | |
|
|
1126e2234f | |
|
|
dce91a03ef | |
|
|
8dff14a6cc | |
|
|
3462c58ce4 | |
|
|
6c3e88ee6d | |
|
|
da2e5a2d93 | |
|
|
12c51fc8e3 | |
|
|
736b6348bc | |
|
|
6317e902e3 | |
|
|
94590a008d | |
|
|
8b5acaf341 | |
|
|
8eb22e86e0 | |
|
|
853040cd42 | |
|
|
17364e2699 | |
|
|
9f48ff40d2 | |
|
|
f93fc98b4f | |
|
|
c03a671de8 | |
|
|
6d6d5140fe | |
|
|
f016006224 | |
|
|
abcc045cad | |
|
|
d76fab1d0c | |
|
|
a0d2b383ef | |
|
|
af33456ca8 | |
|
|
3d2f9aa9c6 | |
|
|
a8be0ccb35 | |
|
|
f646bfc0f5 | |
|
|
6efd427f79 | |
|
|
04a042c585 | |
|
|
ee3f03f1f1 | |
|
|
b1a67a113e | |
|
|
bc1c1dbfa7 | |
|
|
7a112c7317 | |
|
|
d2bd73b4dc | |
|
|
a211d93092 | |
|
|
a9938302f0 | |
|
|
6e5d7a6dab | |
|
|
7a3892a77a | |
|
|
e0a5e704b0 | |
|
|
d936ce76b1 | |
|
|
f2320d356d | |
|
|
b50e79bbde | |
|
|
295b5d5cfd | |
|
|
8f4ac612c8 | |
|
|
b3f9e1f2de | |
|
|
bcbc9d7adc | |
|
|
6421f68964 | |
|
|
652f4372c0 | |
|
|
cff5fe93a5 | |
|
|
c759728269 | |
|
|
58e07ba142 | |
|
|
43b336d26b | |
|
|
8eeb73eabb | |
|
|
98c3e4b48a | |
|
|
839366f2b0 | |
|
|
65cf05fddb | |
|
|
a9a8f94ae2 | |
|
|
1617c74d4d | |
|
|
01c1505340 | |
|
|
c2708f2ba4 | |
|
|
48a0d5bc9d | |
|
|
a057b7a4b9 | |
|
|
0e4a1c872c | |
|
|
5faa1af464 | |
|
|
0dfbb5fbf3 | |
|
|
3b4f1d7937 | |
|
|
07c2e08e4a | |
|
|
e03cebac57 | |
|
|
0c36921587 | |
|
|
53b84261f8 | |
|
|
11de8aa17b | |
|
|
f250c6ee93 | |
|
|
fd89356ed7 | |
|
|
ad54d36385 | |
|
|
3cf088a0d8 | |
|
|
22fac34b82 | |
|
|
7f0f842651 | |
|
|
1124c27f06 | |
|
|
adbba02cb8 | |
|
|
5b6dc85b62 | |
|
|
62eec4df51 | |
|
|
11d8274462 | |
|
|
732071ef58 | |
|
|
afa23c2111 | |
|
|
4bf9f3cff5 | |
|
|
8c7986acdb | |
|
|
52d50e4e47 | |
|
|
f0bfff1ff3 | |
|
|
a37315d513 | |
|
|
479755650c | |
|
|
73256dfeaf | |
|
|
767f7c8621 | |
|
|
12d335b9ac | |
|
|
bc7a743998 | |
|
|
ca36f9fc6e | |
|
|
8345eed709 | |
|
|
2af8e817bd | |
|
|
fcb58876e7 | |
|
|
d4c61daf9b | |
|
|
31523867e7 | |
|
|
a8daa1f044 | |
|
|
858f576fa3 | |
|
|
c960108b12 | |
|
|
59b867dcca | |
|
|
b9fdc4de87 | |
|
|
d504a7df2f | |
|
|
2a675aa304 | |
|
|
d6df1fe7b3 | |
|
|
428255ddcf | |
|
|
a92ca233aa | |
|
|
537105b2a9 | |
|
|
d56ef651e3 | |
|
|
9d21b1627b | |
|
|
467557fef3 | |
|
|
c8a108b93a | |
|
|
5408af9d1f | |
|
|
e7b9e12d15 | |
|
|
a4b714b95a | |
|
|
4ae26c2f86 | |
|
|
b51c127eb7 | |
|
|
c5eb7458c8 | |
|
|
347a717d5c | |
|
|
0484c63d9b | |
|
|
4d21c11acd | |
|
|
8fdb3c4d14 | |
|
|
0ef63207f4 | |
|
|
1295177393 | |
|
|
67a6841043 | |
|
|
d4930f6a88 | |
|
|
c98f452431 | |
|
|
fb35360f81 | |
|
|
5e20f99a99 | |
|
|
9f90b4eba7 | |
|
|
ce82095f04 | |
|
|
9ebd484f46 | |
|
|
cc0e184314 | |
|
|
87009e72bf | |
|
|
d6a2028ec3 | |
|
|
ef28473992 | |
|
|
1543fb801b | |
|
|
e753cea03e | |
|
|
78332c2786 | |
|
|
4b1351ef21 | |
|
|
f12baad00c | |
|
|
81d3c90bbc | |
|
|
0d58ecb09c | |
|
|
1e16852a3c | |
|
|
57e63a184d | |
|
|
20476e9dd1 | |
|
|
95aa343805 | |
|
|
a573c4b10d | |
|
|
5964dc81ab | |
|
|
721701274b | |
|
|
78c356a9f3 | |
|
|
b622675522 | |
|
|
912f607062 | |
|
|
1297d094cb | |
|
|
ccfc4f7ad7 | |
|
|
8ee702e4a2 | |
|
|
5945537ade | |
|
|
2051819d2d | |
|
|
570d468814 | |
|
|
5fd16ff806 | |
|
|
17246d8a27 | |
|
|
6d404a1f3b | |
|
|
7417c1d473 | |
|
|
9b35679ba6 | |
|
|
7af84cb923 | |
|
|
8242cec9ac | |
|
|
5b8cf9701f | |
|
|
a52d455032 | |
|
|
d28f81dc68 | |
|
|
7475cff47d | |
|
|
d6e6b99316 | |
|
|
5a48c5dba7 | |
|
|
ad7133f39d | |
|
|
fca189fa73 | |
|
|
6cda8cb28f | |
|
|
9c29907d57 | |
|
|
b3d462e873 | |
|
|
cdcc466300 | |
|
|
12ca164c44 | |
|
|
1d1b9501b7 | |
|
|
24376681b8 | |
|
|
386f3eb016 | |
|
|
2a6a74ead5 | |
|
|
01e4e619e6 | |
|
|
f6f07f255a | |
|
|
2eaa52c7aa | |
|
|
86b9e675b5 | |
|
|
b76cd4d0e2 | |
|
|
a4ad2b8b3c | |
|
|
103bf66f77 | |
|
|
5dbed46552 | |
|
|
97500fbccb | |
|
|
70f306418f | |
|
|
6bc77169fe | |
|
|
742f3106a2 | |
|
|
9ec4d19384 | |
|
|
68040827e2 | |
|
|
75d91c7d1d | |
|
|
95c1286f06 | |
|
|
f63a76f661 | |
|
|
6644d3077d | |
|
|
54d1c58338 | |
|
|
9da3b34b9c | |
|
|
1ec806ae80 | |
|
|
4df2b72b30 | |
|
|
a0ce434163 | |
|
|
5053510236 | |
|
|
d14f27e5eb | |
|
|
72cf2edf03 | |
|
|
8c6035c8f9 | |
|
|
f7b761275c | |
|
|
6f7b02372e | |
|
|
0b6166663c | |
|
|
723583a3b8 | |
|
|
6a017dddd1 | |
|
|
6f5c149ba0 | |
|
|
5d44d2b5a6 | |
|
|
7c3425ee9b | |
|
|
6133563bf3 | |
|
|
2d67d7c8e2 | |
|
|
55a7a90bab | |
|
|
a70d5ee2ab | |
|
|
e5c938c64a | |
|
|
ccf84377f8 | |
|
|
dc8938ab2f | |
|
|
bc05b453df | |
|
|
368a9044be | |
|
|
242101ae6e | |
|
|
0b08933a8c | |
|
|
99932d91c0 | |
|
|
59387216b4 | |
|
|
66f5f11069 | |
|
|
33694c860f | |
|
|
4c5c1d1f78 | |
|
|
14cd3e2c6a | |
|
|
34487865f3 | |
|
|
2444fcc646 | |
|
|
8b3d75a6a0 | |
|
|
4feb0adb6e | |
|
|
82535c82d3 | |
|
|
7a09412ecb | |
|
|
a30622b460 | |
|
|
df0813089e | |
|
|
e059ed9c7f | |
|
|
105c9d99c8 | |
|
|
a65eaf880d | |
|
|
04706403d3 | |
|
|
c43565ef43 | |
|
|
089ebaf9c5 | |
|
|
6f3c3f1b7e | |
|
|
2dc5e7319a | |
|
|
b5d2628b71 | |
|
|
9460acd91b | |
|
|
480d49f2b3 | |
|
|
1358b21c3a | |
|
|
480bba4f9d | |
|
|
a14c06a1f1 | |
|
|
2e1ef93aa6 | |
|
|
14c412113f | |
|
|
642cfbda0a | |
|
|
0e13296752 | |
|
|
8fac26edca | |
|
|
b0b16e1fc5 | |
|
|
297193b6ce | |
|
|
99e14d0e29 | |
|
|
dbca691746 | |
|
|
e66f65b257 | |
|
|
5f60a37d8a | |
|
|
d30e136c1d | |
|
|
9c122a4bfe | |
|
|
1761a4f588 | |
|
|
b60fa5c920 | |
|
|
4191f5ca5c | |
|
|
a00482d5d7 | |
|
|
2610869e9c | |
|
|
155eb55953 | |
|
|
8541ca99af | |
|
|
9cb15ec2ae | |
|
|
27d46fc0a4 | |
|
|
5800ac6b9e | |
|
|
c57ec64e63 | |
|
|
1a1d6562d2 | |
|
|
255101f6f7 | |
|
|
bd30f3d53a | |
|
|
0c24d59a2c | |
|
|
4557ca0ace | |
|
|
18c0b3dec4 | |
|
|
674b7a0b04 | |
|
|
d511f1bd94 | |
|
|
fa75346763 | |
|
|
79b1717f9a | |
|
|
6b4d03cb8d | |
|
|
2d7fd84c57 | |
|
|
d0a19e5b6f | |
|
|
14db619b20 | |
|
|
c166bb0a89 | |
|
|
4a60f91994 | |
|
|
d601b5781e | |
|
|
8223a5dcc4 | |
|
|
b40e5c19b2 | |
|
|
5ebc354cfc | |
|
|
ca5d3e3556 | |
|
|
c44cf9b9f6 | |
|
|
cde32b45c0 | |
|
|
6274bfcd8c | |
|
|
29fac802f3 | |
|
|
37597a85d5 | |
|
|
f46aa17c77 | |
|
|
6c70291d0a | |
|
|
14ff957bde | |
|
|
34439a6532 | |
|
|
db07f4a354 | |
|
|
820ea549e3 | |
|
|
2b42931486 | |
|
|
9bf5dfdc5f | |
|
|
a3f8d03611 | |
|
|
b6f21f451d | |
|
|
418b74b39d | |
|
|
919190dedc | |
|
|
81ccdc49ec | |
|
|
b006fad9b6 | |
|
|
74a02ca3dc | |
|
|
efaaacabb0 | |
|
|
3410150e28 | |
|
|
054fd7546f | |
|
|
1797831afc | |
|
|
24be94be5e | |
|
|
33ba42a759 | |
|
|
1e7b9fb94c | |
|
|
45e5133e97 | |
|
|
7713948f5c | |
|
|
b64507d64a | |
|
|
b06db48891 | |
|
|
43f1681f51 | |
|
|
5c90f0bbb7 | |
|
|
c1b223e3a7 | |
|
|
0d7b23a44f | |
|
|
f91f931c0b | |
|
|
329e124db0 | |
|
|
c64b5edf20 | |
|
|
c049d29eee | |
|
|
7804d0bd2f | |
|
|
7901116744 | |
|
|
eb5df8834b | |
|
|
711aa763b9 | |
|
|
3c7018b38a | |
|
|
2a5091c6f4 | |
|
|
b6222b9755 | |
|
|
4db3e90872 | |
|
|
19ac02fd70 | |
|
|
9d094587b3 | |
|
|
2bc2b08bc7 | |
|
|
f64a5dd5ca | |
|
|
9f21dbbc5c | |
|
|
05ce7d92a9 | |
|
|
2e17d9c084 | |
|
|
82779f3c70 | |
|
|
b1bc3ceb27 | |
|
|
e2a7df4a2c | |
|
|
2a452a00e0 | |
|
|
4d4123243c | |
|
|
2c1bdc9670 | |
|
|
08885f65cd | |
|
|
961825d25c | |
|
|
337d1bab02 | |
|
|
b6a71fe988 | |
|
|
786df8e278 | |
|
|
451d218f4b | |
|
|
adcb6194c8 | |
|
|
334f79efe4 | |
|
|
73b38b143b | |
|
|
ef541b220b | |
|
|
173c0e384f | |
|
|
360ccc7adc | |
|
|
df760d3504 | |
|
|
0beecf7ea1 | |
|
|
aa2821a19d | |
|
|
2288fa218e | |
|
|
6adc583c38 | |
|
|
52111e4bf9 | |
|
|
68db4092ed | |
|
|
acf8d9719f | |
|
|
92e5d2a97a | |
|
|
e165901506 | |
|
|
3187b1c46e | |
|
|
662dec2fe2 | |
|
|
3901695a6f | |
|
|
d0a5c25b5d | |
|
|
9c5c6c6be7 | |
|
|
d8da1b796c | |
|
|
e2dfdb2236 | |
|
|
a8eba6949e | |
|
|
3e907e8da7 | |
|
|
af1b557bc8 | |
|
|
e6c3bd1ce5 | |
|
|
046d25f35d | |
|
|
d20d4ffa16 | |
|
|
76f2273d0b | |
|
|
dda78c95b7 | |
|
|
ebbeb047be | |
|
|
ebd7fd59d0 | |
|
|
c20c2c221f | |
|
|
ee33dbdc0e | |
|
|
5d8d4fa530 | |
|
|
2021028cad | |
|
|
7fcb1b2e0a | |
|
|
f4a2f909a7 | |
|
|
328630fe5d | |
|
|
f7ae7e29d1 | |
|
|
e46ea3ebac | |
|
|
d565fa4883 | |
|
|
a627108dfe | |
|
|
829451f05e | |
|
|
cae41a8da2 | |
|
|
a4099cf645 | |
|
|
0a104689ed | |
|
|
97d0226c78 | |
|
|
3a04dda55d | |
|
|
94310c4f3d | |
|
|
39e7d8a84b | |
|
|
e1037ac125 | |
|
|
a10384c009 | |
|
|
ab8215d1ce | |
|
|
524982c7bd | |
|
|
d6188aa009 | |
|
|
7e8b08a58c | |
|
|
14771f0ab4 | |
|
|
97c0603269 | |
|
|
a58c430858 | |
|
|
cd4119b26a | |
|
|
ea20fa3ce2 | |
|
|
3b54208ac9 | |
|
|
d2de744c3f | |
|
|
655249d67a | |
|
|
80a890549d | |
|
|
5da1979ce6 | |
|
|
642512aa91 | |
|
|
4a32a8e725 | |
|
|
bb30ae7086 | |
|
|
34a6f2e1f1 | |
|
|
0e51d1e7b1 | |
|
|
40bdf7b100 | |
|
|
57f51249b6 | |
|
|
dcc5dc0d16 | |
|
|
e87a818706 | |
|
|
67df97d5a7 | |
|
|
3f8fd0a0f8 | |
|
|
961fe9a5f1 | |
|
|
22f156bbb7 | |
|
|
22c22c4246 | |
|
|
994cd62c7a | |
|
|
1e4ed04a65 | |
|
|
139b25639e | |
|
|
13800738cb | |
|
|
98c538c9e3 | |
|
|
0e7c45173c | |
|
|
132b23dc33 | |
|
|
c3f1dd846c | |
|
|
7b7abde756 | |
|
|
aeeb0eb26b | |
|
|
265a181891 | |
|
|
22663e1b43 | |
|
|
24be1a436e | |
|
|
370c53edfa | |
|
|
f112133ddf | |
|
|
93ee021b6e | |
|
|
e57d2ea17c | |
|
|
ea038a5437 | |
|
|
329aa68644 | |
|
|
887430874d | |
|
|
52f8693e1d | |
|
|
8057dcc4fc | |
|
|
66e0f9a53d | |
|
|
7a35c474d6 | |
|
|
892065003d | |
|
|
ede8353503 | |
|
|
60796ca8fb | |
|
|
25e9112ccc | |
|
|
f6c5c91eb1 | |
|
|
740da06972 | |
|
|
2a363f9c17 | |
|
|
3c649a8814 | |
|
|
a144bf2bff | |
|
|
83ee4223be | |
|
|
8f6c864e96 | |
|
|
12209ae5a4 | |
|
|
4e0301a7b2 | |
|
|
00fa1c3158 | |
|
|
04edd66199 | |
|
|
d8896c9054 | |
|
|
dd70c1950e | |
|
|
954d208ac6 | |
|
|
98d25fa16e | |
|
|
3af7af265b | |
|
|
436c2154ad | |
|
|
42e8baa85c | |
|
|
0dff71bd4d | |
|
|
20ce9da509 | |
|
|
a044b0d205 | |
|
|
698200ecc2 | |
|
|
883d89ee0b | |
|
|
fb9a480f3c | |
|
|
e288710251 | |
|
|
1019aa58ce | |
|
|
e9621469b2 | |
|
|
57c4910605 | |
|
|
9920957796 | |
|
|
e798f46876 | |
|
|
caa7537607 | |
|
|
8b23c97fdb | |
|
|
af49ad54f6 | |
|
|
816479e092 | |
|
|
7e72849d05 | |
|
|
99206a5d65 | |
|
|
114c9f3af6 | |
|
|
e14fb70c26 | |
|
|
201149a131 | |
|
|
2bc80c4c07 | |
|
|
ee7607bcca | |
|
|
7e2dbc5608 | |
|
|
8eac239e48 | |
|
|
6650397e38 | |
|
|
1ca4c26d81 | |
|
|
0b0da91139 | |
|
|
3d47ec2e73 | |
|
|
1f21102204 | |
|
|
58b4600144 | |
|
|
6146d63f2c | |
|
|
dbf42739ca | |
|
|
57f56c2769 | |
|
|
5c130cfda6 | |
|
|
df284ff6f5 | |
|
|
1b7550f9a2 | |
|
|
195df24b4b | |
|
|
68de85aa5f | |
|
|
8b6784d8e2 | |
|
|
b73c14400c | |
|
|
54922af7db | |
|
|
23944b2f9c | |
|
|
9d0240b831 | |
|
|
1aef90d506 | |
|
|
41b7e62b02 | |
|
|
70a5e47b66 | |
|
|
8722e184d6 | |
|
|
819ad04e3e | |
|
|
ab89a5efcc | |
|
|
2fbb10bfd2 | |
|
|
3fba7d5d92 | |
|
|
d8d8758cfa | |
|
|
5ba3e031f2 | |
|
|
cc658b9ece | |
|
|
1ed627798e | |
|
|
bc4c7a02d3 | |
|
|
17493a2a15 | |
|
|
63d7e816ff | |
|
|
fc7bd9a35d | |
|
|
7ebcb4bf8a | |
|
|
67feb9947e | |
|
|
af479c7838 | |
|
|
2f3949d732 | |
|
|
79c8b17bee | |
|
|
12d3e3d0d8 | |
|
|
fc33d88334 | |
|
|
09b49f46e8 | |
|
|
379ea3f6bc | |
|
|
84b975ac7f | |
|
|
c7b6858433 | |
|
|
33bae9509b | |
|
|
d0cc511bbc | |
|
|
d855fd67b4 | |
|
|
7f802e8274 | |
|
|
b48e6fb19a | |
|
|
de4dd01d97 | |
|
|
d04a93d75d | |
|
|
fb8eac7064 | |
|
|
f26c32881c | |
|
|
2419815bc1 | |
|
|
cb9fa33b5a | |
|
|
eb69f8e614 | |
|
|
1eb9581d36 | |
|
|
7789620a15 | |
|
|
c3ba1a092c | |
|
|
3ef167e416 | |
|
|
8e1a9a2433 | |
|
|
cd73787dc7 | |
|
|
1624a63cff | |
|
|
db4a8b0e90 | |
|
|
d989e4a717 | |
|
|
a664602e28 | |
|
|
f44b453d76 | |
|
|
1298d02379 | |
|
|
92a93f7cf8 | |
|
|
94a6a5a7d9 | |
|
|
2ca3f9b640 | |
|
|
286bedaa40 | |
|
|
edd1cfaf43 | |
|
|
accd7ebc93 | |
|
|
b7b755f0c6 | |
|
|
87fcfe0c56 | |
|
|
89a9188dd4 | |
|
|
45b0e82432 | |
|
|
5d3125463c | |
|
|
1ab84cb0e5 | |
|
|
e58c159225 | |
|
|
2edb885ae5 | |
|
|
b037ee9caf | |
|
|
27d137a4ae | |
|
|
25f94db9c5 | |
|
|
457ec516f7 | |
|
|
29cd58d3f4 | |
|
|
262d06ea3a | |
|
|
0f733b89dc | |
|
|
265b680a61 | |
|
|
2b7bb59d12 | |
|
|
41fa57d778 | |
|
|
6ad1df166b | |
|
|
24e7ed38a5 | |
|
|
fd0e9202d8 | |
|
|
0922410a22 | |
|
|
4edaa14e28 | |
|
|
a2dede8448 | |
|
|
dc83ba0356 | |
|
|
60c815ab76 | |
|
|
48cf4250b4 | |
|
|
ede8456ea0 | |
|
|
4dc51fae53 | |
|
|
192f58e690 | |
|
|
852b32eabb | |
|
|
5e167eb6e1 | |
|
|
31aefd15f7 | |
|
|
716405d22b | |
|
|
3c33fe21fa | |
|
|
e1e05b761a | |
|
|
1804d4fce6 | |
|
|
0dcc955ced | |
|
|
53076612f8 | |
|
|
f0f2cde0f9 | |
|
|
0546504cae | |
|
|
17652c3a2f | |
|
|
e96d12975f | |
|
|
a9b51070ed | |
|
|
a8c7b9102b | |
|
|
ca04b583a9 | |
|
|
99390fda05 | |
|
|
be12108139 | |
|
|
1dec234174 | |
|
|
3fc684b346 | |
|
|
12d8add3e4 | |
|
|
372b77c662 | |
|
|
5891960756 | |
|
|
c5899bfbf0 | |
|
|
4125f44179 | |
|
|
09a0058379 | |
|
|
3fdcac939a | |
|
|
4cc4e8a8fa | |
|
|
dee4653b9b | |
|
|
2c610dc465 | |
|
|
2c323ca3ff | |
|
|
a95be9d418 | |
|
|
a445462153 | |
|
|
843f08984b | |
|
|
2b3820223c | |
|
|
a5d0028b39 | |
|
|
449704180b | |
|
|
8a18873b81 | |
|
|
199228f6cb | |
|
|
6d0b4f5d16 | |
|
|
4cc0e2650c | |
|
|
06074571f5 | |
|
|
2698ea58d4 | |
|
|
8c9eb7d6b6 | |
|
|
79472708d9 | |
|
|
586908b4d7 | |
|
|
a7bac940a6 | |
|
|
e100b0b940 | |
|
|
161a6249e9 | |
|
|
e4a6e5ef19 | |
|
|
7ceb5c3c8f | |
|
|
bfd33f2412 | |
|
|
2ddf834552 | |
|
|
743e59db7a | |
|
|
88aff5d8a7 | |
|
|
dbeded1c09 | |
|
|
e4b8898d0d | |
|
|
62d7ce5aa9 | |
|
|
7fd4860ff2 | |
|
|
ff979772fe | |
|
|
dddbaeb5c0 | |
|
|
3c5893074b | |
|
|
2cde98a01b | |
|
|
22a825718f | |
|
|
a0bcaab926 | |
|
|
1c023fbe7c | |
|
|
81bf4d28ef | |
|
|
963d2a0443 | |
|
|
10de0df04e | |
|
|
1066713524 | |
|
|
bcdf270bb0 | |
|
|
0673eab57e | |
|
|
5094bba352 | |
|
|
7523e0475f | |
|
|
6beb5cadb2 | |
|
|
5174536744 | |
|
|
e526e33030 | |
|
|
e8b19f863a | |
|
|
91a2f7b16b | |
|
|
3a9d45a7dd | |
|
|
073d90ed17 | |
|
|
689d5b1612 | |
|
|
c615248ad6 | |
|
|
20f85a37cf | |
|
|
b199db3822 | |
|
|
f5bf01159a | |
|
|
2c05324108 | |
|
|
6b36b32e39 | |
|
|
1abf802a09 | |
|
|
2bb0eb1edb | |
|
|
1a12d56cc3 | |
|
|
45e5395550 | |
|
|
692cc84693 | |
|
|
b812e01100 | |
|
|
594329127f | |
|
|
cdc813c453 | |
|
|
3d7fe2a288 | |
|
|
93920707b5 | |
|
|
84ffdaefe2 | |
|
|
0422f858f7 | |
|
|
01c3019cea | |
|
|
24fb0b712a | |
|
|
8fdcd576c9 | |
|
|
07df90f99b | |
|
|
7bd762267b | |
|
|
512c6acebc | |
|
|
ad928ee719 | |
|
|
04d8c97c62 | |
|
|
9fc5d74f6e | |
|
|
f245105b58 | |
|
|
c0cc0bdf84 | |
|
|
c04ea0221a | |
|
|
d52f6673bc | |
|
|
dce8ee4236 | |
|
|
f64f806a42 | |
|
|
fbbc91ea0a | |
|
|
c2bd0ace6e | |
|
|
6b74ea676c | |
|
|
86c7a763bc | |
|
|
3eac04311f | |
|
|
679756c633 | |
|
|
2115edcfb4 | |
|
|
8acb322d49 | |
|
|
f4f89f9de6 | |
|
|
5d1701fd69 | |
|
|
fec24d6785 | |
|
|
00e2c7f04d | |
|
|
0e21fab978 | |
|
|
4ec6d51aca | |
|
|
15a4a5350d | |
|
|
9277d7173d | |
|
|
35f8665dac | |
|
|
8601b26cff | |
|
|
eda2ec10f4 | |
|
|
fc48704057 | |
|
|
00345099cf | |
|
|
155b585ae5 | |
|
|
0ffefeb420 | |
|
|
dbadce31c6 | |
|
|
857a5b26e7 | |
|
|
ca97fc0b5d | |
|
|
293b855866 | |
|
|
f9d537b567 | |
|
|
d42a6751e3 | |
|
|
f124236a64 | |
|
|
6704db8108 | |
|
|
179062e6e5 | |
|
|
397e821824 | |
|
|
6b25828113 | |
|
|
bd7ae4e96b | |
|
|
5f5c4e8415 | |
|
|
66e8b59e26 | |
|
|
a7d93d38ce | |
|
|
ba3549e824 | |
|
|
e2c4ca4922 | |
|
|
1305507bf4 | |
|
|
c789ef147d | |
|
|
1ffee7ac0b | |
|
|
7401297236 | |
|
|
6f1dd1125b | |
|
|
82eeb86d60 | |
|
|
f5cee45345 | |
|
|
1524005060 | |
|
|
b70e8ad81e | |
|
|
a2c265848d | |
|
|
19e5f11fd3 | |
|
|
8d99adceb2 | |
|
|
f1bc33e80d | |
|
|
6bd7e183f6 | |
|
|
7d94113d24 | |
|
|
97ebab0c67 |
|
|
@ -0,0 +1 @@
|
||||||
|
custom: http://doc.ruoyi.vip/ruoyi-cloud/other/donate.html
|
||||||
|
|
@ -25,6 +25,8 @@ target/
|
||||||
*.iml
|
*.iml
|
||||||
*.ipr
|
*.ipr
|
||||||
|
|
||||||
|
### JRebel ###
|
||||||
|
rebel.xml
|
||||||
### NetBeans ###
|
### NetBeans ###
|
||||||
nbproject/private/
|
nbproject/private/
|
||||||
build/*
|
build/*
|
||||||
|
|
@ -37,6 +39,7 @@ nbdist/
|
||||||
# Others
|
# Others
|
||||||
*.log
|
*.log
|
||||||
*.xml.versionsBackup
|
*.xml.versionsBackup
|
||||||
|
*.swp
|
||||||
|
|
||||||
!*/build/*.java
|
!*/build/*.java
|
||||||
!*/build/*.html
|
!*/build/*.html
|
||||||
|
|
|
||||||
36
README.md
36
README.md
|
|
@ -1,13 +1,28 @@
|
||||||
|
<p align="center">
|
||||||
|
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-b99b286755aef70355a7084753f89cdb7c9.png">
|
||||||
|
</p>
|
||||||
|
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v3.6.3</h1>
|
||||||
|
<h4 align="center">基于 Vue/Element UI 和 Spring Boot/Spring Cloud & Alibaba 前后端分离的分布式微服务架构</h4>
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://gitee.com/y_project/RuoYi-Cloud/stargazers"><img src="https://gitee.com/y_project/RuoYi-Cloud/badge/star.svg?theme=dark"></a>
|
||||||
|
<a href="https://gitee.com/y_project/RuoYi-Cloud"><img src="https://img.shields.io/badge/RuoYi-v3.6.3-brightgreen.svg"></a>
|
||||||
|
<a href="https://gitee.com/y_project/RuoYi-Cloud/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
## 平台简介
|
## 平台简介
|
||||||
|
|
||||||
|
若依是一套全部开源的快速开发平台,毫无保留给个人及企业免费使用。
|
||||||
|
|
||||||
* 采用前后端分离的模式,微服务版本前端(基于 [RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue))。
|
* 采用前后端分离的模式,微服务版本前端(基于 [RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue))。
|
||||||
* 后端采用Spring Boot、Spring Cloud & Alibaba。
|
* 后端采用Spring Boot、Spring Cloud & Alibaba。
|
||||||
* 注册中心、配置中心选型Nacos,权限认证使用OAuth2。
|
* 注册中心、配置中心选型Nacos,权限认证使用Redis。
|
||||||
* 流量控制框架选型Sentinel。
|
* 流量控制框架选型Sentinel,分布式事务选型Seata。
|
||||||
|
* 提供了技术栈([Vue3](https://v3.cn.vuejs.org) [Element Plus](https://element-plus.org/zh-CN) [Vite](https://cn.vitejs.dev))版本[RuoYi-Cloud-Vue3](https://github.com/yangzongzhuan/RuoYi-Cloud-Vue3),保持同步更新。
|
||||||
* 如需不分离应用,请移步 [RuoYi](https://gitee.com/y_project/RuoYi),如需分离应用,请移步 [RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue)
|
* 如需不分离应用,请移步 [RuoYi](https://gitee.com/y_project/RuoYi),如需分离应用,请移步 [RuoYi-Vue](https://gitee.com/y_project/RuoYi-Vue)
|
||||||
* 感谢[ruoyi-cloud-design](https://gitee.com/zhangmrit/ruoyi-cloud),[pig](https://gitee.com/log4j/pig)。
|
* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)
|
||||||
* 阿里云优惠券:[点我进入](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)
|
* 阿里云优惠券:[点我领取](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)
|
||||||
|
|
||||||
|
#### 友情链接 [若依/RuoYi-Cloud](https://gitee.com/zhangmrit/ruoyi-cloud) Ant Design版本。
|
||||||
|
|
||||||
## 系统模块
|
## 系统模块
|
||||||
|
|
||||||
|
|
@ -21,14 +36,17 @@ com.ruoyi
|
||||||
├── ruoyi-common // 通用模块
|
├── ruoyi-common // 通用模块
|
||||||
│ └── ruoyi-common-core // 核心模块
|
│ └── ruoyi-common-core // 核心模块
|
||||||
│ └── ruoyi-common-datascope // 权限范围
|
│ └── ruoyi-common-datascope // 权限范围
|
||||||
|
│ └── ruoyi-common-datasource // 多数据源
|
||||||
│ └── ruoyi-common-log // 日志记录
|
│ └── ruoyi-common-log // 日志记录
|
||||||
│ └── ruoyi-common-redis // 缓存服务
|
│ └── ruoyi-common-redis // 缓存服务
|
||||||
|
│ └── ruoyi-common-seata // 分布式事务
|
||||||
│ └── ruoyi-common-security // 安全模块
|
│ └── ruoyi-common-security // 安全模块
|
||||||
│ └── ruoyi-common-swagger // 系统接口
|
│ └── ruoyi-common-swagger // 系统接口
|
||||||
├── ruoyi-modules // 业务模块
|
├── ruoyi-modules // 业务模块
|
||||||
│ └── ruoyi-system // 系统模块 [9201]
|
│ └── ruoyi-system // 系统模块 [9201]
|
||||||
│ └── ruoyi-gen // 代码生成 [9202]
|
│ └── ruoyi-gen // 代码生成 [9202]
|
||||||
│ └── ruoyi-job // 定时任务 [9203]
|
│ └── ruoyi-job // 定时任务 [9203]
|
||||||
|
│ └── ruoyi-file // 文件服务 [9300]
|
||||||
├── ruoyi-visual // 图形化管理模块
|
├── ruoyi-visual // 图形化管理模块
|
||||||
│ └── ruoyi-visual-monitor // 监控中心 [9100]
|
│ └── ruoyi-visual-monitor // 监控中心 [9100]
|
||||||
├──pom.xml // 公共依赖
|
├──pom.xml // 公共依赖
|
||||||
|
|
@ -36,7 +54,7 @@ com.ruoyi
|
||||||
|
|
||||||
## 架构图
|
## 架构图
|
||||||
|
|
||||||
<img src="https://oscimg.oschina.net/oscnet/up-aaa2d885b0fba37e52b56f0948edde1c4fe.png"/>
|
<img src="https://oscimg.oschina.net/oscnet/up-82e9722ecb846786405a904bafcf19f73f3.png"/>
|
||||||
|
|
||||||
## 内置功能
|
## 内置功能
|
||||||
|
|
||||||
|
|
@ -79,7 +97,7 @@ com.ruoyi
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
|
<td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-936ec82d1f4872e1bc980927654b6007307.png"/></td>
|
<td><img src="https://oscimg.oschina.net/oscnet/up-4148b24f58660a9dc347761e4cf6162f28f.png"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
|
<td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
|
||||||
|
|
@ -102,12 +120,12 @@ com.ruoyi
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-92ffb7f3835855cff100fa0f754a6be0d99.png"/></td>
|
<td><img src="https://oscimg.oschina.net/oscnet/up-92ffb7f3835855cff100fa0f754a6be0d99.png"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-d69a19493e5aff7ecdd5d02410862bcea40.png"/></td>
|
<td><img src="https://oscimg.oschina.net/oscnet/up-ff9e3066561574aca73005c5730c6a41f15.png"/></td>
|
||||||
<td><img src="https://oscimg.oschina.net/oscnet/up-6d73c2140ce694e3de4c05035fdc1868d4c.png"/></td>
|
<td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
## 若依微服务交流群
|
## 若依微服务交流群
|
||||||
|
|
||||||
QQ群: [](https://jq.qq.com/?_wv=1027&k=yqInfq0S) [](https://jq.qq.com/?_wv=1027&k=Oy1mb3p8) 点击按钮入群。
|
QQ群: [](https://jq.qq.com/?_wv=1027&k=yqInfq0S) [](https://jq.qq.com/?_wv=1027&k=Oy1mb3p8) [](https://jq.qq.com/?_wv=1027&k=rvxkJtXK) [](https://jq.qq.com/?_wv=1027&k=0Ck3PvTe) [](https://jq.qq.com/?_wv=1027&k=FnHHP4TT) [](https://jq.qq.com/?_wv=1027&k=qdT1Ojpz) [](https://jq.qq.com/?_wv=1027&k=nw3OiyXs) [](https://jq.qq.com/?_wv=1027&k=kiU5WDls) [](https://jq.qq.com/?_wv=1027&k=MtBy6YfT) [](https://jq.qq.com/?_wv=1027&k=FqImHgH2) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=G4jZ4EtdT50PhnMBudTnEwgonxkXOscJ&authKey=FkGHYfoTKlGE6wHdKdjH9bVoOgQjtLP9WM%2Fj7pqGY1msoqw9uxDiBo39E2mLgzYg&noverify=0&group_code=128355254) [](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=irnwcXhbLOQEv1g-TwGifjNTA_f4wZiA&authKey=4bpzEwhcUY%2FvsPDHvzYn6xfoS%2FtOArvZ%2BGXzfr7O0%2FEqLfkKA%2BuCDXlzHIFg8t93&noverify=0&group_code=179219821) 点击按钮入群。
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
@echo off
|
@echo off
|
||||||
echo.
|
echo.
|
||||||
echo [信息] 清理生成路径。
|
echo [信息] 清理工程target生成路径。
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
%~d0
|
%~d0
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
@echo off
|
||||||
|
echo.
|
||||||
|
echo [信息] 使用Jar命令运行Auth工程。
|
||||||
|
echo.
|
||||||
|
|
||||||
|
cd %~dp0
|
||||||
|
cd ../ruoyi-auth/target
|
||||||
|
|
||||||
|
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
|
||||||
|
|
||||||
|
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-auth.jar
|
||||||
|
|
||||||
|
cd bin
|
||||||
|
pause
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
@echo off
|
||||||
|
echo.
|
||||||
|
echo [信息] 使用Jar命令运行Gateway工程。
|
||||||
|
echo.
|
||||||
|
|
||||||
|
cd %~dp0
|
||||||
|
cd ../ruoyi-gateway/target
|
||||||
|
|
||||||
|
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
|
||||||
|
|
||||||
|
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-gateway.jar
|
||||||
|
|
||||||
|
cd bin
|
||||||
|
pause
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
@echo off
|
||||||
|
echo.
|
||||||
|
echo [信息] 使用Jar命令运行Modules-File工程。
|
||||||
|
echo.
|
||||||
|
|
||||||
|
cd %~dp0
|
||||||
|
cd ../ruoyi-modules/ruoyi-file/target
|
||||||
|
|
||||||
|
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
|
||||||
|
|
||||||
|
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-file.jar
|
||||||
|
|
||||||
|
cd bin
|
||||||
|
pause
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
@echo off
|
||||||
|
echo.
|
||||||
|
echo [信息] 使用Jar命令运行Modules-Gen工程。
|
||||||
|
echo.
|
||||||
|
|
||||||
|
cd %~dp0
|
||||||
|
cd ../ruoyi-modules/ruoyi-gen/target
|
||||||
|
|
||||||
|
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
|
||||||
|
|
||||||
|
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-gen.jar
|
||||||
|
|
||||||
|
cd bin
|
||||||
|
pause
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
@echo off
|
||||||
|
echo.
|
||||||
|
echo [信息] 使用Jar命令运行Modules-Job工程。
|
||||||
|
echo.
|
||||||
|
|
||||||
|
cd %~dp0
|
||||||
|
cd ../ruoyi-modules/ruoyi-job/target
|
||||||
|
|
||||||
|
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
|
||||||
|
|
||||||
|
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-job.jar
|
||||||
|
|
||||||
|
cd bin
|
||||||
|
pause
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
@echo off
|
||||||
|
echo.
|
||||||
|
echo [信息] 使用Jar命令运行Modules-System工程。
|
||||||
|
echo.
|
||||||
|
|
||||||
|
cd %~dp0
|
||||||
|
cd ../ruoyi-modules/ruoyi-system/target
|
||||||
|
|
||||||
|
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
|
||||||
|
|
||||||
|
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-modules-system.jar
|
||||||
|
|
||||||
|
cd bin
|
||||||
|
pause
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
@echo off
|
||||||
|
echo.
|
||||||
|
echo [信息] 使用Jar命令运行Monitor工程。
|
||||||
|
echo.
|
||||||
|
|
||||||
|
cd %~dp0
|
||||||
|
cd ../ruoyi-visual/ruoyi-monitor/target
|
||||||
|
|
||||||
|
set JAVA_OPTS=-Xms512m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m
|
||||||
|
|
||||||
|
java -Dfile.encoding=utf-8 %JAVA_OPTS% -jar ruoyi-visual-monitor.jar
|
||||||
|
|
||||||
|
cd bin
|
||||||
|
pause
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# 复制项目的文件到对应docker路径,便于一键生成镜像。
|
||||||
|
usage() {
|
||||||
|
echo "Usage: sh copy.sh"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# copy sql
|
||||||
|
echo "begin copy sql "
|
||||||
|
cp ../sql/ry_20230706.sql ./mysql/db
|
||||||
|
cp ../sql/ry_config_20220929.sql ./mysql/db
|
||||||
|
|
||||||
|
# copy html
|
||||||
|
echo "begin copy html "
|
||||||
|
cp -r ../ruoyi-ui/dist/** ./nginx/html/dist
|
||||||
|
|
||||||
|
|
||||||
|
# copy jar
|
||||||
|
echo "begin copy ruoyi-gateway "
|
||||||
|
cp ../ruoyi-gateway/target/ruoyi-gateway.jar ./ruoyi/gateway/jar
|
||||||
|
|
||||||
|
echo "begin copy ruoyi-auth "
|
||||||
|
cp ../ruoyi-auth/target/ruoyi-auth.jar ./ruoyi/auth/jar
|
||||||
|
|
||||||
|
echo "begin copy ruoyi-visual "
|
||||||
|
cp ../ruoyi-visual/ruoyi-monitor/target/ruoyi-visual-monitor.jar ./ruoyi/visual/monitor/jar
|
||||||
|
|
||||||
|
echo "begin copy ruoyi-modules-system "
|
||||||
|
cp ../ruoyi-modules/ruoyi-system/target/ruoyi-modules-system.jar ./ruoyi/modules/system/jar
|
||||||
|
|
||||||
|
echo "begin copy ruoyi-modules-file "
|
||||||
|
cp ../ruoyi-modules/ruoyi-file/target/ruoyi-modules-file.jar ./ruoyi/modules/file/jar
|
||||||
|
|
||||||
|
echo "begin copy ruoyi-modules-job "
|
||||||
|
cp ../ruoyi-modules/ruoyi-job/target/ruoyi-modules-job.jar ./ruoyi/modules/job/jar
|
||||||
|
|
||||||
|
echo "begin copy ruoyi-modules-gen "
|
||||||
|
cp ../ruoyi-modules/ruoyi-gen/target/ruoyi-modules-gen.jar ./ruoyi/modules/gen/jar
|
||||||
|
|
||||||
|
|
@ -0,0 +1,67 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# 使用说明,用来提示输入参数
|
||||||
|
usage() {
|
||||||
|
echo "Usage: sh 执行脚本.sh [port|base|modules|stop|rm]"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# 开启所需端口
|
||||||
|
port(){
|
||||||
|
firewall-cmd --add-port=80/tcp --permanent
|
||||||
|
firewall-cmd --add-port=8080/tcp --permanent
|
||||||
|
firewall-cmd --add-port=8848/tcp --permanent
|
||||||
|
firewall-cmd --add-port=9848/tcp --permanent
|
||||||
|
firewall-cmd --add-port=9849/tcp --permanent
|
||||||
|
firewall-cmd --add-port=6379/tcp --permanent
|
||||||
|
firewall-cmd --add-port=3306/tcp --permanent
|
||||||
|
firewall-cmd --add-port=9100/tcp --permanent
|
||||||
|
firewall-cmd --add-port=9200/tcp --permanent
|
||||||
|
firewall-cmd --add-port=9201/tcp --permanent
|
||||||
|
firewall-cmd --add-port=9202/tcp --permanent
|
||||||
|
firewall-cmd --add-port=9203/tcp --permanent
|
||||||
|
firewall-cmd --add-port=9300/tcp --permanent
|
||||||
|
service firewalld restart
|
||||||
|
}
|
||||||
|
|
||||||
|
# 启动基础环境(必须)
|
||||||
|
base(){
|
||||||
|
docker-compose up -d ruoyi-mysql ruoyi-redis ruoyi-nacos
|
||||||
|
}
|
||||||
|
|
||||||
|
# 启动程序模块(必须)
|
||||||
|
modules(){
|
||||||
|
docker-compose up -d ruoyi-nginx ruoyi-gateway ruoyi-auth ruoyi-modules-system
|
||||||
|
}
|
||||||
|
|
||||||
|
# 关闭所有环境/模块
|
||||||
|
stop(){
|
||||||
|
docker-compose stop
|
||||||
|
}
|
||||||
|
|
||||||
|
# 删除所有环境/模块
|
||||||
|
rm(){
|
||||||
|
docker-compose rm
|
||||||
|
}
|
||||||
|
|
||||||
|
# 根据输入参数,选择执行对应方法,不输入则执行使用说明
|
||||||
|
case "$1" in
|
||||||
|
"port")
|
||||||
|
port
|
||||||
|
;;
|
||||||
|
"base")
|
||||||
|
base
|
||||||
|
;;
|
||||||
|
"modules")
|
||||||
|
modules
|
||||||
|
;;
|
||||||
|
"stop")
|
||||||
|
stop
|
||||||
|
;;
|
||||||
|
"rm")
|
||||||
|
rm
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
@ -0,0 +1,140 @@
|
||||||
|
version : '3.8'
|
||||||
|
services:
|
||||||
|
ruoyi-nacos:
|
||||||
|
container_name: ruoyi-nacos
|
||||||
|
image: nacos/nacos-server
|
||||||
|
build:
|
||||||
|
context: ./nacos
|
||||||
|
environment:
|
||||||
|
- MODE=standalone
|
||||||
|
volumes:
|
||||||
|
- ./nacos/logs/:/home/nacos/logs
|
||||||
|
- ./nacos/conf/application.properties:/home/nacos/conf/application.properties
|
||||||
|
ports:
|
||||||
|
- "8848:8848"
|
||||||
|
- "9848:9848"
|
||||||
|
- "9849:9849"
|
||||||
|
depends_on:
|
||||||
|
- ruoyi-mysql
|
||||||
|
ruoyi-mysql:
|
||||||
|
container_name: ruoyi-mysql
|
||||||
|
image: mysql:5.7
|
||||||
|
build:
|
||||||
|
context: ./mysql
|
||||||
|
ports:
|
||||||
|
- "3306:3306"
|
||||||
|
volumes:
|
||||||
|
- ./mysql/conf:/etc/mysql/conf.d
|
||||||
|
- ./mysql/logs:/logs
|
||||||
|
- ./mysql/data:/var/lib/mysql
|
||||||
|
command: [
|
||||||
|
'mysqld',
|
||||||
|
'--innodb-buffer-pool-size=80M',
|
||||||
|
'--character-set-server=utf8mb4',
|
||||||
|
'--collation-server=utf8mb4_unicode_ci',
|
||||||
|
'--default-time-zone=+8:00',
|
||||||
|
'--lower-case-table-names=1'
|
||||||
|
]
|
||||||
|
environment:
|
||||||
|
MYSQL_DATABASE: 'ry-cloud'
|
||||||
|
MYSQL_ROOT_PASSWORD: password
|
||||||
|
ruoyi-redis:
|
||||||
|
container_name: ruoyi-redis
|
||||||
|
image: redis
|
||||||
|
build:
|
||||||
|
context: ./redis
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
volumes:
|
||||||
|
- ./redis/conf/redis.conf:/home/ruoyi/redis/redis.conf
|
||||||
|
- ./redis/data:/data
|
||||||
|
command: redis-server /home/ruoyi/redis/redis.conf
|
||||||
|
ruoyi-nginx:
|
||||||
|
container_name: ruoyi-nginx
|
||||||
|
image: nginx
|
||||||
|
build:
|
||||||
|
context: ./nginx
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
volumes:
|
||||||
|
- ./nginx/html/dist:/home/ruoyi/projects/ruoyi-ui
|
||||||
|
- ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
|
||||||
|
- ./nginx/logs:/var/log/nginx
|
||||||
|
- ./nginx/conf.d:/etc/nginx/conf.d
|
||||||
|
depends_on:
|
||||||
|
- ruoyi-gateway
|
||||||
|
links:
|
||||||
|
- ruoyi-gateway
|
||||||
|
ruoyi-gateway:
|
||||||
|
container_name: ruoyi-gateway
|
||||||
|
build:
|
||||||
|
context: ./ruoyi/gateway
|
||||||
|
dockerfile: dockerfile
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
depends_on:
|
||||||
|
- ruoyi-redis
|
||||||
|
links:
|
||||||
|
- ruoyi-redis
|
||||||
|
ruoyi-auth:
|
||||||
|
container_name: ruoyi-auth
|
||||||
|
build:
|
||||||
|
context: ./ruoyi/auth
|
||||||
|
dockerfile: dockerfile
|
||||||
|
ports:
|
||||||
|
- "9200:9200"
|
||||||
|
depends_on:
|
||||||
|
- ruoyi-redis
|
||||||
|
links:
|
||||||
|
- ruoyi-redis
|
||||||
|
ruoyi-modules-system:
|
||||||
|
container_name: ruoyi-modules-system
|
||||||
|
build:
|
||||||
|
context: ./ruoyi/modules/system
|
||||||
|
dockerfile: dockerfile
|
||||||
|
ports:
|
||||||
|
- "9201:9201"
|
||||||
|
depends_on:
|
||||||
|
- ruoyi-redis
|
||||||
|
- ruoyi-mysql
|
||||||
|
links:
|
||||||
|
- ruoyi-redis
|
||||||
|
- ruoyi-mysql
|
||||||
|
ruoyi-modules-gen:
|
||||||
|
container_name: ruoyi-modules-gen
|
||||||
|
build:
|
||||||
|
context: ./ruoyi/modules/gen
|
||||||
|
dockerfile: dockerfile
|
||||||
|
ports:
|
||||||
|
- "9202:9202"
|
||||||
|
depends_on:
|
||||||
|
- ruoyi-mysql
|
||||||
|
links:
|
||||||
|
- ruoyi-mysql
|
||||||
|
ruoyi-modules-job:
|
||||||
|
container_name: ruoyi-modules-job
|
||||||
|
build:
|
||||||
|
context: ./ruoyi/modules/job
|
||||||
|
dockerfile: dockerfile
|
||||||
|
ports:
|
||||||
|
- "9203:9203"
|
||||||
|
depends_on:
|
||||||
|
- ruoyi-mysql
|
||||||
|
links:
|
||||||
|
- ruoyi-mysql
|
||||||
|
ruoyi-modules-file:
|
||||||
|
container_name: ruoyi-modules-file
|
||||||
|
build:
|
||||||
|
context: ./ruoyi/modules/file
|
||||||
|
dockerfile: dockerfile
|
||||||
|
ports:
|
||||||
|
- "9300:9300"
|
||||||
|
volumes:
|
||||||
|
- ./ruoyi/uploadPath:/home/ruoyi/uploadPath
|
||||||
|
ruoyi-visual-monitor:
|
||||||
|
container_name: ruoyi-visual-monitor
|
||||||
|
build:
|
||||||
|
context: ./ruoyi/visual/monitor
|
||||||
|
dockerfile: dockerfile
|
||||||
|
ports:
|
||||||
|
- "9100:9100"
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
存放sql目录下的所有脚本,用于docker自动执行。
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
# 基础镜像
|
||||||
|
FROM mysql:5.7
|
||||||
|
# author
|
||||||
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
# 执行sql脚本
|
||||||
|
ADD ./db/*.sql /docker-entrypoint-initdb.d/
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
spring.datasource.platform=mysql
|
||||||
|
db.num=1
|
||||||
|
db.url.0=jdbc:mysql://ruoyi-mysql:3306/ry-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
|
||||||
|
db.user=root
|
||||||
|
db.password=password
|
||||||
|
|
||||||
|
nacos.naming.empty-service.auto-clean=true
|
||||||
|
nacos.naming.empty-service.clean.initial-delay-ms=50000
|
||||||
|
nacos.naming.empty-service.clean.period-time-ms=30000
|
||||||
|
|
||||||
|
management.endpoints.web.exposure.include=*
|
||||||
|
|
||||||
|
management.metrics.export.elastic.enabled=false
|
||||||
|
management.metrics.export.influx.enabled=false
|
||||||
|
|
||||||
|
server.tomcat.accesslog.enabled=true
|
||||||
|
server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
|
||||||
|
|
||||||
|
server.tomcat.basedir=/home/ruoyi/nacos/tomcat/logs
|
||||||
|
|
||||||
|
nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
|
||||||
|
|
||||||
|
nacos.core.auth.system.type=nacos
|
||||||
|
nacos.core.auth.enabled=false
|
||||||
|
nacos.core.auth.default.token.expire.seconds=18000
|
||||||
|
nacos.core.auth.default.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
|
||||||
|
nacos.core.auth.caching.enabled=true
|
||||||
|
nacos.core.auth.enable.userAgentAuthWhite=false
|
||||||
|
nacos.core.auth.server.identity.key=serverIdentity
|
||||||
|
nacos.core.auth.server.identity.value=security
|
||||||
|
|
||||||
|
nacos.istio.mcp.server.enabled=false
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
# 基础镜像
|
||||||
|
FROM nacos/nacos-server
|
||||||
|
# author
|
||||||
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
# 复制conf文件到路径
|
||||||
|
COPY ./conf/application.properties /home/nacos/conf/application.properties
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
worker_processes 1;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
include mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
sendfile on;
|
||||||
|
keepalive_timeout 65;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /home/ruoyi/projects/ruoyi-ui;
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
index index.html index.htm;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /prod-api/{
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header REMOTE-HOST $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_pass http://ruoyi-gateway:8080/;
|
||||||
|
}
|
||||||
|
|
||||||
|
# 避免actuator暴露
|
||||||
|
if ($request_uri ~ "/actuator") {
|
||||||
|
return 403;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 500 502 503 504 /50x.html;
|
||||||
|
location = /50x.html {
|
||||||
|
root html;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
# 基础镜像
|
||||||
|
FROM nginx
|
||||||
|
# author
|
||||||
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
# 挂载目录
|
||||||
|
VOLUME /home/ruoyi/projects/ruoyi-ui
|
||||||
|
# 创建目录
|
||||||
|
RUN mkdir -p /home/ruoyi/projects/ruoyi-ui
|
||||||
|
# 指定路径
|
||||||
|
WORKDIR /home/ruoyi/projects/ruoyi-ui
|
||||||
|
# 复制conf文件到路径
|
||||||
|
COPY ./conf/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
# 复制html文件到路径
|
||||||
|
COPY ./html/dist /home/ruoyi/projects/ruoyi-ui
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
存放前端ruoyi-ui构建好的静态文件,用于nginx请求访问。
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
# requirepass 123456
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
# 基础镜像
|
||||||
|
FROM redis
|
||||||
|
# author
|
||||||
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
# 挂载目录
|
||||||
|
VOLUME /home/ruoyi/redis
|
||||||
|
# 创建目录
|
||||||
|
RUN mkdir -p /home/ruoyi/redis
|
||||||
|
# 指定路径
|
||||||
|
WORKDIR /home/ruoyi/redis
|
||||||
|
# 复制conf文件到路径
|
||||||
|
COPY ./conf/redis.conf /home/ruoyi/redis/redis.conf
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
# 基础镜像
|
||||||
|
FROM openjdk:8-jre
|
||||||
|
# author
|
||||||
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
# 挂载目录
|
||||||
|
VOLUME /home/ruoyi
|
||||||
|
# 创建目录
|
||||||
|
RUN mkdir -p /home/ruoyi
|
||||||
|
# 指定路径
|
||||||
|
WORKDIR /home/ruoyi
|
||||||
|
# 复制jar文件到路径
|
||||||
|
COPY ./jar/ruoyi-auth.jar /home/ruoyi/ruoyi-auth.jar
|
||||||
|
# 启动认证服务
|
||||||
|
ENTRYPOINT ["java","-jar","ruoyi-auth.jar"]
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
存放认证中心打包好的jar文件,用于docker启动应用。
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
# 基础镜像
|
||||||
|
FROM openjdk:8-jre
|
||||||
|
# author
|
||||||
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
# 挂载目录
|
||||||
|
VOLUME /home/ruoyi
|
||||||
|
# 创建目录
|
||||||
|
RUN mkdir -p /home/ruoyi
|
||||||
|
# 指定路径
|
||||||
|
WORKDIR /home/ruoyi
|
||||||
|
# 复制jar文件到路径
|
||||||
|
COPY ./jar/ruoyi-gateway.jar /home/ruoyi/ruoyi-gateway.jar
|
||||||
|
# 启动网关服务
|
||||||
|
ENTRYPOINT ["java","-jar","ruoyi-gateway.jar"]
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
存放网关模块打包好的jar文件,用于docker启动应用。
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
# 基础镜像
|
||||||
|
FROM openjdk:8-jre
|
||||||
|
# author
|
||||||
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
# 挂载目录
|
||||||
|
VOLUME /home/ruoyi
|
||||||
|
# 创建目录
|
||||||
|
RUN mkdir -p /home/ruoyi
|
||||||
|
# 指定路径
|
||||||
|
WORKDIR /home/ruoyi
|
||||||
|
# 复制jar文件到路径
|
||||||
|
COPY ./jar/ruoyi-modules-file.jar /home/ruoyi/ruoyi-modules-file.jar
|
||||||
|
# 启动文件服务
|
||||||
|
ENTRYPOINT ["java","-jar","ruoyi-modules-file.jar"]
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
存放文件服务打包好的jar文件,用于docker启动应用。
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
# 基础镜像
|
||||||
|
FROM openjdk:8-jre
|
||||||
|
# author
|
||||||
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
# 挂载目录
|
||||||
|
VOLUME /home/ruoyi
|
||||||
|
# 创建目录
|
||||||
|
RUN mkdir -p /home/ruoyi
|
||||||
|
# 指定路径
|
||||||
|
WORKDIR /home/ruoyi
|
||||||
|
# 复制jar文件到路径
|
||||||
|
COPY ./jar/ruoyi-modules-gen.jar /home/ruoyi/ruoyi-modules-gen.jar
|
||||||
|
# 启动代码生成服务
|
||||||
|
ENTRYPOINT ["java","-jar","ruoyi-modules-gen.jar"]
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
存放代码生成打包好的jar文件,用于docker启动应用。
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
# 基础镜像
|
||||||
|
FROM openjdk:8-jre
|
||||||
|
# author
|
||||||
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
# 挂载目录
|
||||||
|
VOLUME /home/ruoyi
|
||||||
|
# 创建目录
|
||||||
|
RUN mkdir -p /home/ruoyi
|
||||||
|
# 指定路径
|
||||||
|
WORKDIR /home/ruoyi
|
||||||
|
# 复制jar文件到路径
|
||||||
|
COPY ./jar/ruoyi-modules-job.jar /home/ruoyi/ruoyi-modules-job.jar
|
||||||
|
# 启动定时任务服务
|
||||||
|
ENTRYPOINT ["java","-jar","ruoyi-modules-job.jar"]
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
存放定时任务打包好的jar文件,用于docker启动应用。
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
# 基础镜像
|
||||||
|
FROM openjdk:8-jre
|
||||||
|
# author
|
||||||
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
# 挂载目录
|
||||||
|
VOLUME /home/ruoyi
|
||||||
|
# 创建目录
|
||||||
|
RUN mkdir -p /home/ruoyi
|
||||||
|
# 指定路径
|
||||||
|
WORKDIR /home/ruoyi
|
||||||
|
# 复制jar文件到路径
|
||||||
|
COPY ./jar/ruoyi-modules-system.jar /home/ruoyi/ruoyi-modules-system.jar
|
||||||
|
# 启动系统服务
|
||||||
|
ENTRYPOINT ["java","-jar","ruoyi-modules-system.jar"]
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
存放系统模块打包好的jar文件,用于docker启动应用。
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
# 基础镜像
|
||||||
|
FROM openjdk:8-jre
|
||||||
|
# author
|
||||||
|
MAINTAINER ruoyi
|
||||||
|
|
||||||
|
# 挂载目录
|
||||||
|
VOLUME /home/ruoyi
|
||||||
|
# 创建目录
|
||||||
|
RUN mkdir -p /home/ruoyi
|
||||||
|
# 指定路径
|
||||||
|
WORKDIR /home/ruoyi
|
||||||
|
# 复制jar文件到路径
|
||||||
|
COPY ./jar/ruoyi-visual-monitor.jar /home/ruoyi/ruoyi-visual-monitor.jar
|
||||||
|
# 启动系统服务
|
||||||
|
ENTRYPOINT ["java","-jar","ruoyi-visual-monitor.jar"]
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
存放监控中心打包好的jar文件,用于docker启动应用。
|
||||||
188
pom.xml
188
pom.xml
|
|
@ -6,32 +6,35 @@
|
||||||
|
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi</artifactId>
|
<artifactId>ruoyi</artifactId>
|
||||||
<version>2.1.0</version>
|
<version>3.6.3</version>
|
||||||
|
|
||||||
<name>ruoyi</name>
|
<name>ruoyi</name>
|
||||||
<url>http://www.ruoyi.vip</url>
|
<url>http://www.ruoyi.vip</url>
|
||||||
<description>若依微服务系统</description>
|
<description>若依微服务系统</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<ruoyi.version>2.1.0</ruoyi.version>
|
<ruoyi.version>3.6.3</ruoyi.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<spring-boot.version>2.2.6.RELEASE</spring-boot.version>
|
<spring-boot.version>2.7.18</spring-boot.version>
|
||||||
<spring-cloud.version>Hoxton.SR4</spring-cloud.version>
|
<spring-cloud.version>2021.0.8</spring-cloud.version>
|
||||||
<spring-boot-admin.version>2.2.3</spring-boot-admin.version>
|
<spring-cloud-alibaba.version>2021.0.5.0</spring-cloud-alibaba.version>
|
||||||
<spring-boot.mybatis>2.1.2</spring-boot.mybatis>
|
<spring-boot-admin.version>2.7.11</spring-boot-admin.version>
|
||||||
<nacos.version>1.3.0</nacos.version>
|
<swagger.fox.version>3.0.0</swagger.fox.version>
|
||||||
<swagger.fox.version>2.9.2</swagger.fox.version>
|
<swagger.core.version>1.6.2</swagger.core.version>
|
||||||
<swagger.core.version>1.5.24</swagger.core.version>
|
<tobato.version>1.27.2</tobato.version>
|
||||||
<kaptcha.version>2.3.2</kaptcha.version>
|
<kaptcha.version>2.3.3</kaptcha.version>
|
||||||
<pagehelper.boot.version>1.2.12</pagehelper.boot.version>
|
<pagehelper.boot.version>2.0.0</pagehelper.boot.version>
|
||||||
<commons.io.version>2.5</commons.io.version>
|
<druid.version>1.2.20</druid.version>
|
||||||
<commons.fileupload.version>1.3.3</commons.fileupload.version>
|
<dynamic-ds.version>4.2.0</dynamic-ds.version>
|
||||||
<velocity.version>1.7</velocity.version>
|
<commons.io.version>2.13.0</commons.io.version>
|
||||||
<fastjson.version>1.2.70</fastjson.version>
|
<velocity.version>2.3</velocity.version>
|
||||||
<poi.version>3.17</poi.version>
|
<fastjson.version>2.0.43</fastjson.version>
|
||||||
<common-pool.version>2.6.2</common-pool.version>
|
<jjwt.version>0.9.1</jjwt.version>
|
||||||
|
<minio.version>8.2.2</minio.version>
|
||||||
|
<poi.version>4.1.2</poi.version>
|
||||||
|
<transmittable-thread-local.version>2.14.4</transmittable-thread-local.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- 依赖声明 -->
|
<!-- 依赖声明 -->
|
||||||
|
|
@ -47,22 +50,15 @@
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringCloud Alibaba 微服务 -->
|
<!-- SpringCloud Alibaba 微服务 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
<artifactId>spring-cloud-alibaba-dependencies</artifactId>
|
||||||
<version>2.2.1.RELEASE</version>
|
<version>${spring-cloud-alibaba.version}</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Alibaba Nacos 配置 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba.nacos</groupId>
|
|
||||||
<artifactId>nacos-client</artifactId>
|
|
||||||
<version>${nacos.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- SpringBoot 依赖配置 -->
|
<!-- SpringBoot 依赖配置 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|
@ -71,21 +67,14 @@
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringBoot 监控客户端 -->
|
<!-- FastDFS 分布式文件系统 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.codecentric</groupId>
|
<groupId>com.github.tobato</groupId>
|
||||||
<artifactId>spring-boot-admin-starter-client</artifactId>
|
<artifactId>fastdfs-client</artifactId>
|
||||||
<version>${spring-boot-admin.version}</version>
|
<version>${tobato.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Mybatis 依赖配置 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.mybatis.spring.boot</groupId>
|
|
||||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
|
||||||
<version>${spring-boot.mybatis}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Swagger 依赖配置 -->
|
<!-- Swagger 依赖配置 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
|
|
@ -100,7 +89,7 @@
|
||||||
|
|
||||||
<!-- 验证码 -->
|
<!-- 验证码 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.penggle</groupId>
|
<groupId>pro.fessional</groupId>
|
||||||
<artifactId>kaptcha</artifactId>
|
<artifactId>kaptcha</artifactId>
|
||||||
<version>${kaptcha.version}</version>
|
<version>${kaptcha.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
@ -126,98 +115,116 @@
|
||||||
<version>${poi.version}</version>
|
<version>${poi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 文件上传工具类 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-fileupload</groupId>
|
|
||||||
<artifactId>commons-fileupload</artifactId>
|
|
||||||
<version>${commons.fileupload.version}</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 代码生成使用模板 -->
|
<!-- 代码生成使用模板 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.velocity</groupId>
|
<groupId>org.apache.velocity</groupId>
|
||||||
<artifactId>velocity</artifactId>
|
<artifactId>velocity-engine-core</artifactId>
|
||||||
<version>${velocity.version}</version>
|
<version>${velocity.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- JSON 解析器和生成器 -->
|
<!-- JSON 解析器和生成器 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba.fastjson2</groupId>
|
||||||
<artifactId>fastjson</artifactId>
|
<artifactId>fastjson2</artifactId>
|
||||||
<version>${fastjson.version}</version>
|
<version>${fastjson.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 公共资源池 -->
|
<!-- JWT -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
<artifactId>commons-pool2</artifactId>
|
<artifactId>jjwt</artifactId>
|
||||||
<version>${common-pool.version}</version>
|
<version>${jjwt.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 线程传递值 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>transmittable-thread-local</artifactId>
|
||||||
|
<version>${transmittable-thread-local.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 核心模块 -->
|
<!-- 核心模块 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-core</artifactId>
|
<artifactId>ruoyi-common-core</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 接口模块 -->
|
<!-- 接口模块 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-swagger</artifactId>
|
<artifactId>ruoyi-common-swagger</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 安全模块 -->
|
<!-- 安全模块 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-security</artifactId>
|
<artifactId>ruoyi-common-security</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 权限范围 -->
|
<!-- 权限范围 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-datascope</artifactId>
|
<artifactId>ruoyi-common-datascope</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 多数据源 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-common-datasource</artifactId>
|
||||||
|
<version>${ruoyi.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 分布式事务 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-common-seata</artifactId>
|
||||||
|
<version>${ruoyi.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 日志记录 -->
|
<!-- 日志记录 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-log</artifactId>
|
<artifactId>ruoyi-common-log</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 缓存服务 -->
|
<!-- 缓存服务 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common-redis</artifactId>
|
<artifactId>ruoyi-common-redis</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 系统接口 -->
|
<!-- 系统接口 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-api-system</artifactId>
|
<artifactId>ruoyi-api-system</artifactId>
|
||||||
<version>${ruoyi.version}</version>
|
<version>${ruoyi.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>ruoyi-auth</module>
|
<module>ruoyi-auth</module>
|
||||||
<module>ruoyi-gateway</module>
|
<module>ruoyi-gateway</module>
|
||||||
<module>ruoyi-visual</module>
|
<module>ruoyi-visual</module>
|
||||||
<module>ruoyi-modules</module>
|
<module>ruoyi-modules</module>
|
||||||
<module>ruoyi-api</module>
|
<module>ruoyi-api</module>
|
||||||
<module>ruoyi-common</module>
|
<module>ruoyi-common</module>
|
||||||
</modules>
|
</modules>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- bootstrap 启动器 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-bootstrap</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
@ -232,6 +239,47 @@
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
<pluginManagement>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>${spring-boot.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>public</id>
|
||||||
|
<name>aliyun nexus</name>
|
||||||
|
<url>https://maven.aliyun.com/repository/public</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<pluginRepositories>
|
||||||
|
<pluginRepository>
|
||||||
|
<id>public</id>
|
||||||
|
<name>aliyun nexus</name>
|
||||||
|
<url>https://maven.aliyun.com/repository/public</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi</artifactId>
|
<artifactId>ruoyi</artifactId>
|
||||||
<version>2.1.0</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-api</artifactId>
|
<artifactId>ruoyi-api</artifactId>
|
||||||
<version>2.1.0</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.ruoyi.system.api;
|
||||||
|
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import com.ruoyi.common.core.constant.ServiceNameConstants;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.system.api.domain.SysFile;
|
||||||
|
import com.ruoyi.system.api.factory.RemoteFileFallbackFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件服务
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.FILE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
|
||||||
|
public interface RemoteFileService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 上传文件
|
||||||
|
*
|
||||||
|
* @param file 文件信息
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@PostMapping(value = "/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||||
|
public R<SysFile> upload(@RequestPart(value = "file") MultipartFile file);
|
||||||
|
}
|
||||||
|
|
@ -3,9 +3,11 @@ package com.ruoyi.system.api;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
|
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||||
import com.ruoyi.common.core.constant.ServiceNameConstants;
|
import com.ruoyi.common.core.constant.ServiceNameConstants;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.system.api.domain.SysLogininfor;
|
||||||
import com.ruoyi.system.api.domain.SysOperLog;
|
import com.ruoyi.system.api.domain.SysOperLog;
|
||||||
import com.ruoyi.system.api.factory.RemoteLogFallbackFactory;
|
import com.ruoyi.system.api.factory.RemoteLogFallbackFactory;
|
||||||
|
|
||||||
|
|
@ -21,20 +23,19 @@ public interface RemoteLogService
|
||||||
* 保存系统日志
|
* 保存系统日志
|
||||||
*
|
*
|
||||||
* @param sysOperLog 日志实体
|
* @param sysOperLog 日志实体
|
||||||
|
* @param source 请求来源
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("/operlog")
|
@PostMapping("/operlog")
|
||||||
R<Boolean> saveLog(@RequestBody SysOperLog sysOperLog);
|
public R<Boolean> saveLog(@RequestBody SysOperLog sysOperLog, @RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存访问记录
|
* 保存访问记录
|
||||||
*
|
*
|
||||||
* @param username 用户名称
|
* @param sysLogininfor 访问实体
|
||||||
* @param status 状态
|
* @param source 请求来源
|
||||||
* @param message 消息
|
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("/logininfor")
|
@PostMapping("/logininfor")
|
||||||
R<Boolean> saveLogininfor(@RequestParam("username") String username, @RequestParam("status") String status,
|
public R<Boolean> saveLogininfor(@RequestBody SysLogininfor sysLogininfor, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
@RequestParam("message") String message);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,15 @@ package com.ruoyi.system.api;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
|
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||||
import com.ruoyi.common.core.constant.ServiceNameConstants;
|
import com.ruoyi.common.core.constant.ServiceNameConstants;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.system.api.domain.SysUser;
|
||||||
import com.ruoyi.system.api.factory.RemoteUserFallbackFactory;
|
import com.ruoyi.system.api.factory.RemoteUserFallbackFactory;
|
||||||
import com.ruoyi.system.api.model.UserInfo;
|
import com.ruoyi.system.api.model.LoginUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户服务
|
* 用户服务
|
||||||
|
|
@ -20,8 +25,19 @@ public interface RemoteUserService
|
||||||
* 通过用户名查询用户信息
|
* 通过用户名查询用户信息
|
||||||
*
|
*
|
||||||
* @param username 用户名
|
* @param username 用户名
|
||||||
|
* @param source 请求来源
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/user/info/{username}")
|
@GetMapping("/user/info/{username}")
|
||||||
public R<UserInfo> getUserInfo(@PathVariable("username") String username);
|
public R<LoginUser> getUserInfo(@PathVariable("username") String username, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册用户信息
|
||||||
|
*
|
||||||
|
* @param sysUser 用户信息
|
||||||
|
* @param source 请求来源
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/user/register")
|
||||||
|
public R<Boolean> registerUserInfo(@RequestBody SysUser sysUser, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.Email;
|
import javax.validation.constraints.Email;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
@ -31,7 +32,7 @@ public class SysDept extends BaseEntity
|
||||||
private String deptName;
|
private String deptName;
|
||||||
|
|
||||||
/** 显示顺序 */
|
/** 显示顺序 */
|
||||||
private String orderNum;
|
private Integer orderNum;
|
||||||
|
|
||||||
/** 负责人 */
|
/** 负责人 */
|
||||||
private String leader;
|
private String leader;
|
||||||
|
|
@ -96,13 +97,13 @@ public class SysDept extends BaseEntity
|
||||||
this.deptName = deptName;
|
this.deptName = deptName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotBlank(message = "显示顺序不能为空")
|
@NotNull(message = "显示顺序不能为空")
|
||||||
public String getOrderNum()
|
public Integer getOrderNum()
|
||||||
{
|
{
|
||||||
return orderNum;
|
return orderNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setOrderNum(String orderNum)
|
public void setOrderNum(Integer orderNum)
|
||||||
{
|
{
|
||||||
this.orderNum = orderNum;
|
this.orderNum = orderNum;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.api.domain;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
|
|
@ -131,7 +131,7 @@ public class SysDictData extends BaseEntity
|
||||||
|
|
||||||
public boolean getDefault()
|
public boolean getDefault()
|
||||||
{
|
{
|
||||||
return UserConstants.YES.equals(this.isDefault) ? true : false;
|
return UserConstants.YES.equals(this.isDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIsDefault()
|
public String getIsDefault()
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.api.domain;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
@ -57,6 +58,7 @@ public class SysDictType extends BaseEntity
|
||||||
|
|
||||||
@NotBlank(message = "字典类型不能为空")
|
@NotBlank(message = "字典类型不能为空")
|
||||||
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
|
@Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
|
||||||
|
@Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典类型必须以字母开头,且只能为(小写字母,数字,下滑线)")
|
||||||
public String getDictType()
|
public String getDictType()
|
||||||
{
|
{
|
||||||
return dictType;
|
return dictType;
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
package com.ruoyi.system.api.domain;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件信息
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class SysFile
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 文件名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件地址
|
||||||
|
*/
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name)
|
||||||
|
{
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl()
|
||||||
|
{
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUrl(String url)
|
||||||
|
{
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("name", getName())
|
||||||
|
.append("url", getUrl())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package com.ruoyi.system.domain;
|
package com.ruoyi.system.api.domain;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
@ -79,6 +79,10 @@ public class SysOperLog extends BaseEntity
|
||||||
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
@Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||||
private Date operTime;
|
private Date operTime;
|
||||||
|
|
||||||
|
/** 消耗时间 */
|
||||||
|
@Excel(name = "消耗时间", suffix = "毫秒")
|
||||||
|
private Long costTime;
|
||||||
|
|
||||||
public Long getOperId()
|
public Long getOperId()
|
||||||
{
|
{
|
||||||
return operId;
|
return operId;
|
||||||
|
|
@ -238,4 +242,14 @@ public class SysOperLog extends BaseEntity
|
||||||
{
|
{
|
||||||
this.operTime = operTime;
|
this.operTime = operTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getCostTime()
|
||||||
|
{
|
||||||
|
return costTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCostTime(Long costTime)
|
||||||
|
{
|
||||||
|
this.costTime = costTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ruoyi.system.api.domain;
|
package com.ruoyi.system.api.domain;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
@ -31,12 +33,18 @@ public class SysRole extends BaseEntity
|
||||||
|
|
||||||
/** 角色排序 */
|
/** 角色排序 */
|
||||||
@Excel(name = "角色排序")
|
@Excel(name = "角色排序")
|
||||||
private String roleSort;
|
private Integer roleSort;
|
||||||
|
|
||||||
/** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限) */
|
/** 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限) */
|
||||||
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限")
|
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限")
|
||||||
private String dataScope;
|
private String dataScope;
|
||||||
|
|
||||||
|
/** 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */
|
||||||
|
private boolean menuCheckStrictly;
|
||||||
|
|
||||||
|
/** 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */
|
||||||
|
private boolean deptCheckStrictly;
|
||||||
|
|
||||||
/** 角色状态(0正常 1停用) */
|
/** 角色状态(0正常 1停用) */
|
||||||
@Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
|
@Excel(name = "角色状态", readConverterExp = "0=正常,1=停用")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
@ -53,6 +61,9 @@ public class SysRole extends BaseEntity
|
||||||
/** 部门组(数据权限) */
|
/** 部门组(数据权限) */
|
||||||
private Long[] deptIds;
|
private Long[] deptIds;
|
||||||
|
|
||||||
|
/** 角色菜单权限 */
|
||||||
|
private Set<String> permissions;
|
||||||
|
|
||||||
public SysRole()
|
public SysRole()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -107,13 +118,13 @@ public class SysRole extends BaseEntity
|
||||||
this.roleKey = roleKey;
|
this.roleKey = roleKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotBlank(message = "显示顺序不能为空")
|
@NotNull(message = "显示顺序不能为空")
|
||||||
public String getRoleSort()
|
public Integer getRoleSort()
|
||||||
{
|
{
|
||||||
return roleSort;
|
return roleSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRoleSort(String roleSort)
|
public void setRoleSort(Integer roleSort)
|
||||||
{
|
{
|
||||||
this.roleSort = roleSort;
|
this.roleSort = roleSort;
|
||||||
}
|
}
|
||||||
|
|
@ -128,6 +139,26 @@ public class SysRole extends BaseEntity
|
||||||
this.dataScope = dataScope;
|
this.dataScope = dataScope;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isMenuCheckStrictly()
|
||||||
|
{
|
||||||
|
return menuCheckStrictly;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMenuCheckStrictly(boolean menuCheckStrictly)
|
||||||
|
{
|
||||||
|
this.menuCheckStrictly = menuCheckStrictly;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isDeptCheckStrictly()
|
||||||
|
{
|
||||||
|
return deptCheckStrictly;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeptCheckStrictly(boolean deptCheckStrictly)
|
||||||
|
{
|
||||||
|
this.deptCheckStrictly = deptCheckStrictly;
|
||||||
|
}
|
||||||
|
|
||||||
public String getStatus()
|
public String getStatus()
|
||||||
{
|
{
|
||||||
return status;
|
return status;
|
||||||
|
|
@ -177,7 +208,18 @@ public class SysRole extends BaseEntity
|
||||||
{
|
{
|
||||||
this.deptIds = deptIds;
|
this.deptIds = deptIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set<String> getPermissions()
|
||||||
|
{
|
||||||
|
return permissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPermissions(Set<String> permissions)
|
||||||
|
{
|
||||||
|
this.permissions = permissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
.append("roleId", getRoleId())
|
.append("roleId", getRoleId())
|
||||||
|
|
@ -185,6 +227,8 @@ public class SysRole extends BaseEntity
|
||||||
.append("roleKey", getRoleKey())
|
.append("roleKey", getRoleKey())
|
||||||
.append("roleSort", getRoleSort())
|
.append("roleSort", getRoleSort())
|
||||||
.append("dataScope", getDataScope())
|
.append("dataScope", getDataScope())
|
||||||
|
.append("menuCheckStrictly", isMenuCheckStrictly())
|
||||||
|
.append("deptCheckStrictly", isDeptCheckStrictly())
|
||||||
.append("status", getStatus())
|
.append("status", getStatus())
|
||||||
.append("delFlag", getDelFlag())
|
.append("delFlag", getDelFlag())
|
||||||
.append("createBy", getCreateBy())
|
.append("createBy", getCreateBy())
|
||||||
|
|
|
||||||
|
|
@ -2,17 +2,15 @@ package com.ruoyi.system.api.domain;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.validation.constraints.Email;
|
import javax.validation.constraints.*;
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import javax.validation.constraints.Size;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import com.ruoyi.common.core.annotation.Excel;
|
import com.ruoyi.common.core.annotation.Excel;
|
||||||
import com.ruoyi.common.core.annotation.Excel.ColumnType;
|
import com.ruoyi.common.core.annotation.Excel.ColumnType;
|
||||||
import com.ruoyi.common.core.annotation.Excel.Type;
|
import com.ruoyi.common.core.annotation.Excel.Type;
|
||||||
import com.ruoyi.common.core.annotation.Excels;
|
import com.ruoyi.common.core.annotation.Excels;
|
||||||
import com.ruoyi.common.core.web.domain.BaseEntity;
|
import com.ruoyi.common.core.web.domain.BaseEntity;
|
||||||
|
import com.ruoyi.common.core.xss.Xss;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户对象 sys_user
|
* 用户对象 sys_user
|
||||||
|
|
@ -57,9 +55,6 @@ public class SysUser extends BaseEntity
|
||||||
/** 密码 */
|
/** 密码 */
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
/** 盐加密 */
|
|
||||||
private String salt;
|
|
||||||
|
|
||||||
/** 帐号状态(0正常 1停用) */
|
/** 帐号状态(0正常 1停用) */
|
||||||
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
@ -67,12 +62,12 @@ public class SysUser extends BaseEntity
|
||||||
/** 删除标志(0代表存在 2代表删除) */
|
/** 删除标志(0代表存在 2代表删除) */
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
/** 最后登陆IP */
|
/** 最后登录IP */
|
||||||
@Excel(name = "最后登陆IP", type = Type.EXPORT)
|
@Excel(name = "最后登录IP", type = Type.EXPORT)
|
||||||
private String loginIp;
|
private String loginIp;
|
||||||
|
|
||||||
/** 最后登陆时间 */
|
/** 最后登录时间 */
|
||||||
@Excel(name = "最后登陆时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||||
private Date loginDate;
|
private Date loginDate;
|
||||||
|
|
||||||
/** 部门对象 */
|
/** 部门对象 */
|
||||||
|
|
@ -91,6 +86,9 @@ public class SysUser extends BaseEntity
|
||||||
/** 岗位组 */
|
/** 岗位组 */
|
||||||
private Long[] postIds;
|
private Long[] postIds;
|
||||||
|
|
||||||
|
/** 角色ID */
|
||||||
|
private Long roleId;
|
||||||
|
|
||||||
public SysUser()
|
public SysUser()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -131,6 +129,7 @@ public class SysUser extends BaseEntity
|
||||||
this.deptId = deptId;
|
this.deptId = deptId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Xss(message = "用户昵称不能包含脚本字符")
|
||||||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
||||||
public String getNickName()
|
public String getNickName()
|
||||||
{
|
{
|
||||||
|
|
@ -142,6 +141,7 @@ public class SysUser extends BaseEntity
|
||||||
this.nickName = nickName;
|
this.nickName = nickName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Xss(message = "用户账号不能包含脚本字符")
|
||||||
@NotBlank(message = "用户账号不能为空")
|
@NotBlank(message = "用户账号不能为空")
|
||||||
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
||||||
public String getUserName()
|
public String getUserName()
|
||||||
|
|
@ -197,7 +197,6 @@ public class SysUser extends BaseEntity
|
||||||
this.avatar = avatar;
|
this.avatar = avatar;
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonProperty
|
|
||||||
public String getPassword()
|
public String getPassword()
|
||||||
{
|
{
|
||||||
return password;
|
return password;
|
||||||
|
|
@ -208,16 +207,6 @@ public class SysUser extends BaseEntity
|
||||||
this.password = password;
|
this.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSalt()
|
|
||||||
{
|
|
||||||
return salt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSalt(String salt)
|
|
||||||
{
|
|
||||||
this.salt = salt;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus()
|
public String getStatus()
|
||||||
{
|
{
|
||||||
return status;
|
return status;
|
||||||
|
|
@ -297,7 +286,16 @@ public class SysUser extends BaseEntity
|
||||||
{
|
{
|
||||||
this.postIds = postIds;
|
this.postIds = postIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getRoleId()
|
||||||
|
{
|
||||||
|
return roleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoleId(Long roleId)
|
||||||
|
{
|
||||||
|
this.roleId = roleId;
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
@ -310,7 +308,6 @@ public class SysUser extends BaseEntity
|
||||||
.append("sex", getSex())
|
.append("sex", getSex())
|
||||||
.append("avatar", getAvatar())
|
.append("avatar", getAvatar())
|
||||||
.append("password", getPassword())
|
.append("password", getPassword())
|
||||||
.append("salt", getSalt())
|
|
||||||
.append("status", getStatus())
|
.append("status", getStatus())
|
||||||
.append("delFlag", getDelFlag())
|
.append("delFlag", getDelFlag())
|
||||||
.append("loginIp", getLoginIp())
|
.append("loginIp", getLoginIp())
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.ruoyi.system.api.factory;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.system.api.RemoteFileService;
|
||||||
|
import com.ruoyi.system.api.domain.SysFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件服务降级处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileService>
|
||||||
|
{
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(RemoteFileFallbackFactory.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RemoteFileService create(Throwable throwable)
|
||||||
|
{
|
||||||
|
log.error("文件服务调用失败:{}", throwable.getMessage());
|
||||||
|
return new RemoteFileService()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public R<SysFile> upload(MultipartFile file)
|
||||||
|
{
|
||||||
|
return R.fail("上传文件失败:" + throwable.getMessage());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,11 +2,12 @@ package com.ruoyi.system.api.factory;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.ruoyi.system.api.RemoteLogService;
|
import com.ruoyi.system.api.RemoteLogService;
|
||||||
|
import com.ruoyi.system.api.domain.SysLogininfor;
|
||||||
import com.ruoyi.system.api.domain.SysOperLog;
|
import com.ruoyi.system.api.domain.SysOperLog;
|
||||||
import feign.hystrix.FallbackFactory;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日志服务降级处理
|
* 日志服务降级处理
|
||||||
|
|
@ -25,15 +26,15 @@ public class RemoteLogFallbackFactory implements FallbackFactory<RemoteLogServic
|
||||||
return new RemoteLogService()
|
return new RemoteLogService()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public R<Boolean> saveLog(SysOperLog sysOperLog)
|
public R<Boolean> saveLog(SysOperLog sysOperLog, String source)
|
||||||
{
|
{
|
||||||
return null;
|
return R.fail("保存操作日志失败:" + throwable.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R<Boolean> saveLogininfor(String username, String status, String message)
|
public R<Boolean> saveLogininfor(SysLogininfor sysLogininfor, String source)
|
||||||
{
|
{
|
||||||
return null;
|
return R.fail("保存登录日志失败:" + throwable.getMessage());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,12 @@ package com.ruoyi.system.api.factory;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.cloud.openfeign.FallbackFactory;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
import com.ruoyi.system.api.RemoteUserService;
|
import com.ruoyi.system.api.RemoteUserService;
|
||||||
import com.ruoyi.system.api.model.UserInfo;
|
import com.ruoyi.system.api.domain.SysUser;
|
||||||
import feign.hystrix.FallbackFactory;
|
import com.ruoyi.system.api.model.LoginUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户服务降级处理
|
* 用户服务降级处理
|
||||||
|
|
@ -25,9 +26,15 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
||||||
return new RemoteUserService()
|
return new RemoteUserService()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public R<UserInfo> getUserInfo(String username)
|
public R<LoginUser> getUserInfo(String username, String source)
|
||||||
{
|
{
|
||||||
return null;
|
return R.fail("获取用户失败:" + throwable.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<Boolean> registerUserInfo(SysUser sysUser, String source)
|
||||||
|
{
|
||||||
|
return R.fail("注册用户失败:" + throwable.getMessage());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,150 @@
|
||||||
|
package com.ruoyi.system.api.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Set;
|
||||||
|
import com.ruoyi.system.api.domain.SysUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class LoginUser implements Serializable
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户唯一标识
|
||||||
|
*/
|
||||||
|
private String token;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名id
|
||||||
|
*/
|
||||||
|
private Long userid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录时间
|
||||||
|
*/
|
||||||
|
private Long loginTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过期时间
|
||||||
|
*/
|
||||||
|
private Long expireTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录IP地址
|
||||||
|
*/
|
||||||
|
private String ipaddr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限列表
|
||||||
|
*/
|
||||||
|
private Set<String> permissions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色列表
|
||||||
|
*/
|
||||||
|
private Set<String> roles;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户信息
|
||||||
|
*/
|
||||||
|
private SysUser sysUser;
|
||||||
|
|
||||||
|
public String getToken()
|
||||||
|
{
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToken(String token)
|
||||||
|
{
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getUserid()
|
||||||
|
{
|
||||||
|
return userid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserid(Long userid)
|
||||||
|
{
|
||||||
|
this.userid = userid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsername()
|
||||||
|
{
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username)
|
||||||
|
{
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getLoginTime()
|
||||||
|
{
|
||||||
|
return loginTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoginTime(Long loginTime)
|
||||||
|
{
|
||||||
|
this.loginTime = loginTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getExpireTime()
|
||||||
|
{
|
||||||
|
return expireTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpireTime(Long expireTime)
|
||||||
|
{
|
||||||
|
this.expireTime = expireTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIpaddr()
|
||||||
|
{
|
||||||
|
return ipaddr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIpaddr(String ipaddr)
|
||||||
|
{
|
||||||
|
this.ipaddr = ipaddr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<String> getPermissions()
|
||||||
|
{
|
||||||
|
return permissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPermissions(Set<String> permissions)
|
||||||
|
{
|
||||||
|
this.permissions = permissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<String> getRoles()
|
||||||
|
{
|
||||||
|
return roles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoles(Set<String> roles)
|
||||||
|
{
|
||||||
|
this.roles = roles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SysUser getSysUser()
|
||||||
|
{
|
||||||
|
return sysUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSysUser(SysUser sysUser)
|
||||||
|
{
|
||||||
|
this.sysUser = sysUser;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,60 +0,0 @@
|
||||||
package com.ruoyi.system.api.model;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Set;
|
|
||||||
import com.ruoyi.system.api.domain.SysUser;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户信息
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
public class UserInfo implements Serializable
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户基本信息
|
|
||||||
*/
|
|
||||||
private SysUser sysUser;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 权限标识集合
|
|
||||||
*/
|
|
||||||
private Set<String> permissions;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色集合
|
|
||||||
*/
|
|
||||||
private Set<String> roles;
|
|
||||||
|
|
||||||
public SysUser getSysUser()
|
|
||||||
{
|
|
||||||
return sysUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSysUser(SysUser sysUser)
|
|
||||||
{
|
|
||||||
this.sysUser = sysUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<String> getPermissions()
|
|
||||||
{
|
|
||||||
return permissions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPermissions(Set<String> permissions)
|
|
||||||
{
|
|
||||||
this.permissions = permissions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<String> getRoles()
|
|
||||||
{
|
|
||||||
return roles;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoles(Set<String> roles)
|
|
||||||
{
|
|
||||||
this.roles = roles;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
|
||||||
com.ruoyi.system.api.factory.RemoteUserFallbackFactory,\
|
|
||||||
com.ruoyi.system.api.factory.RemoteLogFallbackFactory
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
com.ruoyi.system.api.factory.RemoteUserFallbackFactory
|
||||||
|
com.ruoyi.system.api.factory.RemoteLogFallbackFactory
|
||||||
|
com.ruoyi.system.api.factory.RemoteFileFallbackFactory
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi</artifactId>
|
<artifactId>ruoyi</artifactId>
|
||||||
<version>2.1.0</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|
@ -16,22 +16,22 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- SpringCloud Ailibaba Nacos -->
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringCloud Ailibaba Nacos Config -->
|
<!-- SpringCloud Alibaba Nacos Config -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringCloud Netflix Hystrix -->
|
<!-- SpringCloud Alibaba Sentinel -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringBoot Web -->
|
<!-- SpringBoot Web -->
|
||||||
|
|
@ -40,10 +40,10 @@
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Mysql Connector -->
|
<!-- SpringBoot Actuator -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- RuoYi Common Security-->
|
<!-- RuoYi Common Security-->
|
||||||
|
|
@ -52,15 +52,10 @@
|
||||||
<artifactId>ruoyi-common-security</artifactId>
|
<artifactId>ruoyi-common-security</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- RuoYi Common Redis-->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.ruoyi</groupId>
|
|
||||||
<artifactId>ruoyi-common-redis</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
package com.ruoyi.auth;
|
package com.ruoyi.auth;
|
||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.cloud.client.SpringCloudApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||||
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -10,7 +11,7 @@ import com.ruoyi.common.security.annotation.EnableRyFeignClients;
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@EnableRyFeignClients
|
@EnableRyFeignClients
|
||||||
@SpringCloudApplication
|
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class })
|
||||||
public class RuoYiAuthApplication
|
public class RuoYiAuthApplication
|
||||||
{
|
{
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
|
|
|
||||||
|
|
@ -1,131 +0,0 @@
|
||||||
package com.ruoyi.auth.config;
|
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import javax.sql.DataSource;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
|
||||||
import org.springframework.http.HttpMethod;
|
|
||||||
import org.springframework.security.authentication.AuthenticationManager;
|
|
||||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
|
||||||
import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken;
|
|
||||||
import org.springframework.security.oauth2.config.annotation.configurers.ClientDetailsServiceConfigurer;
|
|
||||||
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
|
|
||||||
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableAuthorizationServer;
|
|
||||||
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
|
|
||||||
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerSecurityConfigurer;
|
|
||||||
import org.springframework.security.oauth2.provider.token.TokenEnhancer;
|
|
||||||
import org.springframework.security.oauth2.provider.token.TokenStore;
|
|
||||||
import org.springframework.security.oauth2.provider.token.store.redis.RedisTokenStore;
|
|
||||||
import com.ruoyi.auth.exception.CustomWebResponseExceptionTranslator;
|
|
||||||
import com.ruoyi.common.core.constant.CacheConstants;
|
|
||||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
|
||||||
import com.ruoyi.common.security.domain.LoginUser;
|
|
||||||
import com.ruoyi.common.security.service.RedisClientDetailsService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OAuth2 认证服务配置
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
@EnableAuthorizationServer
|
|
||||||
public class AuthServerConfig extends AuthorizationServerConfigurerAdapter
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private AuthenticationManager authenticationManager;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private DataSource dataSource;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisConnectionFactory redisConnectionFactory;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private UserDetailsService userDetailsService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TokenEnhancer tokenEnhancer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义授权和令牌端点以及令牌服务
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void configure(AuthorizationServerEndpointsConfigurer endpoints)
|
|
||||||
{
|
|
||||||
endpoints
|
|
||||||
// 请求方式
|
|
||||||
.allowedTokenEndpointRequestMethods(HttpMethod.GET, HttpMethod.POST)
|
|
||||||
// 指定token存储位置
|
|
||||||
.tokenStore(tokenStore())
|
|
||||||
// 自定义生成令牌
|
|
||||||
.tokenEnhancer(tokenEnhancer)
|
|
||||||
// 用户账号密码认证
|
|
||||||
.userDetailsService(userDetailsService)
|
|
||||||
// 指定认证管理器
|
|
||||||
.authenticationManager(authenticationManager)
|
|
||||||
// 是否重复使用 refresh_token
|
|
||||||
.reuseRefreshTokens(false)
|
|
||||||
// 自定义异常处理
|
|
||||||
.exceptionTranslator(new CustomWebResponseExceptionTranslator());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 配置令牌端点(Token Endpoint)的安全约束
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void configure(AuthorizationServerSecurityConfigurer oauthServer)
|
|
||||||
{
|
|
||||||
oauthServer.allowFormAuthenticationForClients().checkTokenAccess("permitAll()");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 声明 ClientDetails实现
|
|
||||||
*/
|
|
||||||
public RedisClientDetailsService clientDetailsService()
|
|
||||||
{
|
|
||||||
RedisClientDetailsService clientDetailsService = new RedisClientDetailsService(dataSource);
|
|
||||||
return clientDetailsService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 配置客户端详情
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void configure(ClientDetailsServiceConfigurer clients) throws Exception
|
|
||||||
{
|
|
||||||
clients.withClientDetails(clientDetailsService());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 基于 Redis 实现,令牌保存到缓存
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public TokenStore tokenStore()
|
|
||||||
{
|
|
||||||
RedisTokenStore tokenStore = new RedisTokenStore(redisConnectionFactory);
|
|
||||||
tokenStore.setPrefix(CacheConstants.OAUTH_ACCESS);
|
|
||||||
return tokenStore;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义生成令牌
|
|
||||||
*/
|
|
||||||
@Bean
|
|
||||||
public TokenEnhancer tokenEnhancer()
|
|
||||||
{
|
|
||||||
return (accessToken, authentication) -> {
|
|
||||||
if (authentication.getUserAuthentication() != null)
|
|
||||||
{
|
|
||||||
Map<String, Object> additionalInformation = new LinkedHashMap<String, Object>();
|
|
||||||
LoginUser user = (LoginUser) authentication.getUserAuthentication().getPrincipal();
|
|
||||||
additionalInformation.put(SecurityConstants.DETAILS_USER_ID, user.getUserId());
|
|
||||||
additionalInformation.put(SecurityConstants.DETAILS_USERNAME, user.getUsername());
|
|
||||||
((DefaultOAuth2AccessToken) accessToken).setAdditionalInformation(additionalInformation);
|
|
||||||
}
|
|
||||||
return accessToken;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
package com.ruoyi.auth.config;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.core.annotation.Order;
|
|
||||||
import org.springframework.security.authentication.AuthenticationManager;
|
|
||||||
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
|
||||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
|
||||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
||||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Security 安全认证相关配置
|
|
||||||
* Oauth2依赖于Security 默认情况下WebSecurityConfig执行比ResourceServerConfig优先
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@Order(99)
|
|
||||||
@Configuration
|
|
||||||
public class WebSecurityConfig extends WebSecurityConfigurerAdapter
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private UserDetailsService userDetailsService;
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public PasswordEncoder passwordEncoder()
|
|
||||||
{
|
|
||||||
return new BCryptPasswordEncoder();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
@Override
|
|
||||||
public AuthenticationManager authenticationManagerBean() throws Exception
|
|
||||||
{
|
|
||||||
return super.authenticationManagerBean();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void configure(AuthenticationManagerBuilder auth) throws Exception
|
|
||||||
{
|
|
||||||
auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void configure(HttpSecurity http) throws Exception
|
|
||||||
{
|
|
||||||
http
|
|
||||||
.authorizeRequests()
|
|
||||||
.antMatchers(
|
|
||||||
"/actuator/**",
|
|
||||||
"/oauth/*",
|
|
||||||
"/token/**").permitAll()
|
|
||||||
.anyRequest().authenticated()
|
|
||||||
.and().csrf().disable();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +1,21 @@
|
||||||
package com.ruoyi.auth.controller;
|
package com.ruoyi.auth.controller;
|
||||||
|
|
||||||
import java.util.Map;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpHeaders;
|
|
||||||
import org.springframework.security.oauth2.common.OAuth2AccessToken;
|
|
||||||
import org.springframework.security.oauth2.common.OAuth2RefreshToken;
|
|
||||||
import org.springframework.security.oauth2.provider.token.TokenStore;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestHeader;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import com.ruoyi.common.core.constant.Constants;
|
import com.ruoyi.auth.form.LoginBody;
|
||||||
import com.ruoyi.common.core.constant.SecurityConstants;
|
import com.ruoyi.auth.form.RegisterBody;
|
||||||
|
import com.ruoyi.auth.service.SysLoginService;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.utils.JwtUtils;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.system.api.RemoteLogService;
|
import com.ruoyi.common.security.auth.AuthUtil;
|
||||||
|
import com.ruoyi.common.security.service.TokenService;
|
||||||
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.system.api.model.LoginUser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* token 控制
|
* token 控制
|
||||||
|
|
@ -22,43 +23,56 @@ import com.ruoyi.system.api.RemoteLogService;
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/token")
|
|
||||||
public class TokenController
|
public class TokenController
|
||||||
{
|
{
|
||||||
@Autowired
|
@Autowired
|
||||||
private TokenStore tokenStore;
|
private TokenService tokenService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RemoteLogService remoteLogService;
|
private SysLoginService sysLoginService;
|
||||||
|
|
||||||
@DeleteMapping("/logout")
|
@PostMapping("login")
|
||||||
public R<?> logout(@RequestHeader(value = HttpHeaders.AUTHORIZATION, required = false) String authHeader)
|
public R<?> login(@RequestBody LoginBody form)
|
||||||
{
|
{
|
||||||
if (StringUtils.isEmpty(authHeader))
|
// 用户登录
|
||||||
{
|
LoginUser userInfo = sysLoginService.login(form.getUsername(), form.getPassword());
|
||||||
return R.ok();
|
// 获取登录token
|
||||||
}
|
return R.ok(tokenService.createToken(userInfo));
|
||||||
|
}
|
||||||
|
|
||||||
String tokenValue = authHeader.replace(OAuth2AccessToken.BEARER_TYPE, StringUtils.EMPTY).trim();
|
@DeleteMapping("logout")
|
||||||
OAuth2AccessToken accessToken = tokenStore.readAccessToken(tokenValue);
|
public R<?> logout(HttpServletRequest request)
|
||||||
if (accessToken == null || StringUtils.isEmpty(accessToken.getValue()))
|
{
|
||||||
|
String token = SecurityUtils.getToken(request);
|
||||||
|
if (StringUtils.isNotEmpty(token))
|
||||||
{
|
{
|
||||||
return R.ok();
|
String username = JwtUtils.getUserName(token);
|
||||||
}
|
// 删除用户缓存记录
|
||||||
|
AuthUtil.logoutByToken(token);
|
||||||
// 清空 access token
|
|
||||||
tokenStore.removeAccessToken(accessToken);
|
|
||||||
|
|
||||||
// 清空 refresh token
|
|
||||||
OAuth2RefreshToken refreshToken = accessToken.getRefreshToken();
|
|
||||||
tokenStore.removeRefreshToken(refreshToken);
|
|
||||||
Map<String, ?> map = accessToken.getAdditionalInformation();
|
|
||||||
if (map.containsKey(SecurityConstants.DETAILS_USERNAME))
|
|
||||||
{
|
|
||||||
String username = (String) map.get(SecurityConstants.DETAILS_USERNAME);
|
|
||||||
// 记录用户退出日志
|
// 记录用户退出日志
|
||||||
remoteLogService.saveLogininfor(username, Constants.LOGOUT, "退出成功");
|
sysLoginService.logout(username);
|
||||||
}
|
}
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("refresh")
|
||||||
|
public R<?> refresh(HttpServletRequest request)
|
||||||
|
{
|
||||||
|
LoginUser loginUser = tokenService.getLoginUser(request);
|
||||||
|
if (StringUtils.isNotNull(loginUser))
|
||||||
|
{
|
||||||
|
// 刷新令牌有效期
|
||||||
|
tokenService.refreshToken(loginUser);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("register")
|
||||||
|
public R<?> register(@RequestBody RegisterBody registerBody)
|
||||||
|
{
|
||||||
|
// 用户注册
|
||||||
|
sysLoginService.register(registerBody.getUsername(), registerBody.getPassword());
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
package com.ruoyi.auth.controller;
|
|
||||||
|
|
||||||
import java.security.Principal;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 身份信息获取
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/oauth")
|
|
||||||
public class UserController
|
|
||||||
{
|
|
||||||
@RequestMapping("/user")
|
|
||||||
public Principal user(Principal user)
|
|
||||||
{
|
|
||||||
return user;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
package com.ruoyi.auth.exception;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* oauth2自定义异常
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
**/
|
|
||||||
@JsonSerialize(using = CustomOauthExceptionSerializer.class)
|
|
||||||
public class CustomOauthException extends OAuth2Exception
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
public CustomOauthException(String msg)
|
|
||||||
{
|
|
||||||
super(msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
||||||
package com.ruoyi.auth.exception;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
|
||||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
|
||||||
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
|
|
||||||
import com.ruoyi.common.core.constant.HttpStatus;
|
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
|
||||||
import com.ruoyi.common.core.web.domain.AjaxResult;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义异常返回
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
**/
|
|
||||||
public class CustomOauthExceptionSerializer extends StdSerializer<CustomOauthException>
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(CustomOauthExceptionSerializer.class);
|
|
||||||
|
|
||||||
public static final String BAD_CREDENTIALS = "Bad credentials";
|
|
||||||
|
|
||||||
public CustomOauthExceptionSerializer()
|
|
||||||
{
|
|
||||||
super(CustomOauthException.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void serialize(CustomOauthException e, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
|
|
||||||
throws IOException
|
|
||||||
{
|
|
||||||
jsonGenerator.writeStartObject();
|
|
||||||
jsonGenerator.writeNumberField(AjaxResult.CODE_TAG, HttpStatus.ERROR);
|
|
||||||
if (StringUtils.equals(e.getMessage(), BAD_CREDENTIALS))
|
|
||||||
{
|
|
||||||
jsonGenerator.writeStringField(AjaxResult.MSG_TAG, "用户名或密码错误");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
log.warn("oauth2 认证异常 {} ", e);
|
|
||||||
jsonGenerator.writeStringField(AjaxResult.MSG_TAG, e.getMessage());
|
|
||||||
}
|
|
||||||
jsonGenerator.writeEndObject();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
package com.ruoyi.auth.exception;
|
|
||||||
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;
|
|
||||||
import org.springframework.security.oauth2.provider.error.WebResponseExceptionTranslator;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OAuth2 自定义异常处理
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
public class CustomWebResponseExceptionTranslator implements WebResponseExceptionTranslator<OAuth2Exception>
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public ResponseEntity<OAuth2Exception> translate(Exception e)
|
|
||||||
{
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new CustomOauthException(e.getMessage()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.ruoyi.auth.form;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户登录对象
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class LoginBody
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 用户名
|
||||||
|
*/
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户密码
|
||||||
|
*/
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
public String getUsername()
|
||||||
|
{
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username)
|
||||||
|
{
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword()
|
||||||
|
{
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password)
|
||||||
|
{
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.ruoyi.auth.form;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户注册对象
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class RegisterBody extends LoginBody
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
package com.ruoyi.auth.handler;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.context.ApplicationListener;
|
|
||||||
import org.springframework.security.authentication.event.AuthenticationSuccessEvent;
|
|
||||||
import org.springframework.security.core.Authentication;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import com.ruoyi.common.core.constant.Constants;
|
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
|
||||||
import com.ruoyi.common.security.domain.LoginUser;
|
|
||||||
import com.ruoyi.system.api.RemoteLogService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 认证成功处理
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class AuthenticationSuccessEventHandler implements ApplicationListener<AuthenticationSuccessEvent>
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private RemoteLogService remoteLogService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onApplicationEvent(AuthenticationSuccessEvent event)
|
|
||||||
{
|
|
||||||
Authentication authentication = (Authentication) event.getSource();
|
|
||||||
if (StringUtils.isNotEmpty(authentication.getAuthorities())
|
|
||||||
&& authentication.getPrincipal() instanceof LoginUser)
|
|
||||||
{
|
|
||||||
LoginUser user = (LoginUser) authentication.getPrincipal();
|
|
||||||
|
|
||||||
String username = user.getUsername();
|
|
||||||
|
|
||||||
// 记录用户登录日志
|
|
||||||
remoteLogService.saveLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,143 @@
|
||||||
|
package com.ruoyi.auth.service;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import com.ruoyi.common.core.constant.CacheConstants;
|
||||||
|
import com.ruoyi.common.core.constant.Constants;
|
||||||
|
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||||
|
import com.ruoyi.common.core.constant.UserConstants;
|
||||||
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.enums.UserStatus;
|
||||||
|
import com.ruoyi.common.core.exception.ServiceException;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.utils.ip.IpUtils;
|
||||||
|
import com.ruoyi.common.redis.service.RedisService;
|
||||||
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.system.api.RemoteUserService;
|
||||||
|
import com.ruoyi.system.api.domain.SysUser;
|
||||||
|
import com.ruoyi.system.api.model.LoginUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录校验方法
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class SysLoginService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private RemoteUserService remoteUserService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysPasswordService passwordService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysRecordLogService recordLogService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisService redisService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录
|
||||||
|
*/
|
||||||
|
public LoginUser login(String username, String password)
|
||||||
|
{
|
||||||
|
// 用户名或密码为空 错误
|
||||||
|
if (StringUtils.isAnyBlank(username, password))
|
||||||
|
{
|
||||||
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户/密码必须填写");
|
||||||
|
throw new ServiceException("用户/密码必须填写");
|
||||||
|
}
|
||||||
|
// 密码如果不在指定范围内 错误
|
||||||
|
if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||||
|
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH)
|
||||||
|
{
|
||||||
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户密码不在指定范围");
|
||||||
|
throw new ServiceException("用户密码不在指定范围");
|
||||||
|
}
|
||||||
|
// 用户名不在指定范围内 错误
|
||||||
|
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||||
|
|| username.length() > UserConstants.USERNAME_MAX_LENGTH)
|
||||||
|
{
|
||||||
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户名不在指定范围");
|
||||||
|
throw new ServiceException("用户名不在指定范围");
|
||||||
|
}
|
||||||
|
// IP黑名单校验
|
||||||
|
String blackStr = Convert.toStr(redisService.getCacheObject(CacheConstants.SYS_LOGIN_BLACKIPLIST));
|
||||||
|
if (IpUtils.isMatchedIp(blackStr, IpUtils.getIpAddr()))
|
||||||
|
{
|
||||||
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "很遗憾,访问IP已被列入系统黑名单");
|
||||||
|
throw new ServiceException("很遗憾,访问IP已被列入系统黑名单");
|
||||||
|
}
|
||||||
|
// 查询用户信息
|
||||||
|
R<LoginUser> userResult = remoteUserService.getUserInfo(username, SecurityConstants.INNER);
|
||||||
|
|
||||||
|
if (StringUtils.isNull(userResult) || StringUtils.isNull(userResult.getData()))
|
||||||
|
{
|
||||||
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "登录用户不存在");
|
||||||
|
throw new ServiceException("登录用户:" + username + " 不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (R.FAIL == userResult.getCode())
|
||||||
|
{
|
||||||
|
throw new ServiceException(userResult.getMsg());
|
||||||
|
}
|
||||||
|
|
||||||
|
LoginUser userInfo = userResult.getData();
|
||||||
|
SysUser user = userResult.getData().getSysUser();
|
||||||
|
if (UserStatus.DELETED.getCode().equals(user.getDelFlag()))
|
||||||
|
{
|
||||||
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对不起,您的账号已被删除");
|
||||||
|
throw new ServiceException("对不起,您的账号:" + username + " 已被删除");
|
||||||
|
}
|
||||||
|
if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
|
||||||
|
{
|
||||||
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户已停用,请联系管理员");
|
||||||
|
throw new ServiceException("对不起,您的账号:" + username + " 已停用");
|
||||||
|
}
|
||||||
|
passwordService.validate(user, password);
|
||||||
|
recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功");
|
||||||
|
return userInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void logout(String loginName)
|
||||||
|
{
|
||||||
|
recordLogService.recordLogininfor(loginName, Constants.LOGOUT, "退出成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册
|
||||||
|
*/
|
||||||
|
public void register(String username, String password)
|
||||||
|
{
|
||||||
|
// 用户名或密码为空 错误
|
||||||
|
if (StringUtils.isAnyBlank(username, password))
|
||||||
|
{
|
||||||
|
throw new ServiceException("用户/密码必须填写");
|
||||||
|
}
|
||||||
|
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||||
|
|| username.length() > UserConstants.USERNAME_MAX_LENGTH)
|
||||||
|
{
|
||||||
|
throw new ServiceException("账户长度必须在2到20个字符之间");
|
||||||
|
}
|
||||||
|
if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||||
|
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH)
|
||||||
|
{
|
||||||
|
throw new ServiceException("密码长度必须在5到20个字符之间");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 注册用户信息
|
||||||
|
SysUser sysUser = new SysUser();
|
||||||
|
sysUser.setUserName(username);
|
||||||
|
sysUser.setNickName(username);
|
||||||
|
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
||||||
|
R<?> registerResult = remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
|
||||||
|
|
||||||
|
if (R.FAIL == registerResult.getCode())
|
||||||
|
{
|
||||||
|
throw new ServiceException(registerResult.getMsg());
|
||||||
|
}
|
||||||
|
recordLogService.recordLogininfor(username, Constants.REGISTER, "注册成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
package com.ruoyi.auth.service;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import com.ruoyi.common.core.constant.CacheConstants;
|
||||||
|
import com.ruoyi.common.core.constant.Constants;
|
||||||
|
import com.ruoyi.common.core.exception.ServiceException;
|
||||||
|
import com.ruoyi.common.redis.service.RedisService;
|
||||||
|
import com.ruoyi.common.security.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.system.api.domain.SysUser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录密码方法
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class SysPasswordService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private RedisService redisService;
|
||||||
|
|
||||||
|
private int maxRetryCount = CacheConstants.PASSWORD_MAX_RETRY_COUNT;
|
||||||
|
|
||||||
|
private Long lockTime = CacheConstants.PASSWORD_LOCK_TIME;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysRecordLogService recordLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录账户密码错误次数缓存键名
|
||||||
|
*
|
||||||
|
* @param username 用户名
|
||||||
|
* @return 缓存键key
|
||||||
|
*/
|
||||||
|
private String getCacheKey(String username)
|
||||||
|
{
|
||||||
|
return CacheConstants.PWD_ERR_CNT_KEY + username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void validate(SysUser user, String password)
|
||||||
|
{
|
||||||
|
String username = user.getUserName();
|
||||||
|
|
||||||
|
Integer retryCount = redisService.getCacheObject(getCacheKey(username));
|
||||||
|
|
||||||
|
if (retryCount == null)
|
||||||
|
{
|
||||||
|
retryCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (retryCount >= Integer.valueOf(maxRetryCount).intValue())
|
||||||
|
{
|
||||||
|
String errMsg = String.format("密码输入错误%s次,帐户锁定%s分钟", maxRetryCount, lockTime);
|
||||||
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL,errMsg);
|
||||||
|
throw new ServiceException(errMsg);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!matches(user, password))
|
||||||
|
{
|
||||||
|
retryCount = retryCount + 1;
|
||||||
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, String.format("密码输入错误%s次", retryCount));
|
||||||
|
redisService.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES);
|
||||||
|
throw new ServiceException("用户不存在/密码错误");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
clearLoginRecordCache(username);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean matches(SysUser user, String rawPassword)
|
||||||
|
{
|
||||||
|
return SecurityUtils.matchesPassword(rawPassword, user.getPassword());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearLoginRecordCache(String loginName)
|
||||||
|
{
|
||||||
|
if (redisService.hasKey(getCacheKey(loginName)))
|
||||||
|
{
|
||||||
|
redisService.deleteObject(getCacheKey(loginName));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.ruoyi.auth.service;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import com.ruoyi.common.core.constant.Constants;
|
||||||
|
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||||
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.core.utils.ip.IpUtils;
|
||||||
|
import com.ruoyi.system.api.RemoteLogService;
|
||||||
|
import com.ruoyi.system.api.domain.SysLogininfor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录日志方法
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class SysRecordLogService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private RemoteLogService remoteLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 记录登录信息
|
||||||
|
*
|
||||||
|
* @param username 用户名
|
||||||
|
* @param status 状态
|
||||||
|
* @param message 消息内容
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public void recordLogininfor(String username, String status, String message)
|
||||||
|
{
|
||||||
|
SysLogininfor logininfor = new SysLogininfor();
|
||||||
|
logininfor.setUserName(username);
|
||||||
|
logininfor.setIpaddr(IpUtils.getIpAddr());
|
||||||
|
logininfor.setMsg(message);
|
||||||
|
// 日志状态
|
||||||
|
if (StringUtils.equalsAny(status, Constants.LOGIN_SUCCESS, Constants.LOGOUT, Constants.REGISTER))
|
||||||
|
{
|
||||||
|
logininfor.setStatus(Constants.LOGIN_SUCCESS_STATUS);
|
||||||
|
}
|
||||||
|
else if (Constants.LOGIN_FAIL.equals(status))
|
||||||
|
{
|
||||||
|
logininfor.setStatus(Constants.LOGIN_FAIL_STATUS);
|
||||||
|
}
|
||||||
|
remoteLogService.saveLogininfor(logininfor, SecurityConstants.INNER);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -21,4 +21,5 @@ spring:
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
shared-dataids: application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/ruoyi-auth" />
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统日志输出 -->
|
||||||
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/info.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.ruoyi" level="info" />
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn" />
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info" />
|
||||||
|
<appender-ref ref="file_error" />
|
||||||
|
</root>
|
||||||
|
</configuration>
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi</artifactId>
|
<artifactId>ruoyi</artifactId>
|
||||||
<version>2.1.0</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|
@ -12,16 +12,18 @@
|
||||||
<module>ruoyi-common-log</module>
|
<module>ruoyi-common-log</module>
|
||||||
<module>ruoyi-common-core</module>
|
<module>ruoyi-common-core</module>
|
||||||
<module>ruoyi-common-redis</module>
|
<module>ruoyi-common-redis</module>
|
||||||
|
<module>ruoyi-common-seata</module>
|
||||||
<module>ruoyi-common-swagger</module>
|
<module>ruoyi-common-swagger</module>
|
||||||
<module>ruoyi-common-security</module>
|
<module>ruoyi-common-security</module>
|
||||||
<module>ruoyi-common-datascope</module>
|
<module>ruoyi-common-datascope</module>
|
||||||
|
<module>ruoyi-common-datasource</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
ruoyi-common通用模块
|
ruoyi-common通用模块
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.ruoyi</groupId>
|
<groupId>com.ruoyi</groupId>
|
||||||
<artifactId>ruoyi-common</artifactId>
|
<artifactId>ruoyi-common</artifactId>
|
||||||
<version>2.1.0</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|
@ -16,91 +16,103 @@
|
||||||
</description>
|
</description>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- SpringCloud Openfeign -->
|
<!-- SpringCloud Openfeign -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.cloud</groupId>
|
<groupId>org.springframework.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Spring Context Support -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-context-support</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Spring Web -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework</groupId>
|
|
||||||
<artifactId>spring-web</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Apache Commons Pool2 -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.commons</groupId>
|
|
||||||
<artifactId>commons-pool2</artifactId>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Loadbalancer -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Spring Context Support -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context-support</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Spring Web -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Transmittable ThreadLocal -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>transmittable-thread-local</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Pagehelper -->
|
<!-- Pagehelper -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.pagehelper</groupId>
|
<groupId>com.github.pagehelper</groupId>
|
||||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Java Validation -->
|
<!-- Hibernate Validator -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.validation</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>validation-api</artifactId>
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Jackson -->
|
<!-- Jackson -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Alibaba Fastjson -->
|
<!-- Alibaba Fastjson -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba.fastjson2</groupId>
|
||||||
<artifactId>fastjson</artifactId>
|
<artifactId>fastjson2</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Jwt -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Jaxb -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.xml.bind</groupId>
|
||||||
|
<artifactId>jaxb-api</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Apache Lang3 -->
|
<!-- Apache Lang3 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.commons</groupId>
|
<groupId>org.apache.commons</groupId>
|
||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Commons Io -->
|
<!-- Commons Io -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-io</groupId>
|
<groupId>commons-io</groupId>
|
||||||
<artifactId>commons-io</artifactId>
|
<artifactId>commons-io</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Commons Fileupload -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-fileupload</groupId>
|
|
||||||
<artifactId>commons-fileupload</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- excel工具 -->
|
<!-- excel工具 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi-ooxml</artifactId>
|
<artifactId>poi-ooxml</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Java Servlet -->
|
<!-- Java Servlet -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>javax.servlet</groupId>
|
||||||
<artifactId>javax.servlet-api</artifactId>
|
<artifactId>javax.servlet-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Swagger -->
|
<!-- Swagger -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.swagger</groupId>
|
<groupId>io.swagger</groupId>
|
||||||
<artifactId>swagger-annotations</artifactId>
|
<artifactId>swagger-annotations</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,10 @@ import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.lang.annotation.Target;
|
import java.lang.annotation.Target;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||||
|
import org.apache.poi.ss.usermodel.IndexedColors;
|
||||||
|
import com.ruoyi.common.core.utils.poi.ExcelHandlerAdapter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 自定义导出Excel数据注解
|
* 自定义导出Excel数据注解
|
||||||
|
|
@ -40,17 +44,22 @@ public @interface Excel
|
||||||
public String separator() default ",";
|
public String separator() default ",";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出类型(0数字 1字符串)
|
* BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
|
||||||
*/
|
*/
|
||||||
public ColumnType cellType() default ColumnType.STRING;
|
public int scale() default -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出时在excel中每个列的高度 单位为字符
|
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
|
||||||
|
*/
|
||||||
|
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出时在excel中每个列的高度
|
||||||
*/
|
*/
|
||||||
public double height() default 14;
|
public double height() default 14;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出时在excel中每个列的宽 单位为字符
|
* 导出时在excel中每个列的宽度
|
||||||
*/
|
*/
|
||||||
public double width() default 16;
|
public double width() default 16;
|
||||||
|
|
||||||
|
|
@ -74,6 +83,11 @@ public @interface Excel
|
||||||
*/
|
*/
|
||||||
public String[] combo() default {};
|
public String[] combo() default {};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否需要纵向合并单元格,应对需求:含有list集合单元格)
|
||||||
|
*/
|
||||||
|
public boolean needMerge() default false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
|
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
|
||||||
*/
|
*/
|
||||||
|
|
@ -84,6 +98,51 @@ public @interface Excel
|
||||||
*/
|
*/
|
||||||
public String targetAttr() default "";
|
public String targetAttr() default "";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否自动统计数据,在最后追加一行统计数据总和
|
||||||
|
*/
|
||||||
|
public boolean isStatistics() default false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出类型(0数字 1字符串)
|
||||||
|
*/
|
||||||
|
public ColumnType cellType() default ColumnType.STRING;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出列头背景颜色
|
||||||
|
*/
|
||||||
|
public IndexedColors headerBackgroundColor() default IndexedColors.GREY_50_PERCENT;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出列头字体颜色
|
||||||
|
*/
|
||||||
|
public IndexedColors headerColor() default IndexedColors.WHITE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出单元格背景颜色
|
||||||
|
*/
|
||||||
|
public IndexedColors backgroundColor() default IndexedColors.WHITE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出单元格字体颜色
|
||||||
|
*/
|
||||||
|
public IndexedColors color() default IndexedColors.BLACK;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出字段对齐方式
|
||||||
|
*/
|
||||||
|
public HorizontalAlignment align() default HorizontalAlignment.CENTER;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义数据处理器
|
||||||
|
*/
|
||||||
|
public Class<?> handler() default ExcelHandlerAdapter.class;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义数据处理器参数
|
||||||
|
*/
|
||||||
|
public String[] args() default {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 字段类型(0:导出导入;1:仅导出;2:仅导入)
|
* 字段类型(0:导出导入;1:仅导出;2:仅导入)
|
||||||
*/
|
*/
|
||||||
|
|
@ -107,7 +166,7 @@ public @interface Excel
|
||||||
|
|
||||||
public enum ColumnType
|
public enum ColumnType
|
||||||
{
|
{
|
||||||
NUMERIC(0), STRING(1);
|
NUMERIC(0), STRING(1), IMAGE(2);
|
||||||
private final int value;
|
private final int value;
|
||||||
|
|
||||||
ColumnType(int value)
|
ColumnType(int value)
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,59 @@
|
||||||
package com.ruoyi.common.core.constant;
|
package com.ruoyi.common.core.constant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 缓存的key 常量
|
* 缓存常量信息
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class CacheConstants
|
public class CacheConstants
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* oauth 缓存前缀
|
* 缓存有效期,默认720(分钟)
|
||||||
*/
|
*/
|
||||||
public static final String OAUTH_ACCESS = "oauth:access:";
|
public final static long EXPIRATION = 720;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* oauth 客户端信息
|
* 缓存刷新时间,默认120(分钟)
|
||||||
*/
|
*/
|
||||||
public static final String CLIENT_DETAILS_KEY = "oauth:client:details";
|
public final static long REFRESH_TIME = 120;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码最大错误次数
|
||||||
|
*/
|
||||||
|
public final static int PASSWORD_MAX_RETRY_COUNT = 5;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码锁定时间,默认10(分钟)
|
||||||
|
*/
|
||||||
|
public final static long PASSWORD_LOCK_TIME = 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限缓存前缀
|
||||||
|
*/
|
||||||
|
public final static String LOGIN_TOKEN_KEY = "login_tokens:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 验证码 redis key
|
||||||
|
*/
|
||||||
|
public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参数管理 cache key
|
||||||
|
*/
|
||||||
|
public static final String SYS_CONFIG_KEY = "sys_config:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典管理 cache key
|
||||||
|
*/
|
||||||
|
public static final String SYS_DICT_KEY = "sys_dict:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录账户密码错误次数 redis key
|
||||||
|
*/
|
||||||
|
public static final String PWD_ERR_CNT_KEY = "pwd_err_cnt:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录IP黑名单 cache key
|
||||||
|
*/
|
||||||
|
public static final String SYS_LOGIN_BLACKIPLIST = SYS_CONFIG_KEY + "sys.login.blackIPList";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,26 @@ public class Constants
|
||||||
*/
|
*/
|
||||||
public static final String GBK = "GBK";
|
public static final String GBK = "GBK";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* www主域
|
||||||
|
*/
|
||||||
|
public static final String WWW = "www.";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* RMI 远程方法调用
|
||||||
|
*/
|
||||||
|
public static final String LOOKUP_RMI = "rmi:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LDAP 远程方法调用
|
||||||
|
*/
|
||||||
|
public static final String LOOKUP_LDAP = "ldap:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* LDAPS 远程方法调用
|
||||||
|
*/
|
||||||
|
public static final String LOOKUP_LDAPS = "ldaps:";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* http请求
|
* http请求
|
||||||
*/
|
*/
|
||||||
|
|
@ -37,6 +57,16 @@ public class Constants
|
||||||
*/
|
*/
|
||||||
public static final Integer FAIL = 500;
|
public static final Integer FAIL = 500;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录成功状态
|
||||||
|
*/
|
||||||
|
public static final String LOGIN_SUCCESS_STATUS = "0";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录失败状态
|
||||||
|
*/
|
||||||
|
public static final String LOGIN_FAIL_STATUS = "1";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录成功
|
* 登录成功
|
||||||
*/
|
*/
|
||||||
|
|
@ -77,28 +107,29 @@ public class Constants
|
||||||
*/
|
*/
|
||||||
public static final String IS_ASC = "isAsc";
|
public static final String IS_ASC = "isAsc";
|
||||||
|
|
||||||
/**
|
|
||||||
* 验证码 redis key
|
|
||||||
*/
|
|
||||||
public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码有效期(分钟)
|
* 验证码有效期(分钟)
|
||||||
*/
|
*/
|
||||||
public static final Integer CAPTCHA_EXPIRATION = 2;
|
public static final long CAPTCHA_EXPIRATION = 2;
|
||||||
|
|
||||||
/**
|
|
||||||
* 参数管理 cache key
|
|
||||||
*/
|
|
||||||
public static final String SYS_CONFIG_KEY = "sys_config:";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 字典管理 cache key
|
|
||||||
*/
|
|
||||||
public static final String SYS_DICT_KEY = "sys_dict:";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资源映射路径 前缀
|
* 资源映射路径 前缀
|
||||||
*/
|
*/
|
||||||
public static final String RESOURCE_PREFIX = "/profile";
|
public static final String RESOURCE_PREFIX = "/profile";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全)
|
||||||
|
*/
|
||||||
|
public static final String[] JSON_WHITELIST_STR = { "org.springframework", "com.ruoyi" };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
|
||||||
|
*/
|
||||||
|
public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定时任务违规的字符
|
||||||
|
*/
|
||||||
|
public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
|
||||||
|
"org.springframework", "org.apache", "com.ruoyi.common.core.utils.file" };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,9 @@ public class GenConstants
|
||||||
/** 树表(增删改查) */
|
/** 树表(增删改查) */
|
||||||
public static final String TPL_TREE = "tree";
|
public static final String TPL_TREE = "tree";
|
||||||
|
|
||||||
|
/** 主子表(增删改查) */
|
||||||
|
public static final String TPL_SUB = "sub";
|
||||||
|
|
||||||
/** 树编码字段 */
|
/** 树编码字段 */
|
||||||
public static final String TREE_CODE = "treeCode";
|
public static final String TREE_CODE = "treeCode";
|
||||||
|
|
||||||
|
|
@ -29,15 +32,17 @@ public class GenConstants
|
||||||
public static final String PARENT_MENU_NAME = "parentMenuName";
|
public static final String PARENT_MENU_NAME = "parentMenuName";
|
||||||
|
|
||||||
/** 数据库字符串类型 */
|
/** 数据库字符串类型 */
|
||||||
public static final String[] COLUMNTYPE_STR = { "char", "varchar", "narchar", "varchar2", "tinytext", "text",
|
public static final String[] COLUMNTYPE_STR = { "char", "varchar", "nvarchar", "varchar2" };
|
||||||
"mediumtext", "longtext" };
|
|
||||||
|
/** 数据库文本类型 */
|
||||||
|
public static final String[] COLUMNTYPE_TEXT = { "tinytext", "text", "mediumtext", "longtext" };
|
||||||
|
|
||||||
/** 数据库时间类型 */
|
/** 数据库时间类型 */
|
||||||
public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" };
|
public static final String[] COLUMNTYPE_TIME = { "datetime", "time", "date", "timestamp" };
|
||||||
|
|
||||||
/** 数据库数字类型 */
|
/** 数据库数字类型 */
|
||||||
public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer",
|
public static final String[] COLUMNTYPE_NUMBER = { "tinyint", "smallint", "mediumint", "int", "number", "integer",
|
||||||
"bigint", "float", "float", "double", "decimal" };
|
"bigint", "float", "double", "decimal" };
|
||||||
|
|
||||||
/** 页面不需要编辑字段 */
|
/** 页面不需要编辑字段 */
|
||||||
public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" };
|
public static final String[] COLUMNNAME_NOT_EDIT = { "id", "create_by", "create_time", "del_flag" };
|
||||||
|
|
@ -74,6 +79,15 @@ public class GenConstants
|
||||||
/** 日期控件 */
|
/** 日期控件 */
|
||||||
public static final String HTML_DATETIME = "datetime";
|
public static final String HTML_DATETIME = "datetime";
|
||||||
|
|
||||||
|
/** 图片上传控件 */
|
||||||
|
public static final String HTML_IMAGE_UPLOAD = "imageUpload";
|
||||||
|
|
||||||
|
/** 文件上传控件 */
|
||||||
|
public static final String HTML_FILE_UPLOAD = "fileUpload";
|
||||||
|
|
||||||
|
/** 富文本控件 */
|
||||||
|
public static final String HTML_EDITOR = "editor";
|
||||||
|
|
||||||
/** 字符串类型 */
|
/** 字符串类型 */
|
||||||
public static final String TYPE_STRING = "String";
|
public static final String TYPE_STRING = "String";
|
||||||
|
|
||||||
|
|
@ -95,6 +109,9 @@ public class GenConstants
|
||||||
/** 模糊查询 */
|
/** 模糊查询 */
|
||||||
public static final String QUERY_LIKE = "LIKE";
|
public static final String QUERY_LIKE = "LIKE";
|
||||||
|
|
||||||
|
/** 相等查询 */
|
||||||
|
public static final String QUERY_EQ = "EQ";
|
||||||
|
|
||||||
/** 需要 */
|
/** 需要 */
|
||||||
public static final String REQUIRE = "1";
|
public static final String REQUIRE = "1";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,4 +86,9 @@ public class HttpStatus
|
||||||
* 接口未实现
|
* 接口未实现
|
||||||
*/
|
*/
|
||||||
public static final int NOT_IMPLEMENTED = 501;
|
public static final int NOT_IMPLEMENTED = 501;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统警告消息
|
||||||
|
*/
|
||||||
|
public static final int WARN = 601;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,21 +7,6 @@ package com.ruoyi.common.core.constant;
|
||||||
*/
|
*/
|
||||||
public class SecurityConstants
|
public class SecurityConstants
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* 令牌类型
|
|
||||||
*/
|
|
||||||
public static final String BEARER_TOKEN_TYPE = "Bearer";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 授权token url
|
|
||||||
*/
|
|
||||||
public static final String AUTH_TOKEN = "/oauth/token";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 注销token url
|
|
||||||
*/
|
|
||||||
public static final String TOKEN_LOGOUT = "/token/logout";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户ID字段
|
* 用户ID字段
|
||||||
*/
|
*/
|
||||||
|
|
@ -33,24 +18,32 @@ public class SecurityConstants
|
||||||
public static final String DETAILS_USERNAME = "username";
|
public static final String DETAILS_USERNAME = "username";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sys_oauth_client_details 表的字段,不包括client_id、client_secret
|
* 授权信息字段
|
||||||
*/
|
*/
|
||||||
public static final String CLIENT_FIELDS = "client_id, client_secret, resource_ids, scope, "
|
public static final String AUTHORIZATION_HEADER = "authorization";
|
||||||
+ "authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, "
|
|
||||||
+ "refresh_token_validity, additional_information, autoapprove";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JdbcClientDetailsService 查询语句
|
* 请求来源
|
||||||
*/
|
*/
|
||||||
public static final String BASE_FIND_STATEMENT = "select " + CLIENT_FIELDS + " from sys_oauth_client_details";
|
public static final String FROM_SOURCE = "from-source";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 按条件client_id 查询
|
* 内部请求
|
||||||
*/
|
*/
|
||||||
public static final String DEFAULT_SELECT_STATEMENT = BASE_FIND_STATEMENT + " where client_id = ?";
|
public static final String INNER = "inner";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认的查询语句
|
* 用户标识
|
||||||
*/
|
*/
|
||||||
public static final String DEFAULT_FIND_STATEMENT = BASE_FIND_STATEMENT + " order by client_id";
|
public static final String USER_KEY = "user_key";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录用户
|
||||||
|
*/
|
||||||
|
public static final String LOGIN_USER = "login_user";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 角色权限
|
||||||
|
*/
|
||||||
|
public static final String ROLE_PERMISSION = "role_permission";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,4 +16,9 @@ public class ServiceNameConstants
|
||||||
* 系统模块的serviceid
|
* 系统模块的serviceid
|
||||||
*/
|
*/
|
||||||
public static final String SYSTEM_SERVICE = "ruoyi-system";
|
public static final String SYSTEM_SERVICE = "ruoyi-system";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件服务的serviceid
|
||||||
|
*/
|
||||||
|
public static final String FILE_SERVICE = "ruoyi-file";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.ruoyi.common.core.constant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Token的Key常量
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class TokenConstants
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 令牌自定义标识
|
||||||
|
*/
|
||||||
|
public static final String AUTHENTICATION = "Authorization";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 令牌前缀
|
||||||
|
*/
|
||||||
|
public static final String PREFIX = "Bearer ";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 令牌秘钥
|
||||||
|
*/
|
||||||
|
public final static String SECRET = "abcdefghijklmnopqrstuvwxyz";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -54,7 +54,27 @@ public class UserConstants
|
||||||
/** Layout组件标识 */
|
/** Layout组件标识 */
|
||||||
public final static String LAYOUT = "Layout";
|
public final static String LAYOUT = "Layout";
|
||||||
|
|
||||||
/** 校验返回结果码 */
|
/** ParentView组件标识 */
|
||||||
public final static String UNIQUE = "0";
|
public final static String PARENT_VIEW = "ParentView";
|
||||||
public final static String NOT_UNIQUE = "1";
|
|
||||||
|
/** InnerLink组件标识 */
|
||||||
|
public final static String INNER_LINK = "InnerLink";
|
||||||
|
|
||||||
|
/** 校验是否唯一的返回标识 */
|
||||||
|
public final static boolean UNIQUE = true;
|
||||||
|
public final static boolean NOT_UNIQUE = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名长度限制
|
||||||
|
*/
|
||||||
|
public static final int USERNAME_MIN_LENGTH = 2;
|
||||||
|
|
||||||
|
public static final int USERNAME_MAX_LENGTH = 20;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 密码长度限制
|
||||||
|
*/
|
||||||
|
public static final int PASSWORD_MIN_LENGTH = 5;
|
||||||
|
|
||||||
|
public static final int PASSWORD_MAX_LENGTH = 20;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,98 @@
|
||||||
|
package com.ruoyi.common.core.context;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import com.alibaba.ttl.TransmittableThreadLocal;
|
||||||
|
import com.ruoyi.common.core.constant.SecurityConstants;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前线程变量中的 用户id、用户名称、Token等信息
|
||||||
|
* 注意: 必须在网关通过请求头的方法传入,同时在HeaderInterceptor拦截器设置值。 否则这里无法获取
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class SecurityContextHolder
|
||||||
|
{
|
||||||
|
private static final TransmittableThreadLocal<Map<String, Object>> THREAD_LOCAL = new TransmittableThreadLocal<>();
|
||||||
|
|
||||||
|
public static void set(String key, Object value)
|
||||||
|
{
|
||||||
|
Map<String, Object> map = getLocalMap();
|
||||||
|
map.put(key, value == null ? StringUtils.EMPTY : value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String get(String key)
|
||||||
|
{
|
||||||
|
Map<String, Object> map = getLocalMap();
|
||||||
|
return Convert.toStr(map.getOrDefault(key, StringUtils.EMPTY));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> T get(String key, Class<T> clazz)
|
||||||
|
{
|
||||||
|
Map<String, Object> map = getLocalMap();
|
||||||
|
return StringUtils.cast(map.getOrDefault(key, null));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String, Object> getLocalMap()
|
||||||
|
{
|
||||||
|
Map<String, Object> map = THREAD_LOCAL.get();
|
||||||
|
if (map == null)
|
||||||
|
{
|
||||||
|
map = new ConcurrentHashMap<String, Object>();
|
||||||
|
THREAD_LOCAL.set(map);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setLocalMap(Map<String, Object> threadLocalMap)
|
||||||
|
{
|
||||||
|
THREAD_LOCAL.set(threadLocalMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Long getUserId()
|
||||||
|
{
|
||||||
|
return Convert.toLong(get(SecurityConstants.DETAILS_USER_ID), 0L);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setUserId(String account)
|
||||||
|
{
|
||||||
|
set(SecurityConstants.DETAILS_USER_ID, account);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getUserName()
|
||||||
|
{
|
||||||
|
return get(SecurityConstants.DETAILS_USERNAME);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setUserName(String username)
|
||||||
|
{
|
||||||
|
set(SecurityConstants.DETAILS_USERNAME, username);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getUserKey()
|
||||||
|
{
|
||||||
|
return get(SecurityConstants.USER_KEY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setUserKey(String userKey)
|
||||||
|
{
|
||||||
|
set(SecurityConstants.USER_KEY, userKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getPermission()
|
||||||
|
{
|
||||||
|
return get(SecurityConstants.ROLE_PERMISSION);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setPermission(String permissions)
|
||||||
|
{
|
||||||
|
set(SecurityConstants.ROLE_PERMISSION, permissions);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void remove()
|
||||||
|
{
|
||||||
|
THREAD_LOCAL.remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -102,4 +102,14 @@ public class R<T> implements Serializable
|
||||||
{
|
{
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static <T> Boolean isError(R<T> ret)
|
||||||
|
{
|
||||||
|
return !isSuccess(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> Boolean isSuccess(R<T> ret)
|
||||||
|
{
|
||||||
|
return R.SUCCESS == ret.getCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
package com.ruoyi.common.core.exception;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自定义异常
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
public class CustomException extends RuntimeException
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
private Integer code;
|
|
||||||
|
|
||||||
private String message;
|
|
||||||
|
|
||||||
public CustomException(String message)
|
|
||||||
{
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CustomException(String message, Integer code)
|
|
||||||
{
|
|
||||||
this.message = message;
|
|
||||||
this.code = code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public CustomException(String message, Throwable e)
|
|
||||||
{
|
|
||||||
super(message, e);
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getMessage()
|
|
||||||
{
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getCode()
|
|
||||||
{
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.ruoyi.common.core.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 全局异常
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class GlobalException extends RuntimeException
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误提示
|
||||||
|
*/
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误明细,内部调试错误
|
||||||
|
*
|
||||||
|
* 和 {@link CommonResult#getDetailMessage()} 一致的设计
|
||||||
|
*/
|
||||||
|
private String detailMessage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 空构造方法,避免反序列化问题
|
||||||
|
*/
|
||||||
|
public GlobalException()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public GlobalException(String message)
|
||||||
|
{
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDetailMessage()
|
||||||
|
{
|
||||||
|
return detailMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GlobalException setDetailMessage(String detailMessage)
|
||||||
|
{
|
||||||
|
this.detailMessage = detailMessage;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getMessage()
|
||||||
|
{
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GlobalException setMessage(String message)
|
||||||
|
{
|
||||||
|
this.message = message;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.ruoyi.common.core.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内部认证异常
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class InnerAuthException extends RuntimeException
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public InnerAuthException(String message)
|
||||||
|
{
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
package com.ruoyi.common.core.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权限异常
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class PreAuthorizeException extends RuntimeException
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public PreAuthorizeException()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.ruoyi.common.core.exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务异常
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public final class ServiceException extends RuntimeException
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误码
|
||||||
|
*/
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误提示
|
||||||
|
*/
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误明细,内部调试错误
|
||||||
|
*
|
||||||
|
* 和 {@link CommonResult#getDetailMessage()} 一致的设计
|
||||||
|
*/
|
||||||
|
private String detailMessage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 空构造方法,避免反序列化问题
|
||||||
|
*/
|
||||||
|
public ServiceException()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public ServiceException(String message)
|
||||||
|
{
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ServiceException(String message, Integer code)
|
||||||
|
{
|
||||||
|
this.message = message;
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDetailMessage()
|
||||||
|
{
|
||||||
|
return detailMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getMessage()
|
||||||
|
{
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCode()
|
||||||
|
{
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ServiceException setMessage(String message)
|
||||||
|
{
|
||||||
|
this.message = message;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ServiceException setDetailMessage(String detailMessage)
|
||||||
|
{
|
||||||
|
this.detailMessage = detailMessage;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.ruoyi.common.core.exception.auth;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未能通过的登录认证异常
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class NotLoginException extends RuntimeException
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public NotLoginException(String message)
|
||||||
|
{
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.ruoyi.common.core.exception.auth;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未能通过的权限认证异常
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class NotPermissionException extends RuntimeException
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public NotPermissionException(String permission)
|
||||||
|
{
|
||||||
|
super(permission);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NotPermissionException(String[] permissions)
|
||||||
|
{
|
||||||
|
super(StringUtils.join(permissions, ","));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.ruoyi.common.core.exception.auth;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 未能通过的角色认证异常
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class NotRoleException extends RuntimeException
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public NotRoleException(String role)
|
||||||
|
{
|
||||||
|
super(role);
|
||||||
|
}
|
||||||
|
|
||||||
|
public NotRoleException(String[] roles)
|
||||||
|
{
|
||||||
|
super(StringUtils.join(roles, ","));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,79 +1,79 @@
|
||||||
package com.ruoyi.common.core.exception;
|
package com.ruoyi.common.core.exception.base;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 基础异常
|
* 基础异常
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author ruoyi
|
||||||
*/
|
*/
|
||||||
public class BaseException extends RuntimeException
|
public class BaseException extends RuntimeException
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 所属模块
|
* 所属模块
|
||||||
*/
|
*/
|
||||||
private String module;
|
private String module;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 错误码
|
* 错误码
|
||||||
*/
|
*/
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 错误码对应的参数
|
* 错误码对应的参数
|
||||||
*/
|
*/
|
||||||
private Object[] args;
|
private Object[] args;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 错误消息
|
* 错误消息
|
||||||
*/
|
*/
|
||||||
private String defaultMessage;
|
private String defaultMessage;
|
||||||
|
|
||||||
public BaseException(String module, String code, Object[] args, String defaultMessage)
|
public BaseException(String module, String code, Object[] args, String defaultMessage)
|
||||||
{
|
{
|
||||||
this.module = module;
|
this.module = module;
|
||||||
this.code = code;
|
this.code = code;
|
||||||
this.args = args;
|
this.args = args;
|
||||||
this.defaultMessage = defaultMessage;
|
this.defaultMessage = defaultMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseException(String module, String code, Object[] args)
|
public BaseException(String module, String code, Object[] args)
|
||||||
{
|
{
|
||||||
this(module, code, args, null);
|
this(module, code, args, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseException(String module, String defaultMessage)
|
public BaseException(String module, String defaultMessage)
|
||||||
{
|
{
|
||||||
this(module, null, null, defaultMessage);
|
this(module, null, null, defaultMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseException(String code, Object[] args)
|
public BaseException(String code, Object[] args)
|
||||||
{
|
{
|
||||||
this(null, code, args, null);
|
this(null, code, args, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseException(String defaultMessage)
|
public BaseException(String defaultMessage)
|
||||||
{
|
{
|
||||||
this(null, null, null, defaultMessage);
|
this(null, null, null, defaultMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getModule()
|
public String getModule()
|
||||||
{
|
{
|
||||||
return module;
|
return module;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCode()
|
public String getCode()
|
||||||
{
|
{
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object[] getArgs()
|
public Object[] getArgs()
|
||||||
{
|
{
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDefaultMessage()
|
public String getDefaultMessage()
|
||||||
{
|
{
|
||||||
return defaultMessage;
|
return defaultMessage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.ruoyi.common.core.exception.file;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.exception.base.BaseException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件信息异常类
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class FileException extends BaseException
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public FileException(String code, Object[] args, String msg)
|
||||||
|
{
|
||||||
|
super("file", code, args, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.ruoyi.common.core.exception.file;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名称超长限制异常类
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class FileNameLengthLimitExceededException extends FileException
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public FileNameLengthLimitExceededException(int defaultFileNameLength)
|
||||||
|
{
|
||||||
|
super("upload.filename.exceed.length", new Object[] { defaultFileNameLength }, "the filename is too long");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.ruoyi.common.core.exception.file;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件名大小限制异常类
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class FileSizeLimitExceededException extends FileException
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public FileSizeLimitExceededException(long defaultMaxSize)
|
||||||
|
{
|
||||||
|
super("upload.exceed.maxSize", new Object[] { defaultMaxSize }, "the filesize is too large");
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue