Compare commits
675 Commits
storage_cl
...
master
Author | SHA1 | Date |
---|---|---|
isummer | e12779d654 | 2 years ago |
isummer | ac590563a7 | 2 years ago |
isummer | 8fc1d353c9 | 2 years ago |
isummer | 35b64d74de | 2 years ago |
isummer | a064988f56 | 2 years ago |
isummer | adff361c11 | 2 years ago |
isummer | 419e39eaaa | 2 years ago |
isummer | 9d9cb3f2cb | 2 years ago |
isummer | dd802dccbb | 2 years ago |
isummer | 1262bff671 | 2 years ago |
isummer | 289737ed00 | 2 years ago |
isummer | dc7b491534 | 2 years ago |
isummer | eed0f5194c | 2 years ago |
isummer | e0599585be | 2 years ago |
isummer | 42451f2cb0 | 2 years ago |
isummer | 646162593e | 2 years ago |
isummer | 200494fcf3 | 2 years ago |
isummer | fe5a7605f0 | 2 years ago |
isummer | f70351d8e5 | 2 years ago |
isummer | 9e2f40383a | 2 years ago |
isummer | debe95791e | 2 years ago |
isummer | a3887825c9 | 2 years ago |
isummer | 8a8f9ef7fe | 2 years ago |
isummer | 8e325e6cde | 2 years ago |
isummer | 92961cfa61 | 2 years ago |
isummer | 8c25aab63c | 2 years ago |
isummer | 0cc5084390 | 2 years ago |
isummer | 4d98981485 | 2 years ago |
isummer | a7a1472533 | 2 years ago |
isummer | 332d12bddf | 2 years ago |
isummer | 6439824468 | 2 years ago |
isummer | 42478f21d9 | 2 years ago |
isummer | 2c67305f8a | 2 years ago |
isummer | 79037d5248 | 2 years ago |
isummer | 525ec097d7 | 2 years ago |
isummer | a35ca0b087 | 2 years ago |
isummer | d9ac93ccc1 | 2 years ago |
isummer | 1ff3da6896 | 2 years ago |
isummer | cbad06e95d | 2 years ago |
isummer | b093d7133b | 2 years ago |
isummer | 7aa0471ba9 | 2 years ago |
isummer | 2224ce27c7 | 2 years ago |
isummer | d8b124c1a7 | 2 years ago |
isummer | d1a5d69ac8 | 2 years ago |
isummer | 8a8d2f2400 | 2 years ago |
isummer | 49832ca702 | 2 years ago |
isummer | 7075bc7ed6 | 2 years ago |
MMXX | 7d70f381a1 | 2 years ago |
MMXX | 15a506450c | 2 years ago |
isummer | 93c13fa776 | 2 years ago |
MMXX | c8f02465d0 | 2 years ago |
isummer | 2e240735dc | 2 years ago |
I夏 | ec908f0dea | 3 years ago |
I夏 | 47abaf61f5 | 3 years ago |
I夏 | 31fe8664a9 | 3 years ago |
nineven | f4ca8d48f9 | 3 years ago |
nineven | e2b9b12613 | 3 years ago |
nineven | f772d65765 | 3 years ago |
nineven | 3ad5e03504 | 3 years ago |
nineven | 5f967a9b52 | 3 years ago |
nineven | e7858a840e | 3 years ago |
nineven | b191cbae6b | 3 years ago |
nineven | c36ab08f35 | 3 years ago |
nineven | a5b73c3695 | 3 years ago |
nineven | 0c6b61327a | 3 years ago |
nineven | 92c0345341 | 3 years ago |
nineven | 25c2ea4c7a | 3 years ago |
nineven | dfcf213bed | 3 years ago |
nineven | 2b29e0e3bd | 3 years ago |
nineven | a9bbdd40bd | 3 years ago |
nineven | 97349e758f | 3 years ago |
nineven | 156bf67c1c | 3 years ago |
nineven | 1d75c8ed23 | 3 years ago |
nineven | ef243feb9f | 3 years ago |
nineven | 58472fb9e4 | 3 years ago |
nineven | 6c25f6a932 | 3 years ago |
nineven | 2d21ee9150 | 3 years ago |
nineven | 04ba947219 | 3 years ago |
nineven | 884d6a47e8 | 3 years ago |
nineven | 0a64689902 | 3 years ago |
nineven | 5ca5b0eb34 | 3 years ago |
nineven | 3bbabdafdb | 3 years ago |
nineven | 4cd0dc7586 | 3 years ago |
nineven | 5eb947843e | 3 years ago |
nineven | 17ab6e6efd | 3 years ago |
nineven | 94bc5cc1db | 3 years ago |
nineven | 584f50ba20 | 3 years ago |
nineven | df38944eab | 3 years ago |
nineven | fe880b27b7 | 3 years ago |
nineven | 8316a52595 | 3 years ago |
nineven | 747d2b3dfa | 3 years ago |
nineven | 04ae8cccc4 | 3 years ago |
nineven | 3b8134aafd | 3 years ago |
nineven | bb9bdf8891 | 3 years ago |
nineven | bc0cee937d | 3 years ago |
nineven | d1a41a179b | 3 years ago |
nineven | 3ff322849a | 3 years ago |
nineven | 4184f2ad1c | 3 years ago |
nineven | 22a9b8d816 | 3 years ago |
nineven | 2390397f1b | 3 years ago |
nineven | ae9dfae6a3 | 3 years ago |
nineven | d7e3186f9d | 3 years ago |
nineven | 2bfd694f23 | 3 years ago |
nineven | 63e09c1925 | 3 years ago |
nineven | 391e4987de | 3 years ago |
nineven | 88745550d4 | 3 years ago |
nineven | 59e73fa83e | 3 years ago |
nineven | 5eca01278b | 3 years ago |
nineven | 5edf7cd65a | 3 years ago |
nineven | cf9d9eeaf8 | 3 years ago |
nineven | c4a4db2c7e | 3 years ago |
nineven | 24a8307164 | 3 years ago |
nineven | 05669b8d3e | 3 years ago |
nineven | 32c3058d57 | 3 years ago |
nineven | 4bbae93933 | 3 years ago |
nineven | f94184551a | 3 years ago |
nineven | dd73441bdd | 3 years ago |
nineven | 4e7927a332 | 3 years ago |
MMXX | fc1963c8a9 | 3 years ago |
MMXX | d15b583804 | 3 years ago |
MMXX | d930603919 | 3 years ago |
MMXX | 9b9be3fcf9 | 3 years ago |
MMXX | 378912944f | 3 years ago |
MMXX | 75c7d365a3 | 3 years ago |
MMXX | 1dec3b7de2 | 3 years ago |
MMXX | eeba5b409a | 3 years ago |
nineven | 684a407f97 | 3 years ago |
nineven | 5901d63f3e | 3 years ago |
MMXX | cf14dcb0a5 | 3 years ago |
MMXX | e780a2597e | 3 years ago |
MMXX | 02f908e3de | 3 years ago |
MMXX | 7ceb9c83c1 | 3 years ago |
MMXX | 77d97fd1d2 | 3 years ago |
nineven | 98fe1d5f61 | 3 years ago |
nineven | fb77c251c3 | 3 years ago |
nineven | c765658fb5 | 3 years ago |
nineven | dd1fb29ba0 | 3 years ago |
nineven | d571b399d7 | 3 years ago |
nineven | 115d1c95df | 3 years ago |
nineven | e54f6c1286 | 3 years ago |
nineven | 75fecbca10 | 3 years ago |
nineven | 96295132d9 | 3 years ago |
nineven | ec327598a2 | 3 years ago |
nineven | 81db86b9ef | 3 years ago |
nineven | 6076659bf1 | 3 years ago |
nineven | 4b90ce682b | 3 years ago |
nineven | f00135a6a4 | 3 years ago |
nineven | 8ce3b14475 | 3 years ago |
nineven | 25d09e8cf1 | 3 years ago |
nineven | c6e78a6eab | 3 years ago |
nineven | e9c6cadeb6 | 3 years ago |
nineven | 153f800b91 | 3 years ago |
nineven | 5e380fa09e | 3 years ago |
nineven | 42bab0739b | 3 years ago |
nineven | 518fc3101e | 3 years ago |
nineven | 875a3a4305 | 3 years ago |
nineven | 6051f443c1 | 3 years ago |
nineven | c4fd9aa793 | 3 years ago |
nineven | 9ba02e449d | 3 years ago |
nineven | cb841b5cf7 | 3 years ago |
nineven | 9353abc8a9 | 3 years ago |
nineven | 06bace9f66 | 3 years ago |
nineven | ce31dd5621 | 3 years ago |
nineven | 91e042ea1d | 3 years ago |
nineven | f02eb026de | 3 years ago |
nineven | 44cfd03cee | 3 years ago |
nineven | 14f60d4f8d | 3 years ago |
nineven | 614db12422 | 3 years ago |
nineven | 10ab90a104 | 3 years ago |
nineven | f5ffc3632f | 3 years ago |
nineven | adc71de160 | 3 years ago |
nineven | 6f959fa4a9 | 3 years ago |
nineven | 3d2ce3b73d | 3 years ago |
nineven | 192d4cadc0 | 3 years ago |
nineven | 9f2fea094d | 3 years ago |
nineven | 32bdc4ba9e | 3 years ago |
nineven | fdd0abb07e | 3 years ago |
nineven | a580dddd83 | 3 years ago |
nineven | 2f32b71b2b | 3 years ago |
MMXX | 03a6202ee2 | 3 years ago |
MMXX | 7e15211fd2 | 3 years ago |
MMXX | ae58a71ee4 | 3 years ago |
MMXX | b270d8e5c6 | 3 years ago |
MMXX | 32ca967d07 | 3 years ago |
MMXX | 878183dbce | 3 years ago |
MMXX | bebc8417eb | 3 years ago |
MMXX | de511bf90c | 3 years ago |
MMXX | a8c1df58ee | 3 years ago |
MMXX | ef335e118a | 3 years ago |
MMXX | 03f66df7b9 | 3 years ago |
MMXX | 4d4ee64a65 | 3 years ago |
MMXX | 04ccfe77a3 | 3 years ago |
MMXX | d085d86a26 | 3 years ago |
MMXX | 8a60be6f4f | 3 years ago |
MMXX | 869d5ee7bb | 3 years ago |
MMXX | 9572382a9e | 3 years ago |
MMXX | 7ad5bc8161 | 3 years ago |
MMXX | 59d7d905d3 | 3 years ago |
MMXX | c361d740bf | 3 years ago |
MMXX | 17c1f0612a | 3 years ago |
MMXX | 2b5325ff32 | 3 years ago |
MMXX | 09257733f8 | 3 years ago |
MMXX | 5dd1dd0681 | 3 years ago |
MMXX | 979b6f0386 | 3 years ago |
MMXX | e8e6ea962a | 3 years ago |
MMXX | c50005e7c7 | 3 years ago |
MMXX | 465aea9744 | 3 years ago |
MMXX | 7c2a29b86d | 3 years ago |
MMXX | f8418f6414 | 3 years ago |
youngS | def6c9dfc8 | 3 years ago |
youngS | 205505cb0e | 3 years ago |
youngS | 106ae636a2 | 3 years ago |
youngS | 2e96183c06 | 3 years ago |
youngS | 216bc367c4 | 3 years ago |
youngS | e559267de3 | 3 years ago |
youngS | f04c4411c7 | 3 years ago |
youngS | a60a7d6011 | 3 years ago |
youngS | d3fc7327a6 | 3 years ago |
youngS | 4decc14bf8 | 3 years ago |
nineven | d657c709f6 | 3 years ago |
nineven | 73d783b97d | 3 years ago |
nineven | b18dfa7a14 | 3 years ago |
youngS | 0d26e5ac7b | 3 years ago |
youngS | bda9cf994d | 3 years ago |
youngS | 9d0d36ca63 | 3 years ago |
youngS | 26e6efeaf4 | 3 years ago |
youngS | 49c35275b6 | 3 years ago |
youngS | 92ba4fc258 | 3 years ago |
youngS | c8a69acb84 | 3 years ago |
youngS | 7932dde3b4 | 3 years ago |
youngS | 55f5f65e15 | 3 years ago |
youngS | fd43dcfea4 | 3 years ago |
youngS | 4c41efa46f | 3 years ago |
youngS | d3e0c53b8f | 3 years ago |
youngS | bd77da66b7 | 3 years ago |
youngS | ebed9b1aa4 | 3 years ago |
youngS | 0c5c4a6ce7 | 3 years ago |
youngS | b3899d4a97 | 3 years ago |
youngS | 27b8a21556 | 3 years ago |
youngS | bbf9664fc7 | 3 years ago |
youngS | 86467ef2fd | 3 years ago |
youngS | 2aedb458ee | 3 years ago |
youngS | 2e491db16c | 3 years ago |
youngS | 8a59b8d329 | 3 years ago |
youngS | fce8a09d5e | 3 years ago |
fxC | 29328d293b | 3 years ago |
fxC | 2ec7fb05eb | 3 years ago |
youngS | 341cf21367 | 3 years ago |
youngS | 6412e36d0b | 3 years ago |
youngS | 8bf925e9df | 3 years ago |
youngS | d550d20998 | 3 years ago |
youngS | c170086609 | 3 years ago |
youngS | bd8c8d00cc | 3 years ago |
youngS | a2c5d1bd3f | 3 years ago |
youngS | 169347ca16 | 3 years ago |
youngS | 372455bcb3 | 3 years ago |
youngS | d943b5527d | 3 years ago |
youngS | 5316ed83c1 | 3 years ago |
youngS | c173262a0b | 3 years ago |
fxC | 5be7115e91 | 3 years ago |
youngS | f30aafb5d9 | 3 years ago |
fxC | 34971b792a | 3 years ago |
youngS | f49c067015 | 3 years ago |
youngS | 002c90d5e3 | 3 years ago |
youngS | 4c29d32d67 | 3 years ago |
youngS | 819c9a7017 | 3 years ago |
youngS | 479abff102 | 3 years ago |
youngS | 20ac8eadda | 3 years ago |
youngS | 1cc05645ec | 3 years ago |
youngS | 2ee4352544 | 3 years ago |
youngS | 7702fa5209 | 3 years ago |
youngS | 50da6044a4 | 3 years ago |
youngS | 7d781de388 | 3 years ago |
youngS | ab52639caf | 3 years ago |
youngS | 5232ba5fe6 | 3 years ago |
youngS | 47861511fc | 3 years ago |
fxC | 0a20226dd7 | 3 years ago |
fxC | cb4fc0b827 | 3 years ago |
youngS | 674bf66827 | 3 years ago |
fxC | abd2db398d | 3 years ago |
youngS | 9d3b5c582e | 3 years ago |
youngS | abbe709d27 | 3 years ago |
fxC | b3637c6844 | 3 years ago |
youngS | 9b7590146a | 3 years ago |
youngS | 7309eaf9b5 | 3 years ago |
youngS | edd603b8e9 | 3 years ago |
youngS | 9b69021337 | 3 years ago |
youngS | e7d4df5941 | 3 years ago |
youngS | b772d2921e | 3 years ago |
youngS | dd5d0ed0ed | 3 years ago |
youngS | dc2fa091cb | 3 years ago |
youngS | d34073301b | 3 years ago |
youngS | fac7eccc05 | 3 years ago |
youngS | 4533e04850 | 3 years ago |
youngS | 0e2578738f | 3 years ago |
youngS | 08c6b7b87f | 3 years ago |
youngS | 7c5ab20dd9 | 3 years ago |
youngS | 1a9cae8cb7 | 3 years ago |
youngS | e34ca43cfc | 3 years ago |
youngS | 75d5a5df76 | 3 years ago |
youngS | ac8614b54c | 3 years ago |
youngS | 1e1385da84 | 3 years ago |
youngS | 0bac3e55f4 | 3 years ago |
youngS | 820e1df84e | 3 years ago |
youngS | 08ffa72eab | 3 years ago |
youngS | 6861c65b83 | 3 years ago |
youngS | 439db9788a | 3 years ago |
youngS | 2feda8800c | 3 years ago |
youngS | b10a40d177 | 3 years ago |
youngS | 3325814c03 | 3 years ago |
youngS | f6918011ca | 3 years ago |
youngS | d7a31c62b3 | 3 years ago |
youngS | d154381895 | 3 years ago |
youngS | 13a67be0ff | 3 years ago |
youngS | b815950f7d | 3 years ago |
youngS | 4316398d82 | 3 years ago |
youngS | 749d72b513 | 3 years ago |
youngS | bfb3738d69 | 3 years ago |
youngS | 3c80635d5f | 3 years ago |
youngS | ed05083bbe | 3 years ago |
youngS | 31677fb1fd | 3 years ago |
youngS | cf1267deb2 | 3 years ago |
youngS | 5988e0e1a9 | 3 years ago |
youngS | 81f1f75fb1 | 3 years ago |
youngS | 08e7eb3476 | 3 years ago |
youngS | 0148905071 | 3 years ago |
youngS | bab6e083bf | 3 years ago |
youngS | adaf7af866 | 3 years ago |
youngS | e8931df00f | 3 years ago |
youngS | 1dc6e84ba7 | 3 years ago |
youngS | cac1703957 | 3 years ago |
youngS | dfcf878416 | 3 years ago |
youngS | 45978aae73 | 3 years ago |
youngS | e84f47170a | 3 years ago |
youngS | 69c699aebb | 3 years ago |
youngS | 19709c7da3 | 3 years ago |
youngS | dc8de286c5 | 3 years ago |
youngS | 9b8412304f | 3 years ago |
youngS | d6ce64c3b6 | 3 years ago |
youngS | 4f0c8a302c | 3 years ago |
youngS | 3ade1efadb | 3 years ago |
youngS | 90dceee1c5 | 3 years ago |
youngS | d460da0024 | 3 years ago |
youngS | 10297e1616 | 3 years ago |
youngS | 37df9f4a5d | 3 years ago |
youngS | a8e8402eff | 3 years ago |
youngS | dd218fe745 | 3 years ago |
youngS | 42cb1bfc88 | 3 years ago |
youngS | d8b02a74ab | 3 years ago |
youngS | 7599e5f3a2 | 3 years ago |
youngS | 4501b5dc2a | 3 years ago |
youngS | 58e7f8fa6a | 3 years ago |
youngS | 436e26af37 | 3 years ago |
youngS | cb3738f4de | 3 years ago |
youngS | aa83de23b5 | 3 years ago |
youngS | 5169c8a477 | 3 years ago |
youngS | 83509a79de | 3 years ago |
youngS | 9abdc5f5ae | 3 years ago |
youngS | a95a2fb22f | 3 years ago |
youngS | 1bd0f08a4b | 3 years ago |
youngS | cdf778d3f3 | 3 years ago |
youngS | bb5d5829df | 3 years ago |
youngS | a5a79867f1 | 3 years ago |
youngS | 8c1ca01532 | 3 years ago |
youngS | 4e3af4de35 | 3 years ago |
youngS | 586136729a | 3 years ago |
youngS | 3c4e5aa6e3 | 3 years ago |
youngS | cad1a77f8f | 3 years ago |
youngS | f7f0896893 | 3 years ago |
youngS | f3349ecc5b | 3 years ago |
youngS | 7fba632390 | 3 years ago |
youngS | aa33e5640b | 3 years ago |
youngS | 45d813cca3 | 3 years ago |
youngS | 95b4b45da8 | 3 years ago |
youngS | 00032239b0 | 3 years ago |
youngS | 86d5623437 | 3 years ago |
youngS | d4e4e9b278 | 3 years ago |
youngS | a6f0cb0174 | 3 years ago |
youngS | b40f93a16c | 3 years ago |
youngS | e6f8b2f628 | 3 years ago |
youngS | ed841bc8fb | 4 years ago |
youngS | a59958e1af | 4 years ago |
youngS | 5835b4d6e1 | 4 years ago |
youngS | 5bac330551 | 4 years ago |
youngS | 1cc239698b | 4 years ago |
youngS | 56cd35565f | 4 years ago |
youngS | 30db4882b4 | 4 years ago |
youngS | 19b82de65f | 4 years ago |
youngS | 179f46b2b3 | 4 years ago |
youngS | 2cb0f1a8f5 | 4 years ago |
youngS | 04df14d919 | 4 years ago |
youngS | a39e3f623d | 4 years ago |
youngS | 04fe7a2965 | 4 years ago |
youngS | 0df8cf68be | 4 years ago |
youngS | 8b0fab87b5 | 4 years ago |
youngS | fd56fcd88b | 4 years ago |
youngS | 2c557a5b12 | 4 years ago |
youngS | 19ba89eec7 | 4 years ago |
youngS | 96785fec31 | 4 years ago |
youngS | bb422ee67d | 4 years ago |
youngS | 0baaaedc67 | 4 years ago |
youngS | e53e0843a3 | 4 years ago |
nineven | 10e9f80067 | 4 years ago |
nineven | 7a4e73fc2b | 4 years ago |
nineven | af21dd2129 | 4 years ago |
youngS | 7c5b2b7270 | 4 years ago |
youngS | 0ac35618e2 | 4 years ago |
youngS | 76bde18c5a | 4 years ago |
youngS | 50d877f2f3 | 4 years ago |
youngS | 710de8432d | 4 years ago |
youngS | 4a8de02afa | 4 years ago |
youngS | 250c07c1a6 | 4 years ago |
youngS | a82f2a3ec7 | 4 years ago |
youngS | 3da097f6e5 | 4 years ago |
youngS | 875445bc09 | 4 years ago |
youngS | a57143f732 | 4 years ago |
youngS | 9727534b91 | 4 years ago |
youngS | 7100febed9 | 4 years ago |
youngS | a320bd9165 | 4 years ago |
youngS | 2980131dd3 | 4 years ago |
youngS | 49ce167ce6 | 4 years ago |
youngS | 0416bf5e15 | 4 years ago |
youngS | ed18398563 | 4 years ago |
youngS | 23f0d90c50 | 4 years ago |
youngS | f96fc79822 | 4 years ago |
youngS | c93df04b18 | 4 years ago |
youngS | 25fb257a53 | 4 years ago |
youngS | 9157a9b43f | 4 years ago |
youngS | e1a34c1fa8 | 4 years ago |
youngS | 227501d89c | 4 years ago |
youngS | 6c0cde3b7f | 4 years ago |
youngS | a22d72e4d8 | 4 years ago |
youngS | 056b30bc82 | 4 years ago |
youngS | 35e6ac8e39 | 4 years ago |
youngS | 02e5eedc82 | 4 years ago |
youngS | e357168fcd | 4 years ago |
youngS | 3623b36247 | 4 years ago |
youngS | 54e9de66b6 | 4 years ago |
youngS | 87ae640c51 | 4 years ago |
youngS | e25046df93 | 4 years ago |
youngS | ef5d434c40 | 4 years ago |
youngS | ac77e8b36a | 4 years ago |
youngS | d133d0ec7b | 4 years ago |
youngS | 7a0c8bfce3 | 4 years ago |
youngS | 2e21465a1e | 4 years ago |
youngS | c7e77ad46b | 4 years ago |
youngS | 07dc141b29 | 4 years ago |
youngS | 75630183c6 | 4 years ago |
youngS | cad5906404 | 4 years ago |
youngS | e2d8f60640 | 4 years ago |
youngS | cae0715e7a | 4 years ago |
youngS | 23a215d980 | 4 years ago |
nineven | c8f3126a85 | 4 years ago |
nineven | cdf43a7f41 | 4 years ago |
nineven | cfc31fc9d8 | 4 years ago |
nineven | 30e7e69ff8 | 4 years ago |
nineven | 00f70627ae | 4 years ago |
nineven | c67b0d48ec | 4 years ago |
youngS | 270e47999c | 4 years ago |
youngS | 6c1137afdc | 4 years ago |
youngS | ea6e2fab44 | 4 years ago |
youngS | de7b3f26aa | 4 years ago |
youngS | ed3cc532d6 | 4 years ago |
youngS | c45aeed34e | 4 years ago |
youngS | fbb4d41934 | 4 years ago |
youngS | 5fd3df9095 | 4 years ago |
youngS | 8b7dd30adb | 4 years ago |
youngS | d5f5e8ca34 | 4 years ago |
youngS | 946e77b0bc | 4 years ago |
youngS | fb973da90e | 4 years ago |
youngS | 1fcf10575d | 4 years ago |
youngS | 7ff34ef43d | 4 years ago |
youngS | 0f3b7c5049 | 4 years ago |
youngS | 4d7ce27ff5 | 4 years ago |
youngS | 4b2a3c7508 | 4 years ago |
youngS | c2ecb1aa3e | 4 years ago |
youngS | 2cad11ba32 | 4 years ago |
youngS | b8d737e08b | 4 years ago |
youngS | 5433d2f463 | 4 years ago |
youngS | 2d057d46ae | 4 years ago |
youngS | 0dbea33ff3 | 4 years ago |
youngS | 74127bac08 | 4 years ago |
youngS | fbb5c85fcd | 4 years ago |
youngS | 930a8e3cbf | 4 years ago |
youngS | 5f9ffcd9f9 | 4 years ago |
youngS | a8d0162c6f | 4 years ago |
youngS | 0d9eb758a0 | 4 years ago |
youngS | ecadd2a030 | 4 years ago |
youngS | 68c7de7374 | 4 years ago |
youngS | ab5034d898 | 4 years ago |
youngS | 0c11effbe6 | 4 years ago |
youngS | d8f16e04c4 | 4 years ago |
youngS | a5388cb9e7 | 4 years ago |
youngS | c8465522f0 | 4 years ago |
youngS | 291dd950d5 | 4 years ago |
youngS | 504b27831d | 4 years ago |
nineven | 65fadc2718 | 4 years ago |
nineven | 51020ed73e | 4 years ago |
nineven | 641b7643de | 4 years ago |
youngS | f902020079 | 4 years ago |
youngS | 4d856bf5c0 | 4 years ago |
youngS | d1ea31cdba | 4 years ago |
youngS | d5ccb336a1 | 4 years ago |
youngS | a2ceeccdef | 4 years ago |
youngS | b6f5210fe7 | 4 years ago |
youngS | ef8c0c3472 | 4 years ago |
youngS | 5a85eb20d6 | 4 years ago |
youngS | 348c6a16f5 | 4 years ago |
nineven | a263d3cf46 | 4 years ago |
nineven | b02563a377 | 4 years ago |
nineven | f2d8619083 | 4 years ago |
nineven | 9446559dbc | 4 years ago |
nineven | e7eb8f59c8 | 4 years ago |
nineven | 3de5b56584 | 4 years ago |
nineven | a3bc31a0f9 | 4 years ago |
nineven | 308faf76b6 | 4 years ago |
nineven | 81717de958 | 4 years ago |
nineven | 23016487fe | 4 years ago |
nineven | 664c79dedf | 4 years ago |
nineven | 46acd9c391 | 4 years ago |
nineven | b4a1cb47ae | 4 years ago |
nineven | 21fe5665e2 | 4 years ago |
nineven | a5dd4c7759 | 4 years ago |
nineven | a3cbc7354b | 4 years ago |
nineven | 24754db152 | 4 years ago |
nineven | aeb6460946 | 4 years ago |
nineven | 9e19f93ffb | 4 years ago |
nineven | d5f1ff07df | 4 years ago |
nineven | 8222ad2df5 | 4 years ago |
nineven | 0c0e32bb23 | 4 years ago |
nineven | 46a89416bc | 4 years ago |
nineven | 97b5a23dba | 4 years ago |
nineven | 7c292f85a4 | 4 years ago |
nineven | 0d42223af2 | 4 years ago |
nineven | d7a3506230 | 4 years ago |
nineven | a39f7348b3 | 4 years ago |
nineven | a2d0bdd3b0 | 4 years ago |
nineven | 8a080a5ed3 | 4 years ago |
nineven | 082b56121f | 4 years ago |
nineven | dcdf2aac5c | 4 years ago |
nineven | a41f6335bc | 4 years ago |
nineven | 5b7e6a3869 | 4 years ago |
nineven | 69d5979ff8 | 4 years ago |
nineven | 4da62f86b9 | 4 years ago |
nineven | 068561ae99 | 4 years ago |
nineven | aed955c657 | 4 years ago |
nineven | 0f1b7c39b4 | 4 years ago |
nineven | 6e66592ba2 | 4 years ago |
nineven | fad08e4be2 | 4 years ago |
nineven | 65bae2d9c8 | 4 years ago |
youngS | ccc9a176f4 | 4 years ago |
youngS | 95a96e5dc5 | 4 years ago |
youngS | 9f178f5c7f | 4 years ago |
youngS | a0dba04bf2 | 4 years ago |
youngS | d5c42cc769 | 4 years ago |
youngS | 1683f27792 | 4 years ago |
xiaoyu | e2eaa14da5 | 4 years ago |
xiaoyu | d135f4bcc0 | 4 years ago |
xiaoyu | cb71d238bc | 4 years ago |
xiaoyu | c66c304e81 | 4 years ago |
xiaoyu | d72faa2a46 | 4 years ago |
xiaoyu | 386a395f80 | 4 years ago |
xiaoyu | 62c204a300 | 4 years ago |
xiaoyu | 21ffdea520 | 4 years ago |
xiaoyu | 04e51c8d3c | 4 years ago |
xiaoyu | b45d16cfe0 | 4 years ago |
xiaoyu | eee1685361 | 4 years ago |
xiaoyu | b0abdfa8d2 | 4 years ago |
xiaoyu | 97cb1f08bc | 4 years ago |
xiaoyu | 94754fe2dc | 4 years ago |
xiaoyu | d805283ef2 | 4 years ago |
xiaoyu | d5c8a09ce6 | 4 years ago |
xiaoyu | d02a7a74b8 | 4 years ago |
xiaoyu | cad199394b | 4 years ago |
xiaoyu | 3861b0a84f | 4 years ago |
xiaoyu | 0521f0c6a0 | 4 years ago |
xiaoyu | 11810cd6ca | 4 years ago |
xiaoyu | a9b5e320c0 | 4 years ago |
xiaoyu | b4bf20f960 | 4 years ago |
xiaoyu | 58b1fd06ac | 4 years ago |
xiaoyu | bbdb6bb1d4 | 4 years ago |
xiaoyu | ffcc4efd89 | 4 years ago |
xiaoyu | 474f2d9eee | 4 years ago |
xiaoyu | 4af2212c9e | 4 years ago |
xiaoyu | 03a07f01f4 | 4 years ago |
xiaoyu | b9679c586a | 4 years ago |
xiaoyu | dc64563c55 | 4 years ago |
xiaoyu | d0700522ee | 4 years ago |
xiaoyu | 49f8f1c0ca | 4 years ago |
xiaoyu | ce6a0e8dcc | 4 years ago |
xiaoyu | ff1c45946f | 4 years ago |
xiaoyu | 1fe5d51143 | 4 years ago |
xiaoyu | 1af07cc2cb | 4 years ago |
xiaoyu | 0dc9577913 | 4 years ago |
xiaoyu | 5f58e88ebb | 4 years ago |
xiaoyu | 66e8969cc2 | 4 years ago |
xiaoyu | a121bfddad | 4 years ago |
xiaoyu | c0a8ad6415 | 4 years ago |
nineven | e5d4fcb4f2 | 4 years ago |
nineven | a06822ee37 | 5 years ago |
nineven | 863c4d2fe6 | 5 years ago |
nineven | 96394cbece | 5 years ago |
nineven | c0296619cc | 5 years ago |
nineven | e035f40d86 | 5 years ago |
nineven | 060f6991d6 | 5 years ago |
nineven | 02cd05eb7e | 5 years ago |
nineven | c46bbc6f75 | 5 years ago |
nineven | b32a12a597 | 5 years ago |
nineven | 33e16c9284 | 5 years ago |
nineven | 5161f04fae | 5 years ago |
nineven | d7fb8480c5 | 5 years ago |
nineven | a879fea15c | 5 years ago |
nineven | 0a1cefa2ad | 5 years ago |
nineven | 539ff8b10d | 5 years ago |
nineven | c5ddfd5e33 | 5 years ago |
nineven | a1167f6303 | 5 years ago |
nineven | 9f21a2f51e | 5 years ago |
nineven | d9b0d3718c | 5 years ago |
nineven | fb99233ce5 | 5 years ago |
nineven | 1dac608843 | 5 years ago |
nineven | 47e79acf42 | 5 years ago |
nineven | 0c61cd4398 | 5 years ago |
nineven | f588a860df | 5 years ago |
nineven | 7821d10929 | 5 years ago |
nineven | ff81f62d95 | 5 years ago |
nineven | a4e9579236 | 5 years ago |
nineven | b3610913e2 | 5 years ago |
nineven | 42de66927f | 5 years ago |
nineven | 9d8a28ff9a | 5 years ago |
nineven | a341fbc647 | 5 years ago |
nineven | 96cd18e405 | 5 years ago |
nineven | 9299e4af05 | 5 years ago |
nineven | 9679d1d7fc | 5 years ago |
nineven | 19ea47a65c | 5 years ago |
nineven | 616e959978 | 5 years ago |
nineven | 4180b82311 | 5 years ago |
nineven | ebfa2126a6 | 5 years ago |
nineven | 68eceea99f | 5 years ago |
nineven | 28ec622347 | 5 years ago |
nineven | bd213e2c0b | 5 years ago |
nineven | b9a646f521 | 5 years ago |
nineven | b8ebd2b8d9 | 5 years ago |
nineven | 03c59c4fcf | 5 years ago |
nineven | 695c1c9ad1 | 5 years ago |
nineven | 9cdc609eb5 | 5 years ago |
nineven | 72d8ebcfd8 | 5 years ago |
nineven | 85a1982129 | 5 years ago |
nineven | 870646daeb | 5 years ago |
nineven | 4e60166ecc | 5 years ago |
nineven | de4285a46a | 5 years ago |
nineven | 789b9a0c58 | 5 years ago |
nineven | 8de6e4a87d | 5 years ago |
nineven | 15e88b9b59 | 5 years ago |
nineven | 60b514fc0c | 5 years ago |
nineven | cb32a2226e | 5 years ago |
nineven | 1027110786 | 5 years ago |
nineven | 8d18692809 | 5 years ago |
nineven | 47f2f534c7 | 5 years ago |
nineven | 68c8db9339 | 5 years ago |
nineven | 31c075a3f8 | 5 years ago |
nineven | 8a39c3d100 | 5 years ago |
nineven | 003c39aae6 | 5 years ago |
nineven | 917ed49f74 | 5 years ago |
nineven | eaa98f49d6 | 5 years ago |
nineven | 870b6a2424 | 5 years ago |
nineven | 7421d1a38d | 5 years ago |
nineven | a8b5d4dbbe | 5 years ago |
nineven | 5f7873c29f | 5 years ago |
nineven | f72be06618 | 5 years ago |
nineven | 1513cb4ca9 | 5 years ago |
nineven | d8e4702632 | 5 years ago |
nineven | 986e179bba | 5 years ago |
nineven | 45708d3fc3 | 5 years ago |
nineven | bdacda6a64 | 5 years ago |
nineven | f308de1aeb | 5 years ago |
@ -1,6 +1,16 @@ |
||||
fir_ser/.idea/ |
||||
fir_ser/db.sqlite3 |
||||
*.pyc |
||||
fir_ser/files/ |
||||
fir_ser/venv/ |
||||
fir_client/.idea |
||||
fir_admin/.idea/.gitignore |
||||
fir_admin/.idea/ |
||||
fir_client/yarn.lock |
||||
fir_download/package-lock.json |
||||
fir_client/src/assets/down_left.png |
||||
fir_client/src/assets/down_right.png |
||||
mailhtml/build/ |
||||
mailhtml/node_modules/ |
||||
mailhtml/.idea/ |
||||
fir_client/dist_index/ |
||||
fir_client/dist_short/ |
||||
|
@ -1,17 +1,63 @@ |
||||
# FlyApps |
||||
### 用与应用分发,苹果超级签名 |
||||
#### 部署前准备 |
||||
- 备案域名【至少需要一个域名,以下可通过子域名部署】 |
||||
- API域名 |
||||
- 前端web域名 |
||||
- 下载页域名 |
||||
- 下载页域名可配置多个 |
||||
- 存储域名(使用阿里云oss存储) |
||||
- ssl证书 |
||||
- API域名证书 |
||||
- 存储域名证书(使用阿里云oss存储) |
||||
- 前端web域名证书(可选) |
||||
- Centos8Stream 服务器 |
||||
- 如果使用oss存储,则带宽为1M,若使用本地存储,则带宽越大越好 |
||||
- 如果使用超级签,最低配置为2cpu 4G内存,若干不使用签名,则1cpu2G就行 |
||||
- 阿里云短信或极光短信服务【可选一个,主要用与注册,重置密码】 |
||||
- 阿里云短信 |
||||
- 极光短信 |
||||
- 邮箱服务【可选,用与注册,重置密码,通知信息】 |
||||
- 阿里云OSS存储【可选】 |
||||
- [sts授权配置](https://help.aliyun.com/document_detail/100624.html) |
||||
- 阿里云CDN【可选,用与加速访问】 |
||||
- 极验验证【可选,滑动验证服务】 |
||||
- 微信公众号【可选,用与微信扫描登录】 |
||||
- 阿里云支付【可选,用与购买下载次数】 |
||||
- 微信支付【可选,用与购买下载次数】 |
||||
|
||||
## install |
||||
``` |
||||
yum install -y npm |
||||
npm install -g n |
||||
n latest |
||||
#### 自用搭建建议 |
||||
- 阿里云服务器需要1cpu 2G内存,无需系统盘,如果使用超级签,可以适当增加配置 |
||||
- 需要阿里云OSS存储和阿里云CDN,并且OSS存储和阿里云服务器部署同一个地区 |
||||
- 可以申请一个极验进行滑动验证,或者开启验证码验证 |
||||
- 阿里云备案域名:api和前端可以使用一个域名,下载页单独域名 |
||||
|
||||
npm install -g yarn |
||||
``` |
||||
#### 部署必备资料 |
||||
- 域名证书 |
||||
- web域名和证书 |
||||
- api域名和证书 |
||||
- 下载页域名(可配置证书) |
||||
- 存储域名和证书 |
||||
- 本地存储,则该域名和证书可以和api域名证书一致 |
||||
- 阿里云oss存储 |
||||
- 开启cdn,需要新域名和证书 |
||||
- 不开启,无需域名和证书 |
||||
- Centos8Stream 服务器 |
||||
|
||||
## build |
||||
``` |
||||
cd ./fir_client |
||||
yarn install |
||||
yarn build |
||||
``` |
||||
## 部署方式 |
||||
|
||||
### 1.[Docker 部署](./doc/docker.md) 【推荐】 |
||||
|
||||
### 2.[本地部署](./doc/local.md) |
||||
|
||||
### 功能预览 |
||||
![img_1.png](./doc/images/img_1.png) |
||||
![img_2.png](./doc/images/img_2.png) |
||||
![img_3.png](./doc/images/img_3.png) |
||||
![img_4.png](./doc/images/img_4.png) |
||||
![img_5.png](./doc/images/img_5.png) |
||||
![img_6.png](./doc/images/img_6.png) |
||||
![img_7.png](./doc/images/img_7.png) |
||||
![img_8.png](./doc/images/img_8.png) |
||||
![img_9.png](./doc/images/img_9.png) |
||||
![img_10.png](./doc/images/img_10.png) |
||||
![img_11.png](./doc/images/img_11.png) |
@ -0,0 +1,102 @@ |
||||
### Docker最小化部署前准备,如果使用超级签和云存储,需要使用阿里云的服务器 |
||||
系统|Centos 8 Stream 纯净系统 [2cpu 4G内存] |
||||
----|---- |
||||
域名|```app.hehelucky.cn``` |
||||
域名SSL证书| nginx 格式证书 [阿里云和腾讯云都可以申请免费ssl证书] |
||||
数据路径| ```/data``` |
||||
|
||||
|
||||
### 开始部署 |
||||
##### 1.从git上面下载源码 |
||||
``` |
||||
cd /data/ |
||||
dnf install git -y |
||||
git clone https://github.com/nineaiyu/flyapps |
||||
``` |
||||
|
||||
## 注意,下面展示的相对路径,都是以```/data/flyapps```为相对目录 |
||||
|
||||
#### 2.docker环境安装 |
||||
``` |
||||
cd /data/flyapps/docker/init |
||||
sh init.sh |
||||
``` |
||||
|
||||
#### 3.配置域名和证书,如果有cdn或者oss,也要进行配置 |
||||
a.将域名证书通过```sftp软件```或者```rz命令```复制到```/data/flyapps/nginx.conf.d```目录中 |
||||
|
||||
b.将域名证书分别重命名为 ```域名.pem``` 和 ```域名.key``` .本次使用的域名是 ```app.hehelucky.cn``` ,因此,证书名称类似如下 |
||||
```shell script |
||||
nginx.conf.d/app.hehelucky.cn.key |
||||
nginx.conf.d/app.hehelucky.cn.pem |
||||
``` |
||||
c.修改NGINX配置文件```nginx.conf.d/flyapps-vhost.conf```,将```server_name```字段修改为域名,将```ssl_certificate```和 |
||||
```ssl_certificate_key```修改为对应证书路径,修改之后,对应字段如下 |
||||
```shell |
||||
server_name app.hehelucky.cn; |
||||
ssl_certificate /etc/nginx/conf.d/app.hehelucky.cn.pem; |
||||
ssl_certificate_key /etc/nginx/conf.d/app.hehelucky.cn.key; |
||||
``` |
||||
|
||||
#### 4.配置api服务需要修改api和web域名,如果有需求,还可以配置 短信,邮箱,geetest,存储等信息 |
||||
##### fir_ser配置文件 ```fir_ser/config.py``` |
||||
```python |
||||
class DOMAINCONF(object): |
||||
API_DOMAIN = "https://app.hehelucky.cn" # 用与开启本地存储,上传应用配置 |
||||
WEB_DOMAIN = "https://app.hehelucky.cn" # 用于超级签跳转配置,该域名一般为前端页面域名 |
||||
``` |
||||
|
||||
##### fir_client配置文件 ```fir_client/vue.confjg.js``` |
||||
```javascript |
||||
const pro_base_env = { |
||||
baseUrl: '/', //该选项可以填写web-api的域名,类似 https://api.xxx.com/ |
||||
index_static: '/', //若配置cdn等加速,可以填写cdn加速域名 |
||||
baseShortUrl: '/', //该选项可以填写short-api的域名,也可以和web-api域名一样,类似 https://api.xxx.com/ |
||||
short_static: '/short/', //若配置cdn等加速,可以填写cdn加速域名 |
||||
version: version, |
||||
}; |
||||
``` |
||||
|
||||
##### 构建静态资源 |
||||
``` |
||||
cd /data/flyapps/docker/scripts |
||||
sh build.sh |
||||
``` |
||||
|
||||
##### 启动所有服务 |
||||
``` |
||||
cd /data/flyapps/docker/scripts |
||||
sh start_all.sh |
||||
``` |
||||
|
||||
##### 关闭所有服务 |
||||
``` |
||||
cd /data/flyapps/docker/scripts |
||||
sh stop_all.sh |
||||
``` |
||||
|
||||
##### 根据提示创建默认管理用户,用与访问管理后台 |
||||
```shell |
||||
docker exec -it flyapps python manage.py createsuperuser |
||||
``` |
||||
|
||||
##### 测试访问 |
||||
- 在浏览器输入自己配置的域名 https://app.hehelucky.cn/ 进行访问 |
||||
- 管理后台访问 https://app.hehelucky.cn:3448/ 进行访问 |
||||
|
||||
|
||||
##### 如果要使用本地的数据库和redis,api服务使用容器,需要修改文件```/data/flyapps/docker/flyapps/docker-compose.yml``` |
||||
```shell |
||||
external_links: |
||||
- mariadb:mariadb |
||||
- redis:redis |
||||
``` |
||||
修改为 |
||||
```shell |
||||
extra_hosts: |
||||
- "mariadb:172.31.31.1" |
||||
- "redis:172.31.31.1" |
||||
``` |
||||
并将```nginx:```下面的配置注释掉 |
||||
|
||||
同时还需要修改mariadb和redis授权 |
After Width: | Height: | Size: 77 KiB |
After Width: | Height: | Size: 77 KiB |
After Width: | Height: | Size: 53 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 70 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 56 KiB |
@ -0,0 +1,166 @@ |
||||
### 本地部署前准备 |
||||
系统 | Centos 8 Stream [2cpu 4G内存] |
||||
----|---- |
||||
域名|```app.hehelucky.cn``` |
||||
域名SSL证书| nginx 格式证书 [阿里云和腾讯云都可以申请免费ssl证书] |
||||
数据路径| ```/data``` |
||||
|
||||
|
||||
##### 从git上面下载源码 |
||||
```shell |
||||
cd /data/ |
||||
dnf install git gcc zip unzip -y |
||||
git clone https://github.com/nineaiyu/flyapps |
||||
``` |
||||
|
||||
|
||||
### flyapps 本地部署 [python3 环境] |
||||
|
||||
##### 搭建python env 环境 |
||||
```shell |
||||
dnf install python39 python39-devel redis mariadb-server mariadb-devel -y |
||||
python3.9 -m venv py39 |
||||
source py39/bin/activate |
||||
``` |
||||
|
||||
###### 安装pip包 |
||||
```shell |
||||
cd /data/flyapps/fir_ser/ |
||||
pip install -U setuptools pip -i https://pypi.tuna.tsinghua.edu.cn/simple/ |
||||
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/ |
||||
``` |
||||
|
||||
#### 配置数据库 |
||||
##### 启动mariadb数据库 |
||||
```shell |
||||
systemctl restart mariadb |
||||
systemctl enable mariadb |
||||
``` |
||||
##### 创建mysql数据库 |
||||
```shell |
||||
mysql |
||||
``` |
||||
执行下面mysql命令 |
||||
```mariadb |
||||
create database flyapps default character set utf8 COLLATE utf8_general_ci; |
||||
grant all on flyapps.* to flyuser@'127.0.0.1' identified by 'KGzKjZpWBp4R4RSa'; |
||||
``` |
||||
##### 启动redis数据库 |
||||
```shell |
||||
echo 'requirepass nineven' >> /etc/redis.conf # 配置授权密码 |
||||
systemctl restart redis |
||||
systemctl enable redis |
||||
``` |
||||
|
||||
### flyapps zsign ipa重签名工具安装 |
||||
```shell |
||||
dnf install openssl-devel -y |
||||
dnf install gcc-c++ gcc -y |
||||
cd /data/flyapps/fir_ser/ |
||||
tar xvf zsign-1.1.2.tar.gz |
||||
cd zsign-1.1.2/ |
||||
g++ *.cpp common/*.cpp -lcrypto -O3 -std=c++11 -o /usr/bin/zsign |
||||
``` |
||||
|
||||
|
||||
#### 配置api服务需要修改api和web域名,如果有需求,还可以配置 短信,邮箱,geetest,存储等信息 |
||||
##### fir_ser配置文件 ```fir_ser/config.py``` |
||||
```python |
||||
class DOMAINCONF(object): |
||||
API_DOMAIN = "https://app.hehelucky.cn" # 用与开启本地存储,上传应用配置 |
||||
WEB_DOMAIN = "https://app.hehelucky.cn" # 用于超级签跳转配置,该域名一般为前端页面域名 |
||||
``` |
||||
|
||||
##### fir_client配置文件 ```fir_client/vue.confjg.js``` |
||||
```javascript |
||||
const pro_base_env = { |
||||
baseUrl: '/', //该选项可以填写web-api的域名,类似 https://api.xxx.com/ |
||||
index_static: '/', //若配置cdn等加速,可以填写cdn加速域名 |
||||
baseShortUrl: '/', //该选项可以填写short-api的域名,也可以和web-api域名一样,类似 https://api.xxx.com/ |
||||
short_static: '/short/', //若配置cdn等加速,可以填写cdn加速域名 |
||||
version: version, |
||||
}; |
||||
``` |
||||
|
||||
### flyapps web端搭建 |
||||
###### npm编译环境 |
||||
```shell |
||||
dnf install npm -y |
||||
npm install -g n |
||||
n 12.13 # 安装12版本的node或者14版本 ,最新版本会有问题 |
||||
npm install -g yarn |
||||
``` |
||||
|
||||
|
||||
|
||||
###### 编译web端和下载页 |
||||
```shell |
||||
cd /data/flyapps/fir_client/ |
||||
vim vue.config.js #修改api接口地址 |
||||
# pro_base_env 正式环境信息 |
||||
# dev_base_env 开发环境信息 |
||||
|
||||
yarn install |
||||
yarn build index # 前端打包,输出目录 dist_index |
||||
yarn build short # 下载页打包,输出目录 dist_short |
||||
``` |
||||
|
||||
###### 编译web管理后台 |
||||
```shell |
||||
cd /data/flyapps/fir_admin/ |
||||
yarn install |
||||
yarn build:prod # 下载页打包,输出目录 dist |
||||
``` |
||||
|
||||
### nginx配置 |
||||
##### 安装nginx |
||||
```shell |
||||
dnf install nginx -y |
||||
``` |
||||
##### 将域名ssl证书解压到```/etc/nginx/conf.d/``` 目录中,并重命名为```域名.pem```,```域名.key```格式 |
||||
##### 拷贝虚拟主机配置文件 |
||||
```shell |
||||
cp /data/flyapps/nginx.conf.d/flyapps-vhost.conf /etc/nginx/conf.d/ |
||||
``` |
||||
1.创建web目录,并将打包好的web复制该目录 |
||||
```shell |
||||
mkdir -pv /data/{fir_client/short,fir_admin} |
||||
cp -a /data/flyapps/fir_client/dist_index/* /data/fir_client/ |
||||
cp -a /data/flyapps/fir_client/dist_short/* /data/fir_client/short/ |
||||
cp -a /data/flyapps/fir_admin/dist/* /data/fir_admin/ |
||||
chown nginx.nginx -R /data/{fir_client,fir_admin} |
||||
``` |
||||
2.启动nginx服务 |
||||
```shell |
||||
nginx -t |
||||
systemctl restart nginx |
||||
systemctl enable nginx |
||||
``` |
||||
|
||||
##### 添加redis和mariadb uwsgi本地解析 |
||||
```shell |
||||
echo '127.0.0.1 mariadb redis flyapps' >> /etc/hosts |
||||
``` |
||||
|
||||
###### 迁移数据库 |
||||
```shell |
||||
cd /data/flyapps/fir_ser/ |
||||
python manage.py makemigrations |
||||
python manage.py migrate |
||||
``` |
||||
|
||||
#### 启动api服务 |
||||
```shell |
||||
echo 'net.core.somaxconn=1024' >> /etc/sysctl.conf |
||||
sysctl -p |
||||
cd /data/flyapps/fir_ser/ |
||||
python manage.py start all -u nginx -usm 1 -d |
||||
``` |
||||
|
||||
##### 根据提示创建默认管理用户,用与访问管理后台 |
||||
```shell |
||||
python manage.py createsuperuser |
||||
``` |
||||
- 需要输入用户名,邮箱和密码 |
||||
- 用户名和密码用与登录管理后台 |
||||
- 邮箱和密码用与登录前端web |
@ -0,0 +1,67 @@ |
||||
version: '3.2' |
||||
|
||||
services: |
||||
buildflyapps: |
||||
image: 'flyapps' |
||||
build: |
||||
context: ../../fir_ser |
||||
dockerfile: Dockerfile |
||||
command: |
||||
- echo |
||||
- success |
||||
|
||||
buildclient: |
||||
container_name: buildclient |
||||
image: 'node:14.17.3' |
||||
working_dir: /fir_client |
||||
volumes: |
||||
- /etc/localtime:/etc/localtime:ro |
||||
- ../../fir_client:/fir_client |
||||
- ../../data/web/:/web |
||||
command: |
||||
- bash |
||||
- -c |
||||
- yarn config set registry https://registry.npm.taobao.org && yarn install && yarn build index && yarn build short && ([ ! -e /web/fir_client ] && \cp -a dist_index /web/fir_client || \cp -a dist_index/* /web/fir_client/) && ([ ! -e /web/fir_client/short ] && \cp -a dist_short /web/fir_client/short || \cp -a dist_short/* /web/fir_client/short/) && echo build success |
||||
|
||||
buildindex: |
||||
container_name: buildindex |
||||
image: 'node:14.17.3' |
||||
working_dir: /fir_client |
||||
volumes: |
||||
- /etc/localtime:/etc/localtime:ro |
||||
- ../../fir_client:/fir_client |
||||
- ../../data/web/:/web |
||||
command: |
||||
- bash |
||||
- -c |
||||
- yarn config set registry https://registry.npm.taobao.org && yarn install && yarn build index && ([ ! -e /web/fir_index ] && \cp -a dist_index /web/fir_index || \cp -a dist_index/* /web/fir_index/) && echo build success |
||||
|
||||
|
||||
|
||||
buildshort: |
||||
container_name: buildshort |
||||
image: 'node:14.17.3' |
||||
working_dir: /fir_client |
||||
volumes: |
||||
- /etc/localtime:/etc/localtime:ro |
||||
- ../../fir_client:/fir_client |
||||
- ../../data/web/:/web |
||||
command: |
||||
- sh |
||||
- -c |
||||
- yarn config set registry https://registry.npm.taobao.org && yarn install && yarn build short && ([ ! -e /web/fir_short ] && \cp -a dist_short /web/fir_short || \cp -a dist_short/* /web/fir_short/) && echo build success |
||||
|
||||
|
||||
buildadmin: |
||||
container_name: buildadmin |
||||
image: 'node:14.17.3' |
||||
working_dir: /fir_admin |
||||
volumes: |
||||
- /etc/localtime:/etc/localtime:ro |
||||
- ../../fir_admin:/fir_admin |
||||
- ../../data/web/:/web |
||||
command: |
||||
- sh |
||||
- -c |
||||
- yarn config set registry https://registry.npm.taobao.org && yarn install && yarn build:prod && ([ ! -e /web/fir_admin ] && \cp -a dist /web/fir_admin || \cp -a dist/* /web/fir_admin/) && echo build success |
||||
|
@ -0,0 +1,31 @@ |
||||
version: '3' |
||||
|
||||
networks: |
||||
flyapps: |
||||
external: true |
||||
name: flyapps |
||||
|
||||
services: |
||||
flyapps: |
||||
container_name: flyapps |
||||
restart: always |
||||
image: 'nineven/flyapps' |
||||
working_dir: /data/fir_ser |
||||
volumes: |
||||
- /etc/localtime:/etc/localtime:ro |
||||
- ../../fir_ser:/data/fir_ser |
||||
- ../../data/flyapps/files:/data/fir_ser/files |
||||
- ../../data/logs/flyapps/:/data/fir_ser/logs |
||||
- ../../data/flyapps/supersign/:/data/fir_ser/supersign |
||||
- ../../nginx.conf.d:/data/cert |
||||
networks: |
||||
flyapps: |
||||
ipv4_address: 172.31.31.100 |
||||
external_links: |
||||
- mariadb:mariadb |
||||
- redis:redis |
||||
sysctls: |
||||
- net.core.somaxconn=4096 |
||||
extra_hosts: |
||||
- "mariadb:172.31.31.1" |
||||
- "redis:172.31.31.1" |
@ -0,0 +1,48 @@ |
||||
version: '3' |
||||
|
||||
networks: |
||||
flyapps: |
||||
external: true |
||||
name: flyapps |
||||
|
||||
services: |
||||
flyapps: |
||||
container_name: flyapps |
||||
restart: always |
||||
image: 'nineven/flyapps' |
||||
working_dir: /data/fir_ser |
||||
volumes: |
||||
- /etc/localtime:/etc/localtime:ro |
||||
- ../../fir_ser:/data/fir_ser |
||||
- ../../data/flyapps/files:/data/fir_ser/files |
||||
- ../../data/logs/flyapps/:/data/fir_ser/logs |
||||
- ../../data/flyapps/supersign/:/data/fir_ser/supersign |
||||
- ../../nginx.conf.d:/data/cert |
||||
networks: |
||||
flyapps: |
||||
ipv4_address: 172.31.31.100 |
||||
external_links: |
||||
- mariadb:mariadb |
||||
- redis:redis |
||||
sysctls: |
||||
- net.core.somaxconn=4096 |
||||
nginx: |
||||
container_name: nginx |
||||
restart: always |
||||
image: 'nginx:1.21.3' |
||||
volumes: |
||||
- /etc/localtime:/etc/localtime:ro |
||||
- ../../data/web:/data |
||||
- ../../nginx.conf.d:/etc/nginx/conf.d |
||||
- ../../data/logs/nginx:/var/log/nginx |
||||
networks: |
||||
flyapps: |
||||
ipv4_address: 172.31.31.200 |
||||
ports: |
||||
- 80:80 |
||||
- 443:443 |
||||
- 3448:3448 |
||||
external_links: |
||||
- flyapps:flyapps |
||||
depends_on: |
||||
- flyapps |
@ -0,0 +1,7 @@ |
||||
#!/bin/bash |
||||
# |
||||
# |
||||
|
||||
for i in nginx flyapps mariadb redis buildclient buildshort buildadmin ;do echo $i;docker rm -f $i;done |
||||
|
||||
docker network rm flyapps |
@ -0,0 +1,10 @@ |
||||
#!/bin/bash |
||||
# |
||||
# |
||||
|
||||
|
||||
docker pull 'bitnami/mariadb:10.7.3' |
||||
docker pull 'bitnami/redis:6.2.7' |
||||
docker pull 'nginx:1.21.3' |
||||
docker pull 'nineven/flyapps:latest' |
||||
docker pull 'node:14.17.3' |
@ -0,0 +1,24 @@ |
||||
#!/bin/bash |
||||
# |
||||
# |
||||
|
||||
which dockerd |
||||
if [ $? -ne 0 ];then |
||||
dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo |
||||
dnf install docker-ce -y |
||||
fi |
||||
#which docker-compose |
||||
#if [ $? -ne 0 ];then |
||||
# curl -L https://get.daocloud.io/docker/compose/releases/download/v2.5.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose |
||||
# chmod +x /usr/local/bin/docker-compose |
||||
#fi |
||||
|
||||
data_path="$(dirname $(dirname `pwd`))/data" |
||||
mkdir -pv ${data_path}/{flyapps/files,web,mariadb,redis,logs/{mariadb,nginx,flyapps}} |
||||
\cp $(dirname $(dirname `pwd`))/fir_ser/files/head_img.jpeg ${data_path}/flyapps/files/ |
||||
chown 1001.1001 -R ${data_path}/{flyapps,web,mariadb,redis,logs/{mariadb,nginx,flyapps}} |
||||
chown 101.101 -R ${data_path}/{flyapps,logs/flyapps} |
||||
systemctl start docker && docker network create flyapps --driver bridge --subnet=172.31.31.0/24 --gateway=172.31.31.1 |
||||
systemctl enable docker |
||||
systemctl status docker |
||||
|
@ -0,0 +1 @@ |
||||
Asia/Shanghai |
@ -0,0 +1,43 @@ |
||||
version: '3.2' |
||||
|
||||
|
||||
|
||||
networks: |
||||
flyapps: |
||||
external: true |
||||
name: flyapps |
||||
|
||||
services: |
||||
|
||||
mariadb: |
||||
image: bitnami/mariadb:10.7.3 |
||||
container_name: mariadb |
||||
restart: always |
||||
environment: |
||||
- MARIADB_ROOT_PASSWORD=rootIPD.xx2.19 |
||||
- MARIADB_DATABASE=flyapps |
||||
- MARIADB_USER=flyuser |
||||
- MARIADB_PASSWORD=KGzKjZpWBp4R4RSa |
||||
#- ALLOW_EMPTY_PASSWORD=yes |
||||
- MARIADB_ENABLE_SLOW_QUERY=1 |
||||
- MARIADB_LONG_QUERY_TIME=3 |
||||
- MARIADB_SKIP_TEST_DB=yes |
||||
- MARIADB_EXTRA_FLAGS=--max-connect-errors=3000 --max_connections=30000 |
||||
ports: |
||||
- 3306:3306 |
||||
networks: |
||||
flyapps: |
||||
ipv4_address: 172.31.31.90 |
||||
volumes: |
||||
- ../init/timezone:/etc/timezone:ro |
||||
- /etc/localtime:/etc/localtime:ro |
||||
- ../../data/mariadb:/bitnami/mariadb/data |
||||
- ../../data/logs/mariadb:/data/logs/mariadb |
||||
- ./server.cnf:/opt/bitnami/mariadb/conf/my_custom.cnf:ro |
||||
|
||||
# adminer: |
||||
# image: adminer |
||||
# ports: |
||||
# - 8080:8080 |
||||
# networks: |
||||
# - fungame |
@ -0,0 +1,108 @@ |
||||
# |
||||
# These groups are read by MariaDB server. |
||||
# Use it for options that only the server (but not clients) should see |
||||
# |
||||
# See the examples of server my.cnf files in /usr/share/mysql/ |
||||
# |
||||
|
||||
|
||||
# this is only for the mysqld standalone daemon |
||||
[mysqld] |
||||
binlog_cache_size = 192K |
||||
thread_stack = 384K |
||||
join_buffer_size = 4096K |
||||
query_cache_type = 1 |
||||
max_heap_table_size = 1024M |
||||
|
||||
default_storage_engine = InnoDB |
||||
performance_schema_max_table_instances = 400 |
||||
table_definition_cache = 400 |
||||
skip-external-locking |
||||
key_buffer_size = 512M |
||||
max_allowed_packet = 1G |
||||
table_open_cache = 1024 |
||||
sort_buffer_size = 2048K |
||||
net_buffer_length = 4K |
||||
read_buffer_size = 2048K |
||||
read_rnd_buffer_size = 1024K |
||||
myisam_sort_buffer_size = 16M |
||||
thread_cache_size = 192 |
||||
query_cache_size = 256M |
||||
tmp_table_size = 1024M |
||||
sql-mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES |
||||
|
||||
|
||||
max_connections = 30000 |
||||
max_connect_errors = 1000 |
||||
open_files_limit = 65535 |
||||
|
||||
expire_logs_days = 10 |
||||
#log_queries_not_using_indexes=on |
||||
|
||||
character-set-client-handshake = FALSE |
||||
character-set-server = utf8mb4 |
||||
collation-server = utf8mb4_general_ci |
||||
init_connect='SET NAMES utf8mb4' |
||||
#character-set-server=utf8 |
||||
skip_name_resolve |
||||
event_scheduler=1 |
||||
#skip-grant-tables |
||||
|
||||
|
||||
#innodb_data_home_dir = /var/lib/mysql/ |
||||
#innodb_data_file_path = ibdata1:10M:autoextend |
||||
#innodb_log_group_home_dir = /var/lib/mysql/ |
||||
#innodb_buffer_pool_size = 1024M |
||||
#innodb_log_file_size = 128M |
||||
#innodb_log_buffer_size = 32M |
||||
#innodb_flush_log_at_trx_commit = 1 |
||||
#innodb_lock_wait_timeout = 50 |
||||
#innodb_max_dirty_pages_pct = 90 |
||||
#innodb_read_io_threads = 4 |
||||
#innodb_write_io_threads = 4 |
||||
|
||||
|
||||
|
||||
# |
||||
# Allow server to accept connections on all interfaces. |
||||
# |
||||
#bind-address=0.0.0.0 |
||||
# |
||||
# this is only for embedded server |
||||
# This group is only read by MariaDB servers, not by MySQL. |
||||
# If you use the same .cnf file for MySQL and MariaDB, |
||||
# you can put MariaDB-only options here |
||||
[mariadb] |
||||
#autoset_open_files_limit |
||||
#enable_slow_query_log |
||||
|
||||
#audit |
||||
plugin_load_add=server_audit |
||||
server_audit_logging=on |
||||
server_audit_events=connect,query |
||||
server_audit=force_plus_permanent |
||||
server_audit_events=QUERY_DDL,QUERY_DML,CONNECT |
||||
server_audit_output_type=file |
||||
server_audit_file_rotate_now=on |
||||
server_audit_file_rotations=9 |
||||
server_audit_file_rotate_size=1G |
||||
server_audit_file_path=/data/logs/mariadb |
||||
|
||||
|
||||
log_error=/data/logs/mariadb/mariadb.err.log |
||||
|
||||
log_output=FILE |
||||
slow_query_log |
||||
long_query_time=3 |
||||
slow_query_log_file=/data/logs/mariadb/mariadb-slow.log |
||||
log_queries_not_using_indexes=ON #Logging Queries That Don't Use Indexes |
||||
|
||||
|
||||
|
||||
#server_id=2 |
||||
log-bin=/data/logs/mariadb/mysql-bin |
||||
|
||||
# This group is only read by MariaDB-10.5 servers. |
||||
# If you use the same .cnf file for MariaDB of different versions, |
||||
# use this group for options that older servers don't understand |
||||
|
@ -0,0 +1,25 @@ |
||||
version: '3.2' |
||||
|
||||
|
||||
networks: |
||||
flyapps: |
||||
external: true |
||||
name: flyapps |
||||
|
||||
services: |
||||
redis: |
||||
image: 'bitnami/redis:6.2.7' |
||||
container_name: redis |
||||
restart: always |
||||
volumes: |
||||
- ../init/timezone:/etc/timezone:ro |
||||
- /etc/localtime:/etc/localtime:ro |
||||
- ../../data/redis:/bitnami/redis/data |
||||
environment: |
||||
#- REDIS_REPLICATION_MODE=master |
||||
#- ALLOW_EMPTY_PASSWORD=yes |
||||
- REDIS_PASSWORD=nineven |
||||
networks: |
||||
- flyapps |
||||
#ports: |
||||
# - 6379:6379 |
@ -0,0 +1,6 @@ |
||||
#!/bin/bash |
||||
# |
||||
# |
||||
|
||||
cd ../build/ |
||||
docker compose up buildclient buildadmin |
@ -0,0 +1,9 @@ |
||||
#!/bin/bash |
||||
# |
||||
# |
||||
|
||||
cd ../mariadb/ && docker compose up -d |
||||
cd ../redis/ && docker compose up -d |
||||
|
||||
cd ../flyapps/ && docker compose up -d |
||||
docker logs -f flyapps |
@ -0,0 +1,10 @@ |
||||
#!/bin/bash |
||||
# |
||||
# |
||||
|
||||
|
||||
cd ../flyapps/ && docker compose down |
||||
|
||||
cd ../redis/ && docker compose down |
||||
|
||||
cd ../mariadb/ && docker compose down |
@ -0,0 +1,14 @@ |
||||
# http://editorconfig.org |
||||
root = true |
||||
|
||||
[*] |
||||
charset = utf-8 |
||||
indent_style = space |
||||
indent_size = 2 |
||||
end_of_line = lf |
||||
insert_final_newline = true |
||||
trim_trailing_whitespace = true |
||||
|
||||
[*.md] |
||||
insert_final_newline = false |
||||
trim_trailing_whitespace = false |
@ -0,0 +1,6 @@ |
||||
# just a flag |
||||
ENV = 'development' |
||||
|
||||
# base api |
||||
VUE_APP_BASE_API = 'https://flyapps.cn/api/v3/fir/server' |
||||
#VUE_APP_BASE_API = 'https://app.hehelucky.cn/api/v3/fir/server' |
@ -0,0 +1,6 @@ |
||||
# just a flag |
||||
ENV = 'production' |
||||
|
||||
# base api |
||||
VUE_APP_BASE_API = '/api/v3/fir/server' |
||||
|
@ -0,0 +1,8 @@ |
||||
NODE_ENV = production |
||||
|
||||
# just a flag |
||||
ENV = 'staging' |
||||
|
||||
# base api |
||||
VUE_APP_BASE_API = '/stage-api' |
||||
|
@ -0,0 +1,4 @@ |
||||
build/*.js |
||||
src/assets |
||||
public |
||||
dist |
@ -0,0 +1,198 @@ |
||||
module.exports = { |
||||
root: true, |
||||
parserOptions: { |
||||
parser: 'babel-eslint', |
||||
sourceType: 'module' |
||||
}, |
||||
env: { |
||||
browser: true, |
||||
node: true, |
||||
es6: true, |
||||
}, |
||||
extends: ['plugin:vue/recommended', 'eslint:recommended'], |
||||
|
||||
// add your custom rules here
|
||||
//it is base on https://github.com/vuejs/eslint-config-vue
|
||||
rules: { |
||||
"vue/max-attributes-per-line": [2, { |
||||
"singleline": 10, |
||||
"multiline": { |
||||
"max": 1, |
||||
"allowFirstLine": false |
||||
} |
||||
}], |
||||
"vue/singleline-html-element-content-newline": "off", |
||||
"vue/multiline-html-element-content-newline":"off", |
||||
"vue/name-property-casing": ["error", "PascalCase"], |
||||
"vue/no-v-html": "off", |
||||
'accessor-pairs': 2, |
||||
'arrow-spacing': [2, { |
||||
'before': true, |
||||
'after': true |
||||
}], |
||||
'block-spacing': [2, 'always'], |
||||
'brace-style': [2, '1tbs', { |
||||
'allowSingleLine': true |
||||
}], |
||||
'camelcase': [0, { |
||||
'properties': 'always' |
||||
}], |
||||
'comma-dangle': [2, 'never'], |
||||
'comma-spacing': [2, { |
||||
'before': false, |
||||
'after': true |
||||
}], |
||||
'comma-style': [2, 'last'], |
||||
'constructor-super': 2, |
||||
'curly': [2, 'multi-line'], |
||||
'dot-location': [2, 'property'], |
||||
'eol-last': 2, |
||||
'eqeqeq': ["error", "always", {"null": "ignore"}], |
||||
'generator-star-spacing': [2, { |
||||
'before': true, |
||||
'after': true |
||||
}], |
||||
'handle-callback-err': [2, '^(err|error)$'], |
||||
'indent': [2, 2, { |
||||
'SwitchCase': 1 |
||||
}], |
||||
'jsx-quotes': [2, 'prefer-single'], |
||||
'key-spacing': [2, { |
||||
'beforeColon': false, |
||||
'afterColon': true |
||||
}], |
||||
'keyword-spacing': [2, { |
||||
'before': true, |
||||
'after': true |
||||
}], |
||||
'new-cap': [2, { |
||||
'newIsCap': true, |
||||
'capIsNew': false |
||||
}], |
||||
'new-parens': 2, |
||||
'no-array-constructor': 2, |
||||
'no-caller': 2, |
||||
'no-console': 'off', |
||||
'no-class-assign': 2, |
||||
'no-cond-assign': 2, |
||||
'no-const-assign': 2, |
||||
'no-control-regex': 0, |
||||
'no-delete-var': 2, |
||||
'no-dupe-args': 2, |
||||
'no-dupe-class-members': 2, |
||||
'no-dupe-keys': 2, |
||||
'no-duplicate-case': 2, |
||||
'no-empty-character-class': 2, |
||||
'no-empty-pattern': 2, |
||||
'no-eval': 2, |
||||
'no-ex-assign': 2, |
||||
'no-extend-native': 2, |
||||
'no-extra-bind': 2, |
||||
'no-extra-boolean-cast': 2, |
||||
'no-extra-parens': [2, 'functions'], |
||||
'no-fallthrough': 2, |
||||
'no-floating-decimal': 2, |
||||
'no-func-assign': 2, |
||||
'no-implied-eval': 2, |
||||
'no-inner-declarations': [2, 'functions'], |
||||
'no-invalid-regexp': 2, |
||||
'no-irregular-whitespace': 2, |
||||
'no-iterator': 2, |
||||
'no-label-var': 2, |
||||
'no-labels': [2, { |
||||
'allowLoop': false, |
||||
'allowSwitch': false |
||||
}], |
||||
'no-lone-blocks': 2, |
||||
'no-mixed-spaces-and-tabs': 2, |
||||
'no-multi-spaces': 2, |
||||
'no-multi-str': 2, |
||||
'no-multiple-empty-lines': [2, { |
||||
'max': 1 |
||||
}], |
||||
'no-native-reassign': 2, |
||||
'no-negated-in-lhs': 2, |
||||
'no-new-object': 2, |
||||
'no-new-require': 2, |
||||
'no-new-symbol': 2, |
||||
'no-new-wrappers': 2, |
||||
'no-obj-calls': 2, |
||||
'no-octal': 2, |
||||
'no-octal-escape': 2, |
||||
'no-path-concat': 2, |
||||
'no-proto': 2, |
||||
'no-redeclare': 2, |
||||
'no-regex-spaces': 2, |
||||
'no-return-assign': [2, 'except-parens'], |
||||
'no-self-assign': 2, |
||||
'no-self-compare': 2, |
||||
'no-sequences': 2, |
||||
'no-shadow-restricted-names': 2, |
||||
'no-spaced-func': 2, |
||||
'no-sparse-arrays': 2, |
||||
'no-this-before-super': 2, |
||||
'no-throw-literal': 2, |
||||
'no-trailing-spaces': 2, |
||||
'no-undef': 2, |
||||
'no-undef-init': 2, |
||||
'no-unexpected-multiline': 2, |
||||
'no-unmodified-loop-condition': 2, |
||||
'no-unneeded-ternary': [2, { |
||||
'defaultAssignment': false |
||||
}], |
||||
'no-unreachable': 2, |
||||
'no-unsafe-finally': 2, |
||||
'no-unused-vars': [2, { |
||||
'vars': 'all', |
||||
'args': 'none' |
||||
}], |
||||
'no-useless-call': 2, |
||||
'no-useless-computed-key': 2, |
||||
'no-useless-constructor': 2, |
||||
'no-useless-escape': 0, |
||||
'no-whitespace-before-property': 2, |
||||
'no-with': 2, |
||||
'one-var': [2, { |
||||
'initialized': 'never' |
||||
}], |
||||
'operator-linebreak': [2, 'after', { |
||||
'overrides': { |
||||
'?': 'before', |
||||
':': 'before' |
||||
} |
||||
}], |
||||
'padded-blocks': [2, 'never'], |
||||
'quotes': [2, 'single', { |
||||
'avoidEscape': true, |
||||
'allowTemplateLiterals': true |
||||
}], |
||||
'semi': [2, 'never'], |
||||
'semi-spacing': [2, { |
||||
'before': false, |
||||
'after': true |
||||
}], |
||||
'space-before-blocks': [2, 'always'], |
||||
'space-before-function-paren': [2, 'never'], |
||||
'space-in-parens': [2, 'never'], |
||||
'space-infix-ops': 2, |
||||
'space-unary-ops': [2, { |
||||
'words': true, |
||||
'nonwords': false |
||||
}], |
||||
'spaced-comment': [2, 'always', { |
||||
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ','] |
||||
}], |
||||
'template-curly-spacing': [2, 'never'], |
||||
'use-isnan': 2, |
||||
'valid-typeof': 2, |
||||
'wrap-iife': [2, 'any'], |
||||
'yield-star-spacing': [2, 'both'], |
||||
'yoda': [2, 'never'], |
||||
'prefer-const': 2, |
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, |
||||
'object-curly-spacing': [2, 'always', { |
||||
objectsInObjects: false |
||||
}], |
||||
'array-bracket-spacing': [2, 'never'] |
||||
} |
||||
} |
@ -0,0 +1,16 @@ |
||||
.DS_Store |
||||
node_modules/ |
||||
dist/ |
||||
npm-debug.log* |
||||
yarn-debug.log* |
||||
yarn-error.log* |
||||
package-lock.json |
||||
tests/**/coverage/ |
||||
|
||||
# Editor directories and files |
||||
.idea |
||||
.vscode |
||||
*.suo |
||||
*.ntvs* |
||||
*.njsproj |
||||
*.sln |
@ -0,0 +1,5 @@ |
||||
language: node_js |
||||
node_js: 10 |
||||
script: npm run test |
||||
notifications: |
||||
email: false |
@ -0,0 +1,21 @@ |
||||
MIT License |
||||
|
||||
Copyright (c) 2017-present PanJiaChen |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
of this software and associated documentation files (the "Software"), to deal |
||||
in the Software without restriction, including without limitation the rights |
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
copies of the Software, and to permit persons to whom the Software is |
||||
furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included in all |
||||
copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||
SOFTWARE. |
@ -0,0 +1,102 @@ |
||||
# vue-admin-template |
||||
|
||||
> 这是一个极简的 vue admin 管理后台。它只包含了 Element UI & axios & iconfont & permission control & lint,这些搭建后台必要的东西。 |
||||
|
||||
[线上地址](http://panjiachen.github.io/vue-admin-template) |
||||
|
||||
[国内访问](https://panjiachen.gitee.io/vue-admin-template) |
||||
|
||||
目前版本为 `v4.0+` 基于 `vue-cli` 进行构建,若你想使用旧版本,可以切换分支到[tag/3.11.0](https://github.com/PanJiaChen/vue-admin-template/tree/tag/3.11.0),它不依赖 `vue-cli`。 |
||||
|
||||
## Extra |
||||
|
||||
如果你想要根据用户角色来动态生成侧边栏和 router,你可以使用该分支[permission-control](https://github.com/PanJiaChen/vue-admin-template/tree/permission-control) |
||||
|
||||
## 相关项目 |
||||
|
||||
- [vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) |
||||
|
||||
- [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin) |
||||
|
||||
- [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) |
||||
|
||||
- [awesome-project](https://github.com/PanJiaChen/vue-element-admin/issues/2312) |
||||
|
||||
写了一个系列的教程配套文章,如何从零构建后一个完整的后台项目: |
||||
|
||||
- [手摸手,带你用 vue 撸后台 系列一(基础篇)](https://juejin.im/post/59097cd7a22b9d0065fb61d2) |
||||
- [手摸手,带你用 vue 撸后台 系列二(登录权限篇)](https://juejin.im/post/591aa14f570c35006961acac) |
||||
- [手摸手,带你用 vue 撸后台 系列三 (实战篇)](https://juejin.im/post/593121aa0ce4630057f70d35) |
||||
- [手摸手,带你用 vue 撸后台 系列四(vueAdmin 一个极简的后台基础模板,专门针对本项目的文章,算作是一篇文档)](https://juejin.im/post/595b4d776fb9a06bbe7dba56) |
||||
- [手摸手,带你封装一个 vue component](https://segmentfault.com/a/1190000009090836) |
||||
|
||||
## Build Setup |
||||
|
||||
```bash |
||||
# 克隆项目 |
||||
git clone https://github.com/PanJiaChen/vue-admin-template.git |
||||
|
||||
# 进入项目目录 |
||||
cd vue-admin-template |
||||
|
||||
# 安装依赖 |
||||
npm install |
||||
|
||||
# 建议不要直接使用 cnpm 安装以来,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 |
||||
npm install --registry=https://registry.npm.taobao.org |
||||
|
||||
# 启动服务 |
||||
npm run dev |
||||
``` |
||||
|
||||
浏览器访问 [http://localhost:9528](http://localhost:9528) |
||||
|
||||
## 发布 |
||||
|
||||
```bash |
||||
# 构建测试环境 |
||||
npm run build:stage |
||||
|
||||
# 构建生产环境 |
||||
npm run build:prod |
||||
``` |
||||
|
||||
## 其它 |
||||
|
||||
```bash |
||||
# 预览发布环境效果 |
||||
npm run preview |
||||
|
||||
# 预览发布环境效果 + 静态资源分析 |
||||
npm run preview -- --report |
||||
|
||||
# 代码格式检查 |
||||
npm run lint |
||||
|
||||
# 代码格式检查并自动修复 |
||||
npm run lint -- --fix |
||||
``` |
||||
|
||||
更多信息请参考 [使用文档](https://panjiachen.github.io/vue-element-admin-site/zh/) |
||||
|
||||
## 购买贴纸 |
||||
|
||||
你也可以通过 购买[官方授权的贴纸](https://smallsticker.com/product/vue-element-admin) 的方式来支持 vue-element-admin - 每售出一张贴纸,我们将获得 2 元的捐赠。 |
||||
|
||||
## Demo |
||||
|
||||
![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif) |
||||
|
||||
## Browsers support |
||||
|
||||
Modern browsers and Internet Explorer 10+. |
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | |
||||
| --------- | --------- | --------- | --------- | |
||||
| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions |
||||
|
||||
## License |
||||
|
||||
[MIT](https://github.com/PanJiaChen/vue-admin-template/blob/master/LICENSE) license. |
||||
|
||||
Copyright (c) 2017-present PanJiaChen |
@ -0,0 +1,91 @@ |
||||
# vue-admin-template |
||||
|
||||
English | [简体中文](./README-zh.md) |
||||
|
||||
> A minimal vue admin template with Element UI & axios & iconfont & permission control & lint |
||||
|
||||
**Live demo:** http://panjiachen.github.io/vue-admin-template |
||||
|
||||
|
||||
**The current version is `v4.0+` build on `vue-cli`. If you want to use the old version , you can switch branch to [tag/3.11.0](https://github.com/PanJiaChen/vue-admin-template/tree/tag/3.11.0), it does not rely on `vue-cli`** |
||||
|
||||
## Build Setup |
||||
|
||||
|
||||
```bash |
||||
# clone the project |
||||
git clone https://github.com/PanJiaChen/vue-admin-template.git |
||||
|
||||
# enter the project directory |
||||
cd vue-admin-template |
||||
|
||||
# install dependency |
||||
npm install |
||||
|
||||
# develop |
||||
npm run dev |
||||
``` |
||||
|
||||
This will automatically open http://localhost:9528 |
||||
|
||||
## Build |
||||
|
||||
```bash |
||||
# build for test environment |
||||
npm run build:stage |
||||
|
||||
# build for production environment |
||||
npm run build:prod |
||||
``` |
||||
|
||||
## Advanced |
||||
|
||||
```bash |
||||
# preview the release environment effect |
||||
npm run preview |
||||
|
||||
# preview the release environment effect + static resource analysis |
||||
npm run preview -- --report |
||||
|
||||
# code format check |
||||
npm run lint |
||||
|
||||
# code format check and auto fix |
||||
npm run lint -- --fix |
||||
``` |
||||
|
||||
Refer to [Documentation](https://panjiachen.github.io/vue-element-admin-site/guide/essentials/deploy.html) for more information |
||||
|
||||
## Demo |
||||
|
||||
![demo](https://github.com/PanJiaChen/PanJiaChen.github.io/blob/master/images/demo.gif) |
||||
|
||||
## Extra |
||||
|
||||
If you want router permission && generate menu by user roles , you can use this branch [permission-control](https://github.com/PanJiaChen/vue-admin-template/tree/permission-control) |
||||
|
||||
For `typescript` version, you can use [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (Credits: [@Armour](https://github.com/Armour)) |
||||
|
||||
## Related Project |
||||
|
||||
- [vue-element-admin](https://github.com/PanJiaChen/vue-element-admin) |
||||
|
||||
- [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin) |
||||
|
||||
- [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) |
||||
|
||||
- [awesome-project](https://github.com/PanJiaChen/vue-element-admin/issues/2312) |
||||
|
||||
## Browsers support |
||||
|
||||
Modern browsers and Internet Explorer 10+. |
||||
|
||||
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | |
||||
| --------- | --------- | --------- | --------- | |
||||
| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions |
||||
|
||||
## License |
||||
|
||||
[MIT](https://github.com/PanJiaChen/vue-admin-template/blob/master/LICENSE) license. |
||||
|
||||
Copyright (c) 2017-present PanJiaChen |
@ -0,0 +1,14 @@ |
||||
module.exports = { |
||||
presets: [ |
||||
// https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
|
||||
'@vue/cli-plugin-babel/preset' |
||||
], |
||||
'env': { |
||||
'development': { |
||||
// babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
|
||||
// This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
|
||||
// https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html
|
||||
'plugins': ['dynamic-import-node'] |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,35 @@ |
||||
const { run } = require('runjs') |
||||
const chalk = require('chalk') |
||||
const config = require('../vue.config.js') |
||||
const rawArgv = process.argv.slice(2) |
||||
const args = rawArgv.join(' ') |
||||
|
||||
if (process.env.npm_config_preview || rawArgv.includes('--preview')) { |
||||
const report = rawArgv.includes('--report') |
||||
|
||||
run(`vue-cli-service build ${args}`) |
||||
|
||||
const port = 9526 |
||||
const publicPath = config.publicPath |
||||
|
||||
var connect = require('connect') |
||||
var serveStatic = require('serve-static') |
||||
const app = connect() |
||||
|
||||
app.use( |
||||
publicPath, |
||||
serveStatic('./dist', { |
||||
index: ['index.html', '/'] |
||||
}) |
||||
) |
||||
|
||||
app.listen(port, function () { |
||||
console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`)) |
||||
if (report) { |
||||
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`)) |
||||
} |
||||
|
||||
}) |
||||
} else { |
||||
run(`vue-cli-service build ${args}`) |
||||
} |
@ -0,0 +1,24 @@ |
||||
module.exports = { |
||||
moduleFileExtensions: ['js', 'jsx', 'json', 'vue'], |
||||
transform: { |
||||
'^.+\\.vue$': 'vue-jest', |
||||
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': |
||||
'jest-transform-stub', |
||||
'^.+\\.jsx?$': 'babel-jest' |
||||
}, |
||||
moduleNameMapper: { |
||||
'^@/(.*)$': '<rootDir>/src/$1' |
||||
}, |
||||
snapshotSerializers: ['jest-serializer-vue'], |
||||
testMatch: [ |
||||
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' |
||||
], |
||||
collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'], |
||||
coverageDirectory: '<rootDir>/tests/unit/coverage', |
||||
// 'collectCoverage': true,
|
||||
'coverageReporters': [ |
||||
'lcov', |
||||
'text-summary' |
||||
], |
||||
testURL: 'http://localhost/' |
||||
} |
@ -0,0 +1,9 @@ |
||||
{ |
||||
"compilerOptions": { |
||||
"baseUrl": "./", |
||||
"paths": { |
||||
"@/*": ["src/*"] |
||||
} |
||||
}, |
||||
"exclude": ["node_modules", "dist"] |
||||
} |
@ -0,0 +1,57 @@ |
||||
const Mock = require('mockjs') |
||||
const { param2Obj } = require('./utils') |
||||
|
||||
const user = require('./user') |
||||
const table = require('./table') |
||||
|
||||
const mocks = [ |
||||
...user, |
||||
...table |
||||
] |
||||
|
||||
// for front mock
|
||||
// please use it cautiously, it will redefine XMLHttpRequest,
|
||||
// which will cause many of your third-party libraries to be invalidated(like progress event).
|
||||
function mockXHR() { |
||||
// mock patch
|
||||
// https://github.com/nuysoft/Mock/issues/300
|
||||
Mock.XHR.prototype.proxy_send = Mock.XHR.prototype.send |
||||
Mock.XHR.prototype.send = function() { |
||||
if (this.custom.xhr) { |
||||
this.custom.xhr.withCredentials = this.withCredentials || false |
||||
|
||||
if (this.responseType) { |
||||
this.custom.xhr.responseType = this.responseType |
||||
} |
||||
} |
||||
this.proxy_send(...arguments) |
||||
} |
||||
|
||||
function XHR2ExpressReqWrap(respond) { |
||||
return function(options) { |
||||
let result = null |
||||
if (respond instanceof Function) { |
||||
const { body, type, url } = options |
||||
// https://expressjs.com/en/4x/api.html#req
|
||||
result = respond({ |
||||
method: type, |
||||
body: JSON.parse(body), |
||||
query: param2Obj(url) |
||||
}) |
||||
} else { |
||||
result = respond |
||||
} |
||||
return Mock.mock(result) |
||||
} |
||||
} |
||||
|
||||
for (const i of mocks) { |
||||
Mock.mock(new RegExp(i.url), i.type || 'get', XHR2ExpressReqWrap(i.response)) |
||||
} |
||||
} |
||||
|
||||
module.exports = { |
||||
mocks, |
||||
mockXHR |
||||
} |
||||
|
@ -0,0 +1,81 @@ |
||||
const chokidar = require('chokidar') |
||||
const bodyParser = require('body-parser') |
||||
const chalk = require('chalk') |
||||
const path = require('path') |
||||
const Mock = require('mockjs') |
||||
|
||||
const mockDir = path.join(process.cwd(), 'mock') |
||||
|
||||
function registerRoutes(app) { |
||||
let mockLastIndex |
||||
const { mocks } = require('./index.js') |
||||
const mocksForServer = mocks.map(route => { |
||||
return responseFake(route.url, route.type, route.response) |
||||
}) |
||||
for (const mock of mocksForServer) { |
||||
app[mock.type](mock.url, mock.response) |
||||
mockLastIndex = app._router.stack.length |
||||
} |
||||
const mockRoutesLength = Object.keys(mocksForServer).length |
||||
return { |
||||
mockRoutesLength: mockRoutesLength, |
||||
mockStartIndex: mockLastIndex - mockRoutesLength |
||||
} |
||||
} |
||||
|
||||
function unregisterRoutes() { |
||||
Object.keys(require.cache).forEach(i => { |
||||
if (i.includes(mockDir)) { |
||||
delete require.cache[require.resolve(i)] |
||||
} |
||||
}) |
||||
} |
||||
|
||||
// for mock server
|
||||
const responseFake = (url, type, respond) => { |
||||
return { |
||||
url: new RegExp(`${process.env.VUE_APP_BASE_API}${url}`), |
||||
type: type || 'get', |
||||
response(req, res) { |
||||
console.log('request invoke:' + req.path) |
||||
res.json(Mock.mock(respond instanceof Function ? respond(req, res) : respond)) |
||||
} |
||||
} |
||||
} |
||||
|
||||
module.exports = app => { |
||||
// parse app.body
|
||||
// https://expressjs.com/en/4x/api.html#req.body
|
||||
app.use(bodyParser.json()) |
||||
app.use(bodyParser.urlencoded({ |
||||
extended: true |
||||
})) |
||||
|
||||
const mockRoutes = registerRoutes(app) |
||||
var mockRoutesLength = mockRoutes.mockRoutesLength |
||||
var mockStartIndex = mockRoutes.mockStartIndex |
||||
|
||||
// watch files, hot reload mock server
|
||||
chokidar.watch(mockDir, { |
||||
ignored: /mock-server/, |
||||
ignoreInitial: true |
||||
}).on('all', (event, path) => { |
||||
if (event === 'change' || event === 'add') { |
||||
try { |
||||
// remove mock routes stack
|
||||
app._router.stack.splice(mockStartIndex, mockRoutesLength) |
||||
|
||||
// clear routes cache
|
||||
unregisterRoutes() |
||||
|
||||
const mockRoutes = registerRoutes(app) |
||||
mockRoutesLength = mockRoutes.mockRoutesLength |
||||
mockStartIndex = mockRoutes.mockStartIndex |
||||
|
||||
console.log(chalk.magentaBright(`\n > Mock Server hot reload success! changed ${path}`)) |
||||
} catch (error) { |
||||
console.log(chalk.redBright(error)) |
||||
} |
||||
} |
||||
}) |
||||
} |
@ -0,0 +1,29 @@ |
||||
const Mock = require('mockjs') |
||||
|
||||
const data = Mock.mock({ |
||||
'items|30': [{ |
||||
id: '@id', |
||||
title: '@sentence(10, 20)', |
||||
'status|1': ['published', 'draft', 'deleted'], |
||||
author: 'name', |
||||
display_time: '@datetime', |
||||
pageviews: '@integer(300, 5000)' |
||||
}] |
||||
}) |
||||
|
||||
module.exports = [ |
||||
{ |
||||
url: '/vue-admin-template/table/list', |
||||
type: 'get', |
||||
response: config => { |
||||
const items = data.items |
||||
return { |
||||
code: 20000, |
||||
data: { |
||||
total: items.length, |
||||
items: items |
||||
} |
||||
} |
||||
} |
||||
} |
||||
] |
@ -0,0 +1,84 @@ |
||||
|
||||
const tokens = { |
||||
admin: { |
||||
token: 'admin-token' |
||||
}, |
||||
editor: { |
||||
token: 'editor-token' |
||||
} |
||||
} |
||||
|
||||
const users = { |
||||
'admin-token': { |
||||
roles: ['admin'], |
||||
introduction: 'I am a super administrator', |
||||
avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif', |
||||
name: 'Super Admin' |
||||
}, |
||||
'editor-token': { |
||||
roles: ['editor'], |
||||
introduction: 'I am an editor', |
||||
avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif', |
||||
name: 'Normal Editor' |
||||
} |
||||
} |
||||
|
||||
module.exports = [ |
||||
// user login
|
||||
{ |
||||
url: '/vue-admin-template/user/login', |
||||
type: 'post', |
||||
response: config => { |
||||
const { username } = config.body |
||||
const token = tokens[username] |
||||
|
||||
// mock error
|
||||
if (!token) { |
||||
return { |
||||
code: 60204, |
||||
message: 'Account and password are incorrect.' |
||||
} |
||||
} |
||||
|
||||
return { |
||||
code: 20000, |
||||
data: token |
||||
} |
||||
} |
||||
}, |
||||
|
||||
// get user info
|
||||
{ |
||||
url: '/vue-admin-template/user/info\.*', |
||||
type: 'get', |
||||
response: config => { |
||||
const { token } = config.query |
||||
const info = users[token] |
||||
|
||||
// mock error
|
||||
if (!info) { |
||||
return { |
||||
code: 50008, |
||||
message: 'Login failed, unable to get user details.' |
||||
} |
||||
} |
||||
|
||||
return { |
||||
code: 20000, |
||||
data: info |
||||
} |
||||
} |
||||
}, |
||||
|
||||
// user logout
|
||||
{ |
||||
url: '/vue-admin-template/user/logout', |
||||
type: 'post', |
||||
response: _ => { |
||||
return { |
||||
code: 20000, |
||||
data: 'success' |
||||
} |
||||
} |
||||
} |
||||
] |
@ -0,0 +1,25 @@ |
||||
/** |
||||
* @param {string} url |
||||
* @returns {Object} |
||||
*/ |
||||
function param2Obj(url) { |
||||
const search = decodeURIComponent(url.split('?')[1]).replace(/\+/g, ' ') |
||||
if (!search) { |
||||
return {} |
||||
} |
||||
const obj = {} |
||||
const searchArr = search.split('&') |
||||
searchArr.forEach(v => { |
||||
const index = v.indexOf('=') |
||||
if (index !== -1) { |
||||
const name = v.substring(0, index) |
||||
const val = v.substring(index + 1, v.length) |
||||
obj[name] = val |
||||
} |
||||
}) |
||||
return obj |
||||
} |
||||
|
||||
module.exports = { |
||||
param2Obj |
||||
} |
@ -0,0 +1,63 @@ |
||||
{ |
||||
"name": "fir_admin", |
||||
"version": "1.1.0", |
||||
"description": "fir admin", |
||||
"author": "nineven@qq.com", |
||||
"scripts": { |
||||
"dev": "vue-cli-service serve", |
||||
"build:prod": "vue-cli-service build", |
||||
"build:stage": "vue-cli-service build --mode staging", |
||||
"preview": "node build/index.js --preview", |
||||
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml", |
||||
"lint": "eslint --ext .js,.vue src", |
||||
"test:unit": "jest --clearCache && vue-cli-service test:unit", |
||||
"test:ci": "npm run lint && npm run test:unit" |
||||
}, |
||||
"dependencies": { |
||||
"axios": "0.18.1", |
||||
"core-js": "3.6.5", |
||||
"element-ui": "2.13.2", |
||||
"js-base64": "2.5.2", |
||||
"js-cookie": "2.2.0", |
||||
"normalize.css": "7.0.0", |
||||
"nprogress": "0.2.0", |
||||
"path-to-regexp": "2.4.0", |
||||
"vue": "2.6.10", |
||||
"vue-router": "3.0.6", |
||||
"vuex": "3.1.0" |
||||
}, |
||||
"devDependencies": { |
||||
"@vue/cli-plugin-babel": "4.4.4", |
||||
"@vue/cli-plugin-eslint": "4.4.4", |
||||
"@vue/cli-plugin-unit-jest": "4.4.4", |
||||
"@vue/cli-service": "4.4.4", |
||||
"@vue/test-utils": "1.0.0-beta.29", |
||||
"autoprefixer": "9.5.1", |
||||
"babel-eslint": "10.1.0", |
||||
"babel-jest": "23.6.0", |
||||
"babel-plugin-dynamic-import-node": "2.3.3", |
||||
"chalk": "2.4.2", |
||||
"connect": "3.6.6", |
||||
"eslint": "6.7.2", |
||||
"eslint-plugin-vue": "6.2.2", |
||||
"html-webpack-plugin": "3.2.0", |
||||
"mockjs": "1.0.1-beta3", |
||||
"runjs": "4.3.2", |
||||
"sass": "1.26.8", |
||||
"sass-loader": "8.0.2", |
||||
"script-ext-html-webpack-plugin": "2.1.3", |
||||
"serve-static": "1.13.2", |
||||
"svg-sprite-loader": "4.1.3", |
||||
"svgo": "1.2.2", |
||||
"vue-template-compiler": "2.6.10" |
||||
}, |
||||
"browserslist": [ |
||||
"> 1%", |
||||
"last 2 versions" |
||||
], |
||||
"engines": { |
||||
"node": ">=8.9", |
||||
"npm": ">= 3.0.0" |
||||
}, |
||||
"license": "MIT" |
||||
} |
@ -0,0 +1,8 @@ |
||||
// https://github.com/michael-ciniawsky/postcss-load-config
|
||||
|
||||
module.exports = { |
||||
'plugins': { |
||||
// to edit target browsers: use "browserslist" field in package.json
|
||||
'autoprefixer': {} |
||||
} |
||||
} |
After Width: | Height: | Size: 66 KiB |
@ -0,0 +1,17 @@ |
||||
<!DOCTYPE html> |
||||
<html> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> |
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> |
||||
<title><%= webpackConfig.name %></title> |
||||
</head> |
||||
<body> |
||||
<noscript> |
||||
<strong>We're sorry but <%= webpackConfig.name %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> |
||||
</noscript> |
||||
<div id="app"></div> |
||||
<!-- built files will be auto injected --> |
||||
</body> |
||||
</html> |
@ -0,0 +1,11 @@ |
||||
<template> |
||||
<div id="app"> |
||||
<router-view /> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
name: 'App' |
||||
} |
||||
</script> |
@ -0,0 +1,61 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
export function getAppList(query) { |
||||
return request({ |
||||
url: '/app/info', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
export function getAppInfos(pk) { |
||||
return request({ |
||||
url: '/app/info/' + pk, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
export function updateAppInfo(pk, data) { |
||||
return request({ |
||||
url: '/app/info/' + pk, |
||||
method: 'put', |
||||
data |
||||
}) |
||||
} |
||||
|
||||
export function deleteApp(pk) { |
||||
return request({ |
||||
url: '/app/info/' + pk, |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
export function getAppReleaseList(query) { |
||||
return request({ |
||||
url: '/app/release/info', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
export function getAppReleaseInfos(pk) { |
||||
return request({ |
||||
url: '/app/release/info/' + pk, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
export function updateReleaseAppInfo(pk, data) { |
||||
return request({ |
||||
url: '/app/release/info/' + pk, |
||||
method: 'put', |
||||
data |
||||
}) |
||||
} |
||||
export function downloadAppReleaseInfos(data) { |
||||
return request({ |
||||
url: '/app/release/info', |
||||
method: 'post', |
||||
data |
||||
}) |
||||
} |
@ -0,0 +1,54 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
export function getDeveloperList(query) { |
||||
return request({ |
||||
url: '/developer/info', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
export function getDeveloperInfo(pk) { |
||||
return request({ |
||||
url: '/developer/info/' + pk, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
export function updatedeveloperInfo(pk, data) { |
||||
return request({ |
||||
url: '/developer/info/' + pk, |
||||
method: 'put', |
||||
data |
||||
}) |
||||
} |
||||
|
||||
export function getBillList(query) { |
||||
return request({ |
||||
url: '/bill/info', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
export function addBillInfo(data) { |
||||
return request({ |
||||
url: '/bill/info', |
||||
method: 'post', |
||||
data |
||||
}) |
||||
} |
||||
export function delBillInfo(pk) { |
||||
return request({ |
||||
url: '/bill/info/' + pk, |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
|
||||
export function getUserBillInfo(query) { |
||||
return request({ |
||||
url: '/bill/userinfo', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
@ -0,0 +1,10 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
export function getDevicesList(query) { |
||||
return request({ |
||||
url: '/devices/info', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
@ -0,0 +1,31 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
export function getDomainList(query) { |
||||
return request({ |
||||
url: '/domain/info', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
export function getDomainInfos(pk) { |
||||
return request({ |
||||
url: '/domain/info/' + pk, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
export function updateDomainInfo(pk, data) { |
||||
return request({ |
||||
url: '/domain/info/' + pk, |
||||
method: 'put', |
||||
data |
||||
}) |
||||
} |
||||
|
||||
export function deleteDomain(pk) { |
||||
return request({ |
||||
url: '/domain/info/' + pk, |
||||
method: 'delete' |
||||
}) |
||||
} |
@ -0,0 +1,38 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
export function getOrderList(query) { |
||||
return request({ |
||||
url: '/order/info', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
export function getOrderInfo(pk) { |
||||
return request({ |
||||
url: '/order/info/' + pk, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
export function updateOrderInfo(pk, data) { |
||||
return request({ |
||||
url: '/order/info/' + pk, |
||||
method: 'put', |
||||
data |
||||
}) |
||||
} |
||||
export function deleteOrderInfo(pk) { |
||||
return request({ |
||||
url: '/order/info/' + pk, |
||||
method: 'delete' |
||||
}) |
||||
} |
||||
export function createOrderInfo(data) { |
||||
return request({ |
||||
url: '/order/info', |
||||
method: 'post', |
||||
data |
||||
}) |
||||
} |
||||
|
@ -0,0 +1,8 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
export function getToken() { |
||||
return request({ |
||||
url: '/qiniu/upload/token', // 假地址 自行替换
|
||||
method: 'get' |
||||
}) |
||||
} |
@ -0,0 +1,31 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
export function getAppReportList(query) { |
||||
return request({ |
||||
url: '/report/info', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
export function getAppReportIfo(pk) { |
||||
return request({ |
||||
url: '/report/info/' + pk, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
export function updateAppReportIfo(pk, data) { |
||||
return request({ |
||||
url: '/report/info/' + pk, |
||||
method: 'put', |
||||
data |
||||
}) |
||||
} |
||||
|
||||
export function deleteAppReportIfo(pk) { |
||||
return request({ |
||||
url: '/report/info/' + pk, |
||||
method: 'delete' |
||||
}) |
||||
} |
@ -0,0 +1,32 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
export function getStorageList(query) { |
||||
return request({ |
||||
url: '/storage/info', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
export function getStorageInfo(pk) { |
||||
return request({ |
||||
url: '/storage/info/' + pk, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
export function updateStorageInfo(pk, data) { |
||||
return request({ |
||||
url: '/storage/info/' + pk, |
||||
method: 'put', |
||||
data |
||||
}) |
||||
} |
||||
|
||||
export function changeStorageInfo(data) { |
||||
return request({ |
||||
url: '/storage/change', |
||||
method: 'put', |
||||
data |
||||
}) |
||||
} |
@ -0,0 +1,9 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
export function getList(params) { |
||||
return request({ |
||||
url: '/vue-admin-template/table/list', |
||||
method: 'get', |
||||
params |
||||
}) |
||||
} |
@ -0,0 +1,63 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
export function login(data) { |
||||
return request({ |
||||
url: '/login', |
||||
method: 'post', |
||||
data |
||||
}) |
||||
} |
||||
|
||||
export function getInfo(token) { |
||||
return request({ |
||||
url: '/user/info', |
||||
method: 'get', |
||||
params: { token } |
||||
}) |
||||
} |
||||
|
||||
export function logout() { |
||||
return request({ |
||||
url: '/user/logout', |
||||
method: 'post' |
||||
}) |
||||
} |
||||
|
||||
export function getUserInfos(query) { |
||||
return request({ |
||||
url: '/userinfo', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
export function updateUserInfo(data) { |
||||
return request({ |
||||
url: '/userinfo', |
||||
method: 'put', |
||||
data |
||||
}) |
||||
} |
||||
|
||||
export function getCertificationInfo(query) { |
||||
return request({ |
||||
url: '/certification/info', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
export function updateCertificationInfo(data) { |
||||
return request({ |
||||
url: '/certification/info', |
||||
method: 'put', |
||||
data |
||||
}) |
||||
} |
||||
|
||||
export function resetPassword(data) { |
||||
return request({ |
||||
url: '/user/info', |
||||
method: 'post', |
||||
data |
||||
}) |
||||
} |
@ -0,0 +1,31 @@ |
||||
import request from '@/utils/request' |
||||
|
||||
export function getWxBindList(query) { |
||||
return request({ |
||||
url: '/wxbind/info', |
||||
method: 'get', |
||||
params: query |
||||
}) |
||||
} |
||||
|
||||
export function getWxBindInfos(pk) { |
||||
return request({ |
||||
url: '/wxbind/info/' + pk, |
||||
method: 'get' |
||||
}) |
||||
} |
||||
|
||||
export function updateWxBindInfo(pk,data) { |
||||
return request({ |
||||
url: '/wxbind/info/' + pk, |
||||
method: 'put', |
||||
data |
||||
}) |
||||
} |
||||
|
||||
export function deleteWxBind(pk) { |
||||
return request({ |
||||
url: '/wxbind/info/' + pk, |
||||
method: 'delete' |
||||
}) |
||||
} |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 6.7 KiB |
@ -0,0 +1,78 @@ |
||||
<template> |
||||
<el-breadcrumb class="app-breadcrumb" separator="/"> |
||||
<transition-group name="breadcrumb"> |
||||
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path"> |
||||
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span> |
||||
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a> |
||||
</el-breadcrumb-item> |
||||
</transition-group> |
||||
</el-breadcrumb> |
||||
</template> |
||||
|
||||
<script> |
||||
import pathToRegexp from 'path-to-regexp' |
||||
|
||||
export default { |
||||
data() { |
||||
return { |
||||
levelList: null |
||||
} |
||||
}, |
||||
watch: { |
||||
$route() { |
||||
this.getBreadcrumb() |
||||
} |
||||
}, |
||||
created() { |
||||
this.getBreadcrumb() |
||||
}, |
||||
methods: { |
||||
getBreadcrumb() { |
||||
// only show routes with meta.title |
||||
let matched = this.$route.matched.filter(item => item.meta && item.meta.title) |
||||
const first = matched[0] |
||||
|
||||
if (!this.isDashboard(first)) { |
||||
matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched) |
||||
} |
||||
|
||||
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false) |
||||
}, |
||||
isDashboard(route) { |
||||
const name = route && route.name |
||||
if (!name) { |
||||
return false |
||||
} |
||||
return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase() |
||||
}, |
||||
pathCompile(path) { |
||||
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561 |
||||
const { params } = this.$route |
||||
var toPath = pathToRegexp.compile(path) |
||||
return toPath(params) |
||||
}, |
||||
handleLink(item) { |
||||
const { redirect, path } = item |
||||
if (redirect) { |
||||
this.$router.push(redirect) |
||||
return |
||||
} |
||||
this.$router.push(this.pathCompile(path)) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.app-breadcrumb.el-breadcrumb { |
||||
display: inline-block; |
||||
font-size: 14px; |
||||
line-height: 50px; |
||||
margin-left: 8px; |
||||
|
||||
.no-redirect { |
||||
color: #97a8be; |
||||
cursor: text; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,44 @@ |
||||
<template> |
||||
<div style="padding: 0 15px;" @click="toggleClick"> |
||||
<svg |
||||
:class="{'is-active':isActive}" |
||||
class="hamburger" |
||||
viewBox="0 0 1024 1024" |
||||
xmlns="http://www.w3.org/2000/svg" |
||||
width="64" |
||||
height="64" |
||||
> |
||||
<path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z" /> |
||||
</svg> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
name: 'Hamburger', |
||||
props: { |
||||
isActive: { |
||||
type: Boolean, |
||||
default: false |
||||
} |
||||
}, |
||||
methods: { |
||||
toggleClick() { |
||||
this.$emit('toggleClick') |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped> |
||||
.hamburger { |
||||
display: inline-block; |
||||
vertical-align: middle; |
||||
width: 20px; |
||||
height: 20px; |
||||
} |
||||
|
||||
.hamburger.is-active { |
||||
transform: rotate(180deg); |
||||
} |
||||
</style> |
@ -0,0 +1,101 @@ |
||||
<template> |
||||
<div :class="{'hidden':hidden}" class="pagination-container"> |
||||
<el-pagination |
||||
:background="background" |
||||
:current-page.sync="currentPage" |
||||
:page-size.sync="pageSize" |
||||
:layout="layout" |
||||
:page-sizes="pageSizes" |
||||
:total="total" |
||||
v-bind="$attrs" |
||||
@size-change="handleSizeChange" |
||||
@current-change="handleCurrentChange" |
||||
/> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { scrollTo } from '@/utils/scroll-to' |
||||
|
||||
export default { |
||||
name: 'Pagination', |
||||
props: { |
||||
total: { |
||||
required: true, |
||||
type: Number |
||||
}, |
||||
page: { |
||||
type: Number, |
||||
default: 1 |
||||
}, |
||||
limit: { |
||||
type: Number, |
||||
default: 20 |
||||
}, |
||||
pageSizes: { |
||||
type: Array, |
||||
default() { |
||||
return [10, 20, 30, 50] |
||||
} |
||||
}, |
||||
layout: { |
||||
type: String, |
||||
default: 'total, sizes, prev, pager, next, jumper' |
||||
}, |
||||
background: { |
||||
type: Boolean, |
||||
default: true |
||||
}, |
||||
autoScroll: { |
||||
type: Boolean, |
||||
default: true |
||||
}, |
||||
hidden: { |
||||
type: Boolean, |
||||
default: false |
||||
} |
||||
}, |
||||
computed: { |
||||
currentPage: { |
||||
get() { |
||||
return this.page |
||||
}, |
||||
set(val) { |
||||
this.$emit('update:page', val) |
||||
} |
||||
}, |
||||
pageSize: { |
||||
get() { |
||||
return this.limit |
||||
}, |
||||
set(val) { |
||||
this.$emit('update:limit', val) |
||||
} |
||||
} |
||||
}, |
||||
methods: { |
||||
handleSizeChange(val) { |
||||
this.$emit('pagination', { page: this.currentPage, limit: val }) |
||||
if (this.autoScroll) { |
||||
scrollTo(0, 800) |
||||
} |
||||
}, |
||||
handleCurrentChange(val) { |
||||
this.$emit('pagination', { page: val, limit: this.pageSize }) |
||||
if (this.autoScroll) { |
||||
scrollTo(0, 800) |
||||
} |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped> |
||||
.pagination-container { |
||||
background: #fff; |
||||
padding: 32px 16px; |
||||
} |
||||
.pagination-container.hidden { |
||||
display: none; |
||||
} |
||||
</style> |
@ -0,0 +1,91 @@ |
||||
<template> |
||||
<div :style="{height:height+'px',zIndex:zIndex}"> |
||||
<div |
||||
:class="className" |
||||
:style="{top:(isSticky ? stickyTop +'px' : ''),zIndex:zIndex,position:position,width:width,height:height+'px'}" |
||||
> |
||||
<slot> |
||||
<div>sticky</div> |
||||
</slot> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
name: 'Sticky', |
||||
props: { |
||||
stickyTop: { |
||||
type: Number, |
||||
default: 0 |
||||
}, |
||||
zIndex: { |
||||
type: Number, |
||||
default: 1 |
||||
}, |
||||
className: { |
||||
type: String, |
||||
default: '' |
||||
} |
||||
}, |
||||
data() { |
||||
return { |
||||
active: false, |
||||
position: '', |
||||
width: undefined, |
||||
height: undefined, |
||||
isSticky: false |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.height = this.$el.getBoundingClientRect().height |
||||
window.addEventListener('scroll', this.handleScroll) |
||||
window.addEventListener('resize', this.handleResize) |
||||
}, |
||||
activated() { |
||||
this.handleScroll() |
||||
}, |
||||
destroyed() { |
||||
window.removeEventListener('scroll', this.handleScroll) |
||||
window.removeEventListener('resize', this.handleResize) |
||||
}, |
||||
methods: { |
||||
sticky() { |
||||
if (this.active) { |
||||
return |
||||
} |
||||
this.position = 'fixed' |
||||
this.active = true |
||||
this.width = this.width + 'px' |
||||
this.isSticky = true |
||||
}, |
||||
handleReset() { |
||||
if (!this.active) { |
||||
return |
||||
} |
||||
this.reset() |
||||
}, |
||||
reset() { |
||||
this.position = '' |
||||
this.width = 'auto' |
||||
this.active = false |
||||
this.isSticky = false |
||||
}, |
||||
handleScroll() { |
||||
const width = this.$el.getBoundingClientRect().width |
||||
this.width = width || 'auto' |
||||
const offsetTop = this.$el.getBoundingClientRect().top |
||||
if (offsetTop < this.stickyTop) { |
||||
this.sticky() |
||||
return |
||||
} |
||||
this.handleReset() |
||||
}, |
||||
handleResize() { |
||||
if (this.isSticky) { |
||||
this.width = this.$el.getBoundingClientRect().width + 'px' |
||||
} |
||||
} |
||||
} |
||||
} |
||||
</script> |
@ -0,0 +1,62 @@ |
||||
<template> |
||||
<div v-if="isExternal" :style="styleExternalIcon" class="svg-external-icon svg-icon" v-on="$listeners" /> |
||||
<svg v-else :class="svgClass" aria-hidden="true" v-on="$listeners"> |
||||
<use :xlink:href="iconName" /> |
||||
</svg> |
||||
</template> |
||||
|
||||
<script> |
||||
// doc: https://panjiachen.github.io/vue-element-admin-site/feature/component/svg-icon.html#usage |
||||
import { isExternal } from '@/utils/validate' |
||||
|
||||
export default { |
||||
name: 'SvgIcon', |
||||
props: { |
||||
iconClass: { |
||||
type: String, |
||||
required: true |
||||
}, |
||||
className: { |
||||
type: String, |
||||
default: '' |
||||
} |
||||
}, |
||||
computed: { |
||||
isExternal() { |
||||
return isExternal(this.iconClass) |
||||
}, |
||||
iconName() { |
||||
return `#icon-${this.iconClass}` |
||||
}, |
||||
svgClass() { |
||||
if (this.className) { |
||||
return 'svg-icon ' + this.className |
||||
} else { |
||||
return 'svg-icon' |
||||
} |
||||
}, |
||||
styleExternalIcon() { |
||||
return { |
||||
mask: `url(${this.iconClass}) no-repeat 50% 50%`, |
||||
'-webkit-mask': `url(${this.iconClass}) no-repeat 50% 50%` |
||||
} |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style scoped> |
||||
.svg-icon { |
||||
width: 1em; |
||||
height: 1em; |
||||
vertical-align: -0.15em; |
||||
fill: currentColor; |
||||
overflow: hidden; |
||||
} |
||||
|
||||
.svg-external-icon { |
||||
background-color: currentColor; |
||||
mask-size: cover!important; |
||||
display: inline-block; |
||||
} |
||||
</style> |
@ -0,0 +1,111 @@ |
||||
<template> |
||||
<div class="upload-container"> |
||||
<el-button :style="{background:color,borderColor:color}" icon="el-icon-upload" size="mini" type="primary" @click=" dialogVisible=true"> |
||||
upload |
||||
</el-button> |
||||
<el-dialog :visible.sync="dialogVisible"> |
||||
<el-upload |
||||
:multiple="true" |
||||
:file-list="fileList" |
||||
:show-file-list="true" |
||||
:on-remove="handleRemove" |
||||
:on-success="handleSuccess" |
||||
:before-upload="beforeUpload" |
||||
class="editor-slide-upload" |
||||
action="https://httpbin.org/post" |
||||
list-type="picture-card" |
||||
> |
||||
<el-button size="small" type="primary"> |
||||
Click upload |
||||
</el-button> |
||||
</el-upload> |
||||
<el-button @click="dialogVisible = false"> |
||||
Cancel |
||||
</el-button> |
||||
<el-button type="primary" @click="handleSubmit"> |
||||
Confirm |
||||
</el-button> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
// import { getToken } from 'api/qiniu' |
||||
|
||||
export default { |
||||
name: 'EditorSlideUpload', |
||||
props: { |
||||
color: { |
||||
type: String, |
||||
default: '#1890ff' |
||||
} |
||||
}, |
||||
data() { |
||||
return { |
||||
dialogVisible: false, |
||||
listObj: {}, |
||||
fileList: [] |
||||
} |
||||
}, |
||||
methods: { |
||||
checkAllSuccess() { |
||||
return Object.keys(this.listObj).every(item => this.listObj[item].hasSuccess) |
||||
}, |
||||
handleSubmit() { |
||||
const arr = Object.keys(this.listObj).map(v => this.listObj[v]) |
||||
if (!this.checkAllSuccess()) { |
||||
this.$message('Please wait for all images to be uploaded successfully. If there is a network problem, please refresh the page and upload again!') |
||||
return |
||||
} |
||||
this.$emit('successCBK', arr) |
||||
this.listObj = {} |
||||
this.fileList = [] |
||||
this.dialogVisible = false |
||||
}, |
||||
handleSuccess(response, file) { |
||||
const uid = file.uid |
||||
const objKeyArr = Object.keys(this.listObj) |
||||
for (let i = 0, len = objKeyArr.length; i < len; i++) { |
||||
if (this.listObj[objKeyArr[i]].uid === uid) { |
||||
this.listObj[objKeyArr[i]].url = response.files.file |
||||
this.listObj[objKeyArr[i]].hasSuccess = true |
||||
return |
||||
} |
||||
} |
||||
}, |
||||
handleRemove(file) { |
||||
const uid = file.uid |
||||
const objKeyArr = Object.keys(this.listObj) |
||||
for (let i = 0, len = objKeyArr.length; i < len; i++) { |
||||
if (this.listObj[objKeyArr[i]].uid === uid) { |
||||
delete this.listObj[objKeyArr[i]] |
||||
return |
||||
} |
||||
} |
||||
}, |
||||
beforeUpload(file) { |
||||
const _self = this |
||||
const _URL = window.URL || window.webkitURL |
||||
const fileName = file.uid |
||||
this.listObj[fileName] = {} |
||||
return new Promise((resolve, reject) => { |
||||
const img = new Image() |
||||
img.src = _URL.createObjectURL(file) |
||||
img.onload = function() { |
||||
_self.listObj[fileName] = { hasSuccess: false, uid: file.uid, width: this.width, height: this.height } |
||||
} |
||||
resolve(true) |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.editor-slide-upload { |
||||
margin-bottom: 20px; |
||||
::v-deep .el-upload--picture-card { |
||||
width: 100%; |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,59 @@ |
||||
let callbacks = [] |
||||
|
||||
function loadedTinymce() { |
||||
// to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2144
|
||||
// check is successfully downloaded script
|
||||
return window.tinymce |
||||
} |
||||
|
||||
const dynamicLoadScript = (src, callback) => { |
||||
const existingScript = document.getElementById(src) |
||||
const cb = callback || function() {} |
||||
|
||||
if (!existingScript) { |
||||
const script = document.createElement('script') |
||||
script.src = src // src url for the third-party library being loaded.
|
||||
script.id = src |
||||
document.body.appendChild(script) |
||||
callbacks.push(cb) |
||||
const onEnd = 'onload' in script ? stdOnEnd : ieOnEnd |
||||
onEnd(script) |
||||
} |
||||
|
||||
if (existingScript && cb) { |
||||
if (loadedTinymce()) { |
||||
cb(null, existingScript) |
||||
} else { |
||||
callbacks.push(cb) |
||||
} |
||||
} |
||||
|
||||
function stdOnEnd(script) { |
||||
script.onload = function() { |
||||
// this.onload = null here is necessary
|
||||
// because even IE9 works not like others
|
||||
this.onerror = this.onload = null |
||||
for (const cb of callbacks) { |
||||
cb(null, script) |
||||
} |
||||
callbacks = null |
||||
} |
||||
script.onerror = function() { |
||||
this.onerror = this.onload = null |
||||
cb(new Error('Failed to load ' + src), script) |
||||
} |
||||
} |
||||
|
||||
function ieOnEnd(script) { |
||||
script.onreadystatechange = function() { |
||||
if (this.readyState !== 'complete' && this.readyState !== 'loaded') return |
||||
this.onreadystatechange = null |
||||
for (const cb of callbacks) { |
||||
cb(null, script) // there is no way to catch loading errors in IE8
|
||||
} |
||||
callbacks = null |
||||
} |
||||
} |
||||
} |
||||
|
||||
export default dynamicLoadScript |
@ -0,0 +1,250 @@ |
||||
<template> |
||||
<div :class="{fullscreen:fullscreen}" class="tinymce-container" :style="{width:containerWidth}"> |
||||
<textarea :id="tinymceId" class="tinymce-textarea" /> |
||||
<div class="editor-custom-btn-container"> |
||||
<editorImage color="#1890ff" class="editor-upload-btn" @successCBK="imageSuccessCBK" /> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
/** |
||||
* docs: |
||||
* https://panjiachen.github.io/vue-element-admin-site/feature/component/rich-editor.html#tinymce |
||||
*/ |
||||
import editorImage from './components/EditorImage' |
||||
import plugins from './plugins' |
||||
import toolbar from './toolbar' |
||||
import load from './dynamicLoadScript' |
||||
|
||||
// why use this cdn, detail see https://github.com/PanJiaChen/tinymce-all-in-one |
||||
const tinymceCDN = 'https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js' |
||||
|
||||
export default { |
||||
name: 'Tinymce', |
||||
components: { editorImage }, |
||||
props: { |
||||
id: { |
||||
type: String, |
||||
default: function() { |
||||
return 'vue-tinymce-' + +new Date() + ((Math.random() * 1000).toFixed(0) + '') |
||||
} |
||||
}, |
||||
value: { |
||||
type: String, |
||||
default: '' |
||||
}, |
||||
toolbar: { |
||||
type: Array, |
||||
required: false, |
||||
default() { |
||||
return [] |
||||
} |
||||
}, |
||||
menubar: { |
||||
type: String, |
||||
default: 'file edit insert view format table' |
||||
}, |
||||
height: { |
||||
type: [Number, String], |
||||
required: false, |
||||
default: 360 |
||||
}, |
||||
width: { |
||||
type: [Number, String], |
||||
required: false, |
||||
default: 'auto' |
||||
} |
||||
}, |
||||
data() { |
||||
return { |
||||
hasChange: false, |
||||
hasInit: false, |
||||
tinymceId: this.id, |
||||
fullscreen: false, |
||||
languageTypeList: { |
||||
'en': 'en', |
||||
'zh': 'zh_CN', |
||||
'es': 'es_MX', |
||||
'ja': 'ja' |
||||
} |
||||
} |
||||
}, |
||||
computed: { |
||||
containerWidth() { |
||||
const width = this.width |
||||
if (/^[\d]+(\.[\d]+)?$/.test(width)) { // matches `100`, `'100'` |
||||
return `${width}px` |
||||
} |
||||
return width |
||||
} |
||||
}, |
||||
watch: { |
||||
value(val) { |
||||
if (!this.hasChange && this.hasInit) { |
||||
this.$nextTick(() => |
||||
window.tinymce.get(this.tinymceId).setContent(val || '')) |
||||
} |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.init() |
||||
}, |
||||
activated() { |
||||
if (window.tinymce) { |
||||
this.initTinymce() |
||||
} |
||||
}, |
||||
deactivated() { |
||||
this.destroyTinymce() |
||||
}, |
||||
destroyed() { |
||||
this.destroyTinymce() |
||||
}, |
||||
methods: { |
||||
init() { |
||||
// dynamic load tinymce from cdn |
||||
load(tinymceCDN, (err) => { |
||||
if (err) { |
||||
this.$message.error(err.message) |
||||
return |
||||
} |
||||
this.initTinymce() |
||||
}) |
||||
}, |
||||
initTinymce() { |
||||
const _this = this |
||||
window.tinymce.init({ |
||||
selector: `#${this.tinymceId}`, |
||||
language: this.languageTypeList['en'], |
||||
height: this.height, |
||||
body_class: 'panel-body ', |
||||
object_resizing: false, |
||||
toolbar: this.toolbar.length > 0 ? this.toolbar : toolbar, |
||||
menubar: this.menubar, |
||||
plugins: plugins, |
||||
end_container_on_empty_block: true, |
||||
powerpaste_word_import: 'clean', |
||||
code_dialog_height: 450, |
||||
code_dialog_width: 1000, |
||||
advlist_bullet_styles: 'square', |
||||
advlist_number_styles: 'default', |
||||
imagetools_cors_hosts: ['www.tinymce.com', 'codepen.io'], |
||||
default_link_target: '_blank', |
||||
link_title: false, |
||||
nonbreaking_force_tab: true, // inserting nonbreaking space need Nonbreaking Space Plugin |
||||
init_instance_callback: editor => { |
||||
if (_this.value) { |
||||
editor.setContent(_this.value) |
||||
} |
||||
_this.hasInit = true |
||||
editor.on('NodeChange Change KeyUp SetContent', () => { |
||||
this.hasChange = true |
||||
this.$emit('input', editor.getContent()) |
||||
}) |
||||
}, |
||||
setup(editor) { |
||||
editor.on('FullscreenStateChanged', (e) => { |
||||
_this.fullscreen = e.state |
||||
}) |
||||
}, |
||||
// it will try to keep these URLs intact |
||||
// https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/ |
||||
// https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions |
||||
convert_urls: false |
||||
// 整合七牛上传 |
||||
// images_dataimg_filter(img) { |
||||
// setTimeout(() => { |
||||
// const $image = $(img); |
||||
// $image.removeAttr('width'); |
||||
// $image.removeAttr('height'); |
||||
// if ($image[0].height && $image[0].width) { |
||||
// $image.attr('data-wscntype', 'image'); |
||||
// $image.attr('data-wscnh', $image[0].height); |
||||
// $image.attr('data-wscnw', $image[0].width); |
||||
// $image.addClass('wscnph'); |
||||
// } |
||||
// }, 0); |
||||
// return img |
||||
// }, |
||||
// images_upload_handler(blobInfo, success, failure, progress) { |
||||
// progress(0); |
||||
// const token = _this.$store.getters.token; |
||||
// getToken(token).then(response => { |
||||
// const url = response.data.qiniu_url; |
||||
// const formData = new FormData(); |
||||
// formData.append('token', response.data.qiniu_token); |
||||
// formData.append('key', response.data.qiniu_key); |
||||
// formData.append('file', blobInfo.blob(), url); |
||||
// upload(formData).then(() => { |
||||
// success(url); |
||||
// progress(100); |
||||
// }) |
||||
// }).catch(err => { |
||||
// failure('出现未知问题,刷新页面,或者联系程序员') |
||||
// console.log(err); |
||||
// }); |
||||
// }, |
||||
}) |
||||
}, |
||||
destroyTinymce() { |
||||
const tinymce = window.tinymce.get(this.tinymceId) |
||||
if (this.fullscreen) { |
||||
tinymce.execCommand('mceFullScreen') |
||||
} |
||||
|
||||
if (tinymce) { |
||||
tinymce.destroy() |
||||
} |
||||
}, |
||||
setContent(value) { |
||||
window.tinymce.get(this.tinymceId).setContent(value) |
||||
}, |
||||
getContent() { |
||||
window.tinymce.get(this.tinymceId).getContent() |
||||
}, |
||||
imageSuccessCBK(arr) { |
||||
const _this = this |
||||
arr.forEach(v => { |
||||
window.tinymce.get(_this.tinymceId).insertContent(`<img class="wscnph" src="${v.url}" >`) |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.tinymce-container { |
||||
position: relative; |
||||
line-height: normal; |
||||
} |
||||
|
||||
.tinymce-container { |
||||
::v-deep { |
||||
.mce-fullscreen { |
||||
z-index: 10000; |
||||
} |
||||
} |
||||
} |
||||
|
||||
.tinymce-textarea { |
||||
visibility: hidden; |
||||
z-index: -1; |
||||
} |
||||
|
||||
.editor-custom-btn-container { |
||||
position: absolute; |
||||
right: 4px; |
||||
top: 4px; |
||||
/*z-index: 2005;*/ |
||||
} |
||||
|
||||
.fullscreen .editor-custom-btn-container { |
||||
z-index: 10000; |
||||
position: fixed; |
||||
} |
||||
|
||||
.editor-upload-btn { |
||||
display: inline-block; |
||||
} |
||||
</style> |
@ -0,0 +1,7 @@ |
||||
// Any plugins you want to use has to be imported
|
||||
// Detail plugins list see https://www.tinymce.com/docs/plugins/
|
||||
// Custom builds see https://www.tinymce.com/download/custom-builds/
|
||||
|
||||
const plugins = ['advlist anchor autolink autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount'] |
||||
|
||||
export default plugins |
@ -0,0 +1,6 @@ |
||||
// Here is a list of the toolbar
|
||||
// Detail list see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols
|
||||
|
||||
const toolbar = ['searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample', 'hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen'] |
||||
|
||||
export default toolbar |
@ -0,0 +1,134 @@ |
||||
<template> |
||||
<div class="upload-container"> |
||||
<el-upload |
||||
:data="dataObj" |
||||
:multiple="false" |
||||
:show-file-list="false" |
||||
:on-success="handleImageSuccess" |
||||
class="image-uploader" |
||||
drag |
||||
action="https://httpbin.org/post" |
||||
> |
||||
<i class="el-icon-upload" /> |
||||
<div class="el-upload__text"> |
||||
将文件拖到此处,或<em>点击上传</em> |
||||
</div> |
||||
</el-upload> |
||||
<div class="image-preview"> |
||||
<div v-show="imageUrl.length>1" class="image-preview-wrapper"> |
||||
<img :src="imageUrl+'?imageView2/1/w/200/h/200'"> |
||||
<div class="image-preview-action"> |
||||
<i class="el-icon-delete" @click="rmImage" /> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getToken } from '@/api/qiniu' |
||||
|
||||
export default { |
||||
name: 'SingleImageUpload', |
||||
props: { |
||||
value: { |
||||
type: String, |
||||
default: '' |
||||
} |
||||
}, |
||||
data() { |
||||
return { |
||||
tempUrl: '', |
||||
dataObj: { token: '', key: '' } |
||||
} |
||||
}, |
||||
computed: { |
||||
imageUrl() { |
||||
return this.value |
||||
} |
||||
}, |
||||
methods: { |
||||
rmImage() { |
||||
this.emitInput('') |
||||
}, |
||||
emitInput(val) { |
||||
this.$emit('input', val) |
||||
}, |
||||
handleImageSuccess() { |
||||
this.emitInput(this.tempUrl) |
||||
}, |
||||
beforeUpload() { |
||||
const _self = this |
||||
return new Promise((resolve, reject) => { |
||||
getToken().then(response => { |
||||
const key = response.data.qiniu_key |
||||
const token = response.data.qiniu_token |
||||
_self._data.dataObj.token = token |
||||
_self._data.dataObj.key = key |
||||
this.tempUrl = response.data.qiniu_url |
||||
resolve(true) |
||||
}).catch(err => { |
||||
console.log(err) |
||||
reject(false) |
||||
}) |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
@import "~@/styles/mixin.scss"; |
||||
.upload-container { |
||||
width: 100%; |
||||
position: relative; |
||||
@include clearfix; |
||||
.image-uploader { |
||||
width: 60%; |
||||
float: left; |
||||
} |
||||
.image-preview { |
||||
width: 200px; |
||||
height: 200px; |
||||
position: relative; |
||||
border: 1px dashed #d9d9d9; |
||||
float: left; |
||||
margin-left: 50px; |
||||
.image-preview-wrapper { |
||||
position: relative; |
||||
width: 100%; |
||||
height: 100%; |
||||
img { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
} |
||||
.image-preview-action { |
||||
position: absolute; |
||||
width: 100%; |
||||
height: 100%; |
||||
left: 0; |
||||
top: 0; |
||||
cursor: default; |
||||
text-align: center; |
||||
color: #fff; |
||||
opacity: 0; |
||||
font-size: 20px; |
||||
background-color: rgba(0, 0, 0, .5); |
||||
transition: opacity .3s; |
||||
cursor: pointer; |
||||
text-align: center; |
||||
line-height: 200px; |
||||
.el-icon-delete { |
||||
font-size: 36px; |
||||
} |
||||
} |
||||
&:hover { |
||||
.image-preview-action { |
||||
opacity: 1; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
</style> |
@ -0,0 +1,130 @@ |
||||
<template> |
||||
<div class="singleImageUpload2 upload-container"> |
||||
<el-upload |
||||
:data="dataObj" |
||||
:multiple="false" |
||||
:show-file-list="false" |
||||
:on-success="handleImageSuccess" |
||||
class="image-uploader" |
||||
drag |
||||
action="https://httpbin.org/post" |
||||
> |
||||
<i class="el-icon-upload" /> |
||||
<div class="el-upload__text"> |
||||
Drag或<em>点击上传</em> |
||||
</div> |
||||
</el-upload> |
||||
<div v-show="imageUrl.length>0" class="image-preview"> |
||||
<div v-show="imageUrl.length>1" class="image-preview-wrapper"> |
||||
<img :src="imageUrl"> |
||||
<div class="image-preview-action"> |
||||
<i class="el-icon-delete" @click="rmImage" /> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getToken } from '@/api/qiniu' |
||||
|
||||
export default { |
||||
name: 'SingleImageUpload2', |
||||
props: { |
||||
value: { |
||||
type: String, |
||||
default: '' |
||||
} |
||||
}, |
||||
data() { |
||||
return { |
||||
tempUrl: '', |
||||
dataObj: { token: '', key: '' } |
||||
} |
||||
}, |
||||
computed: { |
||||
imageUrl() { |
||||
return this.value |
||||
} |
||||
}, |
||||
methods: { |
||||
rmImage() { |
||||
this.emitInput('') |
||||
}, |
||||
emitInput(val) { |
||||
this.$emit('input', val) |
||||
}, |
||||
handleImageSuccess() { |
||||
this.emitInput(this.tempUrl) |
||||
}, |
||||
beforeUpload() { |
||||
const _self = this |
||||
return new Promise((resolve, reject) => { |
||||
getToken().then(response => { |
||||
const key = response.data.qiniu_key |
||||
const token = response.data.qiniu_token |
||||
_self._data.dataObj.token = token |
||||
_self._data.dataObj.key = key |
||||
this.tempUrl = response.data.qiniu_url |
||||
resolve(true) |
||||
}).catch(() => { |
||||
reject(false) |
||||
}) |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
.upload-container { |
||||
width: 100%; |
||||
height: 100%; |
||||
position: relative; |
||||
.image-uploader { |
||||
height: 100%; |
||||
} |
||||
.image-preview { |
||||
width: 100%; |
||||
height: 100%; |
||||
position: absolute; |
||||
left: 0px; |
||||
top: 0px; |
||||
border: 1px dashed #d9d9d9; |
||||
.image-preview-wrapper { |
||||
position: relative; |
||||
width: 100%; |
||||
height: 100%; |
||||
img { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
} |
||||
.image-preview-action { |
||||
position: absolute; |
||||
width: 100%; |
||||
height: 100%; |
||||
left: 0; |
||||
top: 0; |
||||
cursor: default; |
||||
text-align: center; |
||||
color: #fff; |
||||
opacity: 0; |
||||
font-size: 20px; |
||||
background-color: rgba(0, 0, 0, .5); |
||||
transition: opacity .3s; |
||||
cursor: pointer; |
||||
text-align: center; |
||||
line-height: 200px; |
||||
.el-icon-delete { |
||||
font-size: 36px; |
||||
} |
||||
} |
||||
&:hover { |
||||
.image-preview-action { |
||||
opacity: 1; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,157 @@ |
||||
<template> |
||||
<div class="upload-container"> |
||||
<el-upload |
||||
:data="dataObj" |
||||
:multiple="false" |
||||
:show-file-list="false" |
||||
:on-success="handleImageSuccess" |
||||
class="image-uploader" |
||||
drag |
||||
action="https://httpbin.org/post" |
||||
> |
||||
<i class="el-icon-upload" /> |
||||
<div class="el-upload__text"> |
||||
将文件拖到此处,或<em>点击上传</em> |
||||
</div> |
||||
</el-upload> |
||||
<div class="image-preview image-app-preview"> |
||||
<div v-show="imageUrl.length>1" class="image-preview-wrapper"> |
||||
<img :src="imageUrl"> |
||||
<div class="image-preview-action"> |
||||
<i class="el-icon-delete" @click="rmImage" /> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="image-preview"> |
||||
<div v-show="imageUrl.length>1" class="image-preview-wrapper"> |
||||
<img :src="imageUrl"> |
||||
<div class="image-preview-action"> |
||||
<i class="el-icon-delete" @click="rmImage" /> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { getToken } from '@/api/qiniu' |
||||
|
||||
export default { |
||||
name: 'SingleImageUpload3', |
||||
props: { |
||||
value: { |
||||
type: String, |
||||
default: '' |
||||
} |
||||
}, |
||||
data() { |
||||
return { |
||||
tempUrl: '', |
||||
dataObj: { token: '', key: '' } |
||||
} |
||||
}, |
||||
computed: { |
||||
imageUrl() { |
||||
return this.value |
||||
} |
||||
}, |
||||
methods: { |
||||
rmImage() { |
||||
this.emitInput('') |
||||
}, |
||||
emitInput(val) { |
||||
this.$emit('input', val) |
||||
}, |
||||
handleImageSuccess(file) { |
||||
this.emitInput(file.files.file) |
||||
}, |
||||
beforeUpload() { |
||||
const _self = this |
||||
return new Promise((resolve, reject) => { |
||||
getToken().then(response => { |
||||
const key = response.data.qiniu_key |
||||
const token = response.data.qiniu_token |
||||
_self._data.dataObj.token = token |
||||
_self._data.dataObj.key = key |
||||
this.tempUrl = response.data.qiniu_url |
||||
resolve(true) |
||||
}).catch(err => { |
||||
console.log(err) |
||||
reject(false) |
||||
}) |
||||
}) |
||||
} |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style lang="scss" scoped> |
||||
@import "~@/styles/mixin.scss"; |
||||
.upload-container { |
||||
width: 100%; |
||||
position: relative; |
||||
@include clearfix; |
||||
.image-uploader { |
||||
width: 35%; |
||||
float: left; |
||||
} |
||||
.image-preview { |
||||
width: 200px; |
||||
height: 200px; |
||||
position: relative; |
||||
border: 1px dashed #d9d9d9; |
||||
float: left; |
||||
margin-left: 50px; |
||||
.image-preview-wrapper { |
||||
position: relative; |
||||
width: 100%; |
||||
height: 100%; |
||||
img { |
||||
width: 100%; |
||||
height: 100%; |
||||
} |
||||
} |
||||
.image-preview-action { |
||||
position: absolute; |
||||
width: 100%; |
||||
height: 100%; |
||||
left: 0; |
||||
top: 0; |
||||
cursor: default; |
||||
text-align: center; |
||||
color: #fff; |
||||
opacity: 0; |
||||
font-size: 20px; |
||||
background-color: rgba(0, 0, 0, .5); |
||||
transition: opacity .3s; |
||||
cursor: pointer; |
||||
text-align: center; |
||||
line-height: 200px; |
||||
.el-icon-delete { |
||||
font-size: 36px; |
||||
} |
||||
} |
||||
&:hover { |
||||
.image-preview-action { |
||||
opacity: 1; |
||||
} |
||||
} |
||||
} |
||||
.image-app-preview { |
||||
width: 320px; |
||||
height: 180px; |
||||
position: relative; |
||||
border: 1px dashed #d9d9d9; |
||||
float: left; |
||||
margin-left: 50px; |
||||
.app-fake-conver { |
||||
height: 44px; |
||||
position: absolute; |
||||
width: 100%; // background: rgba(0, 0, 0, .1); |
||||
text-align: center; |
||||
line-height: 64px; |
||||
color: #fff; |
||||
} |
||||
} |
||||
} |
||||
</style> |
@ -0,0 +1,49 @@ |
||||
// Inspired by https://github.com/Inndy/vue-clipboard2
|
||||
const Clipboard = require('clipboard') |
||||
if (!Clipboard) { |
||||
throw new Error('you should npm install `clipboard` --save at first ') |
||||
} |
||||
|
||||
export default { |
||||
bind(el, binding) { |
||||
if (binding.arg === 'success') { |
||||
el._v_clipboard_success = binding.value |
||||
} else if (binding.arg === 'error') { |
||||
el._v_clipboard_error = binding.value |
||||
} else { |
||||
const clipboard = new Clipboard(el, { |
||||
text() { return binding.value }, |
||||
action() { return binding.arg === 'cut' ? 'cut' : 'copy' } |
||||
}) |
||||
clipboard.on('success', e => { |
||||
const callback = el._v_clipboard_success |
||||
callback && callback(e) // eslint-disable-line
|
||||
}) |
||||
clipboard.on('error', e => { |
||||
const callback = el._v_clipboard_error |
||||
callback && callback(e) // eslint-disable-line
|
||||
}) |
||||
el._v_clipboard = clipboard |
||||
} |
||||
}, |
||||
update(el, binding) { |
||||
if (binding.arg === 'success') { |
||||
el._v_clipboard_success = binding.value |
||||
} else if (binding.arg === 'error') { |
||||
el._v_clipboard_error = binding.value |
||||
} else { |
||||
el._v_clipboard.text = function() { return binding.value } |
||||
el._v_clipboard.action = function() { return binding.arg === 'cut' ? 'cut' : 'copy' } |
||||
} |
||||
}, |
||||
unbind(el, binding) { |
||||
if (binding.arg === 'success') { |
||||
delete el._v_clipboard_success |
||||
} else if (binding.arg === 'error') { |
||||
delete el._v_clipboard_error |
||||
} else { |
||||
el._v_clipboard.destroy() |
||||
delete el._v_clipboard |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,13 @@ |
||||
import Clipboard from './clipboard' |
||||
|
||||
const install = function(Vue) { |
||||
Vue.directive('Clipboard', Clipboard) |
||||
} |
||||
|
||||
if (window.Vue) { |
||||
window.clipboard = Clipboard |
||||
Vue.use(install); // eslint-disable-line
|
||||
} |
||||
|
||||
Clipboard.install = install |
||||
export default Clipboard |
@ -0,0 +1,77 @@ |
||||
export default { |
||||
bind(el, binding, vnode) { |
||||
const dialogHeaderEl = el.querySelector('.el-dialog__header') |
||||
const dragDom = el.querySelector('.el-dialog') |
||||
dialogHeaderEl.style.cssText += ';cursor:move;' |
||||
dragDom.style.cssText += ';top:0px;' |
||||
|
||||
// 获取原有属性 ie dom元素.currentStyle 火狐谷歌 window.getComputedStyle(dom元素, null);
|
||||
const getStyle = (function() { |
||||
if (window.document.currentStyle) { |
||||
return (dom, attr) => dom.currentStyle[attr] |
||||
} else { |
||||
return (dom, attr) => getComputedStyle(dom, false)[attr] |
||||
} |
||||
})() |
||||
|
||||
dialogHeaderEl.onmousedown = (e) => { |
||||
// 鼠标按下,计算当前元素距离可视区的距离
|
||||
const disX = e.clientX - dialogHeaderEl.offsetLeft |
||||
const disY = e.clientY - dialogHeaderEl.offsetTop |
||||
|
||||
const dragDomWidth = dragDom.offsetWidth |
||||
const dragDomHeight = dragDom.offsetHeight |
||||
|
||||
const screenWidth = document.body.clientWidth |
||||
const screenHeight = document.body.clientHeight |
||||
|
||||
const minDragDomLeft = dragDom.offsetLeft |
||||
const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth |
||||
|
||||
const minDragDomTop = dragDom.offsetTop |
||||
const maxDragDomTop = screenHeight - dragDom.offsetTop - dragDomHeight |
||||
|
||||
// 获取到的值带px 正则匹配替换
|
||||
let styL = getStyle(dragDom, 'left') |
||||
let styT = getStyle(dragDom, 'top') |
||||
|
||||
if (styL.includes('%')) { |
||||
styL = +document.body.clientWidth * (+styL.replace(/\%/g, '') / 100) |
||||
styT = +document.body.clientHeight * (+styT.replace(/\%/g, '') / 100) |
||||
} else { |
||||
styL = +styL.replace(/\px/g, '') |
||||
styT = +styT.replace(/\px/g, '') |
||||
} |
||||
|
||||
document.onmousemove = function(e) { |
||||
// 通过事件委托,计算移动的距离
|
||||
let left = e.clientX - disX |
||||
let top = e.clientY - disY |
||||
|
||||
// 边界处理
|
||||
if (-(left) > minDragDomLeft) { |
||||
left = -minDragDomLeft |
||||
} else if (left > maxDragDomLeft) { |
||||
left = maxDragDomLeft |
||||
} |
||||
|
||||
if (-(top) > minDragDomTop) { |
||||
top = -minDragDomTop |
||||
} else if (top > maxDragDomTop) { |
||||
top = maxDragDomTop |
||||
} |
||||
|
||||
// 移动当前元素
|
||||
dragDom.style.cssText += `;left:${left + styL}px;top:${top + styT}px;` |
||||
|
||||
// emit onDrag event
|
||||
vnode.child.$emit('dragDialog') |
||||
} |
||||
|
||||
document.onmouseup = function(e) { |
||||
document.onmousemove = null |
||||
document.onmouseup = null |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,13 @@ |
||||
import drag from './drag' |
||||
|
||||
const install = function(Vue) { |
||||
Vue.directive('el-drag-dialog', drag) |
||||
} |
||||
|
||||
if (window.Vue) { |
||||
window['el-drag-dialog'] = drag |
||||
Vue.use(install); // eslint-disable-line
|
||||
} |
||||
|
||||
drag.install = install |
||||
export default drag |
@ -0,0 +1,41 @@ |
||||
import { addResizeListener, removeResizeListener } from 'element-ui/src/utils/resize-event' |
||||
|
||||
/** |
||||
* How to use |
||||
* <el-table height="100px" v-el-height-adaptive-table="{bottomOffset: 30}">...</el-table> |
||||
* el-table height is must be set |
||||
* bottomOffset: 30(default) // The height of the table from the bottom of the page.
|
||||
*/ |
||||
|
||||
const doResize = (el, binding, vnode) => { |
||||
const { componentInstance: $table } = vnode |
||||
|
||||
const { value } = binding |
||||
|
||||
if (!$table.height) { |
||||
throw new Error(`el-$table must set the height. Such as height='100px'`) |
||||
} |
||||
const bottomOffset = (value && value.bottomOffset) || 30 |
||||
|
||||
if (!$table) return |
||||
|
||||
const height = window.innerHeight - el.getBoundingClientRect().top - bottomOffset |
||||
$table.layout.setHeight(height) |
||||
$table.doLayout() |
||||
} |
||||
|
||||
export default { |
||||
bind(el, binding, vnode) { |
||||
el.resizeListener = () => { |
||||
doResize(el, binding, vnode) |
||||
} |
||||
// parameter 1 is must be "Element" type
|
||||
addResizeListener(window.document.body, el.resizeListener) |
||||
}, |
||||
inserted(el, binding, vnode) { |
||||
doResize(el, binding, vnode) |
||||
}, |
||||
unbind(el) { |
||||
removeResizeListener(window.document.body, el.resizeListener) |
||||
} |
||||
} |
@ -0,0 +1,13 @@ |
||||
import adaptive from './adaptive' |
||||
|
||||
const install = function(Vue) { |
||||
Vue.directive('el-height-adaptive-table', adaptive) |
||||
} |
||||
|
||||
if (window.Vue) { |
||||
window['el-height-adaptive-table'] = adaptive |
||||
Vue.use(install); // eslint-disable-line
|
||||
} |
||||
|
||||
adaptive.install = install |
||||
export default adaptive |
@ -0,0 +1,13 @@ |
||||
import permission from './permission' |
||||
|
||||
const install = function(Vue) { |
||||
Vue.directive('permission', permission) |
||||
} |
||||
|
||||
if (window.Vue) { |
||||
window['permission'] = permission |
||||
Vue.use(install); // eslint-disable-line
|
||||
} |
||||
|
||||
permission.install = install |
||||
export default permission |
@ -0,0 +1,31 @@ |
||||
import store from '@/store' |
||||
|
||||
function checkPermission(el, binding) { |
||||
const { value } = binding |
||||
const roles = store.getters && store.getters.roles |
||||
|
||||
if (value && value instanceof Array) { |
||||
if (value.length > 0) { |
||||
const permissionRoles = value |
||||
|
||||
const hasPermission = roles.some(role => { |
||||
return permissionRoles.includes(role) |
||||
}) |
||||
|
||||
if (!hasPermission) { |
||||
el.parentNode && el.parentNode.removeChild(el) |
||||
} |
||||
} |
||||
} else { |
||||
throw new Error(`need roles! Like v-permission="['admin','editor']"`) |
||||
} |
||||
} |
||||
|
||||
export default { |
||||
inserted(el, binding) { |
||||
checkPermission(el, binding) |
||||
}, |
||||
update(el, binding) { |
||||
checkPermission(el, binding) |
||||
} |
||||
} |
@ -0,0 +1,91 @@ |
||||
const vueSticky = {} |
||||
let listenAction |
||||
vueSticky.install = Vue => { |
||||
Vue.directive('sticky', { |
||||
inserted(el, binding) { |
||||
const params = binding.value || {} |
||||
const stickyTop = params.stickyTop || 0 |
||||
const zIndex = params.zIndex || 1000 |
||||
const elStyle = el.style |
||||
|
||||
elStyle.position = '-webkit-sticky' |
||||
elStyle.position = 'sticky' |
||||
// if the browser support css sticky(Currently Safari, Firefox and Chrome Canary)
|
||||
// if (~elStyle.position.indexOf('sticky')) {
|
||||
// elStyle.top = `${stickyTop}px`;
|
||||
// elStyle.zIndex = zIndex;
|
||||
// return
|
||||
// }
|
||||
const elHeight = el.getBoundingClientRect().height |
||||
const elWidth = el.getBoundingClientRect().width |
||||
elStyle.cssText = `top: ${stickyTop}px; z-index: ${zIndex}` |
||||
|
||||
const parentElm = el.parentNode || document.documentElement |
||||
const placeholder = document.createElement('div') |
||||
placeholder.style.display = 'none' |
||||
placeholder.style.width = `${elWidth}px` |
||||
placeholder.style.height = `${elHeight}px` |
||||
parentElm.insertBefore(placeholder, el) |
||||
|
||||
let active = false |
||||
|
||||
const getScroll = (target, top) => { |
||||
const prop = top ? 'pageYOffset' : 'pageXOffset' |
||||
const method = top ? 'scrollTop' : 'scrollLeft' |
||||
let ret = target[prop] |
||||
if (typeof ret !== 'number') { |
||||
ret = window.document.documentElement[method] |
||||
} |
||||
return ret |
||||
} |
||||
|
||||
const sticky = () => { |
||||
if (active) { |
||||
return |
||||
} |
||||
if (!elStyle.height) { |
||||
elStyle.height = `${el.offsetHeight}px` |
||||
} |
||||
|
||||
elStyle.position = 'fixed' |
||||
elStyle.width = `${elWidth}px` |
||||
placeholder.style.display = 'inline-block' |
||||
active = true |
||||
} |
||||
|
||||
const reset = () => { |
||||
if (!active) { |
||||
return |
||||
} |
||||
|
||||
elStyle.position = '' |
||||
placeholder.style.display = 'none' |
||||
active = false |
||||
} |
||||
|
||||
const check = () => { |
||||
const scrollTop = getScroll(window, true) |
||||
const offsetTop = el.getBoundingClientRect().top |
||||
if (offsetTop < stickyTop) { |
||||
sticky() |
||||
} else { |
||||
if (scrollTop < elHeight + stickyTop) { |
||||
reset() |
||||
} |
||||
} |
||||
} |
||||
listenAction = () => { |
||||
check() |
||||
} |
||||
|
||||
window.addEventListener('scroll', listenAction) |
||||
}, |
||||
|
||||
unbind() { |
||||
window.removeEventListener('scroll', listenAction) |
||||
} |
||||
}) |
||||
} |
||||
|
||||
export default vueSticky |
||||
|
@ -0,0 +1,13 @@ |
||||
import waves from './waves' |
||||
|
||||
const install = function(Vue) { |
||||
Vue.directive('waves', waves) |
||||
} |
||||
|
||||
if (window.Vue) { |
||||
window.waves = waves |
||||
Vue.use(install); // eslint-disable-line
|
||||
} |
||||
|
||||
waves.install = install |
||||
export default waves |
@ -0,0 +1,26 @@ |
||||
.waves-ripple { |
||||
position: absolute; |
||||
border-radius: 100%; |
||||
background-color: rgba(0, 0, 0, 0.15); |
||||
background-clip: padding-box; |
||||
pointer-events: none; |
||||
-webkit-user-select: none; |
||||
-moz-user-select: none; |
||||
-ms-user-select: none; |
||||
user-select: none; |
||||
-webkit-transform: scale(0); |
||||
-ms-transform: scale(0); |
||||
transform: scale(0); |
||||
opacity: 1; |
||||
} |
||||
|
||||
.waves-ripple.z-active { |
||||
opacity: 0; |
||||
-webkit-transform: scale(2); |
||||
-ms-transform: scale(2); |
||||
transform: scale(2); |
||||
-webkit-transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out; |
||||
transition: opacity 1.2s ease-out, -webkit-transform 0.6s ease-out; |
||||
transition: opacity 1.2s ease-out, transform 0.6s ease-out; |
||||
transition: opacity 1.2s ease-out, transform 0.6s ease-out, -webkit-transform 0.6s ease-out; |
||||
} |
@ -0,0 +1,72 @@ |
||||
import './waves.css' |
||||
|
||||
const context = '@@wavesContext' |
||||
|
||||
function handleClick(el, binding) { |
||||
function handle(e) { |
||||
const customOpts = Object.assign({}, binding.value) |
||||
const opts = Object.assign({ |
||||
ele: el, // 波纹作用元素
|
||||
type: 'hit', // hit 点击位置扩散 center中心点扩展
|
||||
color: 'rgba(0, 0, 0, 0.15)' // 波纹颜色
|
||||
}, |
||||
customOpts |
||||
) |
||||
const target = opts.ele |
||||
if (target) { |
||||
target.style.position = 'relative' |
||||
target.style.overflow = 'hidden' |
||||
const rect = target.getBoundingClientRect() |
||||
let ripple = target.querySelector('.waves-ripple') |
||||
if (!ripple) { |
||||
ripple = document.createElement('span') |
||||
ripple.className = 'waves-ripple' |
||||
ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px' |
||||
target.appendChild(ripple) |
||||
} else { |
||||
ripple.className = 'waves-ripple' |
||||
} |
||||
switch (opts.type) { |
||||
case 'center': |
||||
ripple.style.top = rect.height / 2 - ripple.offsetHeight / 2 + 'px' |
||||
ripple.style.left = rect.width / 2 - ripple.offsetWidth / 2 + 'px' |
||||
break |
||||
default: |
||||
ripple.style.top = |
||||
(e.pageY - rect.top - ripple.offsetHeight / 2 - document.documentElement.scrollTop || |
||||
document.body.scrollTop) + 'px' |
||||
ripple.style.left = |
||||
(e.pageX - rect.left - ripple.offsetWidth / 2 - document.documentElement.scrollLeft || |
||||
document.body.scrollLeft) + 'px' |
||||
} |
||||
ripple.style.backgroundColor = opts.color |
||||
ripple.className = 'waves-ripple z-active' |
||||
return false |
||||
} |
||||
} |
||||
|
||||
if (!el[context]) { |
||||
el[context] = { |
||||
removeHandle: handle |
||||
} |
||||
} else { |
||||
el[context].removeHandle = handle |
||||
} |
||||
|
||||
return handle |
||||
} |
||||
|
||||
export default { |
||||
bind(el, binding) { |
||||
el.addEventListener('click', handleClick(el, binding), false) |
||||
}, |
||||
update(el, binding) { |
||||
el.removeEventListener('click', el[context].removeHandle, false) |
||||
el.addEventListener('click', handleClick(el, binding), false) |
||||
}, |
||||
unbind(el) { |
||||
el.removeEventListener('click', el[context].removeHandle, false) |
||||
el[context] = null |
||||
delete el[context] |
||||
} |
||||
} |
@ -0,0 +1,9 @@ |
||||
import Vue from 'vue' |
||||
import SvgIcon from '@/components/SvgIcon'// svg component
|
||||
|
||||
// register globally
|
||||
Vue.component('svg-icon', SvgIcon) |
||||
|
||||
const req = require.context('./svg', false, /\.svg$/) |
||||
const requireAll = requireContext => requireContext.keys().map(requireContext) |
||||
requireAll(req) |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 497 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 944 B |
After Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 285 B |
After Width: | Height: | Size: 821 B |