From c2c6beba70f02d5ce9489c7d094b8ec4957f9214 Mon Sep 17 00:00:00 2001 From: barney <15270405776@163.com> Date: Sun, 2 Oct 2022 00:49:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E6=9C=AC=E5=8A=9F=E8=83=BD=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- article/serializers.py | 5 +- article/views.py | 4 +- db.sqlite3 | Bin 196608 -> 196608 bytes drf_vue_blog/settings.py | 2 +- frontend/.gitignore | 3 +- frontend/src/App.vue | 4 +- frontend/src/components/ArticleList.vue | 129 +++++++--- frontend/src/components/BlogFooter.vue | 10 +- frontend/src/components/BlogHeader.vue | 36 ++- frontend/src/components/CommentView.vue | 170 +++++++++++++ frontend/src/router/index.js | 7 +- frontend/src/store/index.js | 8 +- frontend/src/utils/authorization.js | 9 +- frontend/src/views/ArticleCreate.vue | 156 ++++++++---- frontend/src/views/ArticleDetailView.vue | 123 +++++---- frontend/src/views/ArticleEdit.vue | 275 +++++++++++++++++++++ frontend/src/views/LoginView.vue | 12 +- frontend/src/views/UserCenterView.vue | 4 +- media/avatar/20220928/apple_06.png | Bin 0 -> 1314 bytes media/avatar/20220929/apple_02.png | Bin 0 -> 2092 bytes media/avatar/20220929/apple_02_XwdRCGC.png | Bin 0 -> 2092 bytes media/avatar/20220929/apple_03.png | Bin 0 -> 1553 bytes media/avatar/20220929/apple_03_UySCYTE.png | Bin 0 -> 1553 bytes media/avatar/20220929/apple_03_ZIeet1U.png | Bin 0 -> 1553 bytes media/avatar/20220929/apple_04.png | Bin 0 -> 943 bytes media/avatar/20220929/apple_06.png | Bin 0 -> 1314 bytes media/avatar/20220929/apple_06_wFiaqpZ.png | Bin 0 -> 1314 bytes media/avatar/20220929/apple_08.png | Bin 0 -> 1420 bytes media/avatar/20220929/apple_08_MJp2UUi.png | Bin 0 -> 1420 bytes media/avatar/20220929/apple_09.png | Bin 0 -> 1865 bytes media/avatar/20220930/apple_02.png | Bin 0 -> 2092 bytes media/avatar/20220930/apple_03.png | Bin 0 -> 1553 bytes media/avatar/20221001/apple_00.png | Bin 0 -> 1006 bytes media/avatar/20221001/apple_03.png | Bin 0 -> 1553 bytes requirements.txt | Bin 250 -> 2138 bytes 35 files changed, 778 insertions(+), 179 deletions(-) create mode 100644 frontend/src/components/CommentView.vue create mode 100644 frontend/src/views/ArticleEdit.vue create mode 100644 media/avatar/20220928/apple_06.png create mode 100644 media/avatar/20220929/apple_02.png create mode 100644 media/avatar/20220929/apple_02_XwdRCGC.png create mode 100644 media/avatar/20220929/apple_03.png create mode 100644 media/avatar/20220929/apple_03_UySCYTE.png create mode 100644 media/avatar/20220929/apple_03_ZIeet1U.png create mode 100644 media/avatar/20220929/apple_04.png create mode 100644 media/avatar/20220929/apple_06.png create mode 100644 media/avatar/20220929/apple_06_wFiaqpZ.png create mode 100644 media/avatar/20220929/apple_08.png create mode 100644 media/avatar/20220929/apple_08_MJp2UUi.png create mode 100644 media/avatar/20220929/apple_09.png create mode 100644 media/avatar/20220930/apple_02.png create mode 100644 media/avatar/20220930/apple_03.png create mode 100644 media/avatar/20221001/apple_00.png create mode 100644 media/avatar/20221001/apple_03.png diff --git a/article/serializers.py b/article/serializers.py index 6a8e442..f4adcce 100644 --- a/article/serializers.py +++ b/article/serializers.py @@ -154,7 +154,6 @@ class TagSerializer(serializers.ModelSerializer): # 显示url # url = serializers.HyperlinkedIdentityField(view_name='tag-detail') - class Meta: model = Tag fields = '__all__' @@ -167,11 +166,11 @@ class TagSerializer(serializers.ModelSerializer): def create(self, validated_data): self.check_tag_obj_exists(validated_data) - return super(TagSerializer, self).create(validated_data) + return super().create(validated_data) def update(self, instance, validated_data): self.check_tag_obj_exists(validated_data) - return super(TagSerializer, self).update(instance, validated_data) + return super().update(instance, validated_data) diff --git a/article/views.py b/article/views.py index 8d11b17..7530145 100644 --- a/article/views.py +++ b/article/views.py @@ -1,7 +1,7 @@ from rest_framework import viewsets from article.serializers import ArticleSerializer, CategorySerializer, CategoryDetailSerializer -from article.serializers import TagSerializer,ArticleDetailSerializer, AvatarSerializer -from article.models import Article, Category, Tag , Avatar +from article.serializers import TagSerializer, ArticleDetailSerializer, AvatarSerializer +from article.models import Article, Category, Tag, Avatar from article.permissions import IsAdminUserOrReadOnly from rest_framework.filters import SearchFilter diff --git a/db.sqlite3 b/db.sqlite3 index 24808d2e2caed7f031b149f20e758e5fd2c0aa76..cf459eabfc40f9fd2dc81af14c359613ce1547f4 100644 GIT binary patch delta 4799 zcma)AeQ;FO6@Tx(%_h5f`%d;NyPJftAt9iY&HMh?8Cye45Ew>;ghG_2Ye-^*d;lRa zPU*&~qtf~r>9)0kI<~cbMU0U8QPFCh(RR>cr)E0%ffWR`wRT!`w14#6`$$+Q+xq@E z=e~U>=l;&Q_nzOm85Cqz2)W>nswF7*e*5RCibSYfIFHY49qR4e+|`j8&J1O? zR>h-&!RM~+Ayrn@#frRGR+5UHmYuY!rBvNARbBB@kZ_EHzrkm4 z3#RKN>@?m>bcWc*{i>|ublzZj2_O-(U%bKm0HSHrS21fh(n(cgl1|}k{$|*}z z98*(tKODwn^l@+}^ug3*aIgc;s}ol8|1T~NH5z|+ck;UZ6I1&q_!Y^y@E#|^qa1t+ zAH$n)82$jigWtjdcnZFNNq7|VmXxM0e4Fp%*AxjnPZCVVnT#?SVKU5Qh{>Qw@bMxW z`r#z!7wLQHtSG^y^RTb6{qORgq+fs=ICv2rfEzHB5m-_!H1hf3vmH2_PS4q&&&-ZM zKaW4RyCQc42*!5^<9nRINq7%lh8Hl-!>}Lz1kb?l;Ujn)<13M-7FLs+_*D#2oWgX2 zWU#~ZJ#;EA_}~<97EBcAH$Qwi6AgWhP(dRsitkSnzN{Ah%t^45gPrgbT&`E)H*f-; zh9}?<9D&c_@9+@Zk08vzRQm-)CfQ;S&-0~F>+0Y$*Lil|wd zp;@G2UBt&l9qNvwK2AGxT~evKP-SPa>sry$vYj$y+s2Z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wJeV;`Z%ev=;h=MZB}D@Znq3_Suvx09jF z+j9qv<8ZU7*CIj2`cn5lv z6oM;o9QMJ>upS~%s@zj9DTB%$B}F@`Q6V!t*0o)vG`H(*(p@m2kQ-DVSK()>5vmoM z!KbjwDe;Kuz#-C66dVE@JWeNDrE=ieC^K2mQR18qdtG3ONO0!yOKF%Ua{^|`oGRZiUAp~bB-7WBxGDIn!RB}US$Xu*AV1#+OP3uYvLQ8QDtdT2Z=6@S* j*@iI$f5MMcg1^ET{o-3FWyRxZl@R7xsW=9N + diff --git a/frontend/src/components/ArticleList.vue b/frontend/src/components/ArticleList.vue index 88f12eb..d53a03b 100644 --- a/frontend/src/components/ArticleList.vue +++ b/frontend/src/components/ArticleList.vue @@ -1,47 +1,52 @@ @@ -159,12 +192,24 @@ export default { padding: 1rem; } +.image { + width: 100px; + border-radius: 10px; + box-shadow: darkslategrey 0 0 12px; +} +.image-container { + width: 100px; +} +.grid { + padding-bottom: 10px; +} + .article-title { - font-size: 1.2rem; + font-size: 1.5rem; font-weight: bolder; text-decoration: none; color: blue; - padding: 5px 0 5px 0; + padding: 15px 0 15px 0; } .tag { @@ -179,11 +224,12 @@ export default { #paginator { text-align: center; - padding-bottom: 4rem; + position: relative; } #paginator a { color: black; + padding-bottom: 75px; } .current-page { @@ -191,6 +237,7 @@ export default { font-weight: bold; padding-left: 10px; padding-right: 10px; + } .category { diff --git a/frontend/src/components/BlogFooter.vue b/frontend/src/components/BlogFooter.vue index 05feaa8..51f312e 100644 --- a/frontend/src/components/BlogFooter.vue +++ b/frontend/src/components/BlogFooter.vue @@ -1,15 +1,15 @@ diff --git a/frontend/src/components/BlogHeader.vue b/frontend/src/components/BlogHeader.vue index 4e9b7bc..6e89811 100644 --- a/frontend/src/components/BlogHeader.vue +++ b/frontend/src/components/BlogHeader.vue @@ -2,7 +2,7 @@