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_3l&Dan
zL5qI|_%5K20fsPwVmLukG{f@v0-;DOk;>!>PN`CBv^u@PXfj)@UA_eDC%W{=-gdci
z$Z6rG2IIAV;Qo_FN7
zl0}A%wqhA_)1opK4RE~
zmZ~-$Cg(;ibp@Go_|ItukB?ERStSYiqMB4;-0j>enTS1&>k$}jCG2$`S(>UruML!J
WwUeALwn#hT>scPXN4<;&M*ska_kgMZ
diff --git a/src/store/index.ts b/src/store/index.ts
index 673e609..3ef6c4a 100644
--- a/src/store/index.ts
+++ b/src/store/index.ts
@@ -61,6 +61,15 @@ export const useStore = defineStore('user', {
localStorage.setItem("LongToken", longToken)
localStorage.setItem("isAutoLogin", "true")
},
+ getUserLongToken () {
+ if (sessionStorage.getItem("LongToken") !== null) {
+ this.longToken = sessionStorage.getItem("LongToken") as string
+ }
+ else if (localStorage.getItem("LongToken") !== null) {
+ this.longToken = localStorage.getItem("LongToken") as string
+ }
+ return this.longToken
+ },
loginOut () {
localStorage.removeItem("UserId")
diff --git a/src/views/home/announced.vue b/src/views/home/announced.vue
index cfd974b..828888c 100644
--- a/src/views/home/announced.vue
+++ b/src/views/home/announced.vue
@@ -1,9 +1,14 @@
-
+
\ No newline at end of file
diff --git a/src/views/home/home.vue b/src/views/home/home.vue
index f2b3409..8fa2e54 100644
--- a/src/views/home/home.vue
+++ b/src/views/home/home.vue
@@ -151,32 +151,33 @@ onMounted(() => {
.section-bottom {
width: 100%;
padding: 0 2% 0;
+ margin-bottom: 20px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
- margin-bottom: 20px;
.recommend {
- max-width: 740px;
+ width: 790px;
height: 780px;
margin-right: 10px;
}
.right {
+ width: 400px;
height: 780px;
display: flex;
flex-direction: column;
.rank {
- width: 450px;
+ max-width: 400px;
height: 520px;
background-color: #fff;
margin-bottom: 10px;
}
.announced {
- width: 450px;
+ max-width: 400px;
height: 250px;
background-color: #fff;
}
@@ -193,4 +194,32 @@ onMounted(() => {
}
}
}
+
+@media screen and (max-width: 1000px){
+
+ .section-top {
+ width: 100%;
+ }
+ .section-bottom {
+ width: 100%;
+ padding: 0;
+ margin: 0;
+
+ display: flex;
+ flex-direction: column;
+
+ .recommend {
+ width: 100%;
+ margin-right: 0;
+ }
+
+ .rank {
+ width: 100%;
+ }
+
+ .announced {
+ width: 100%;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/views/home/rank.vue b/src/views/home/rank.vue
index 76edc8b..967ab40 100644
--- a/src/views/home/rank.vue
+++ b/src/views/home/rank.vue
@@ -7,7 +7,7 @@
\ No newline at end of file
diff --git a/src/views/home/show-recommend.vue b/src/views/home/show-recommend.vue
new file mode 100644
index 0000000..ccad4ce
--- /dev/null
+++ b/src/views/home/show-recommend.vue
@@ -0,0 +1,265 @@
+
+
+
+
+
+
+
+
+
+
+
+
{{ post.userName }}
+
:
+
{{ post.text }}
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/posts/posts.vue b/src/views/posts/posts.vue
index 9d1dd53..ec7a1ce 100644
--- a/src/views/posts/posts.vue
+++ b/src/views/posts/posts.vue
@@ -84,9 +84,12 @@ import popup from '@/views/home/popup.vue'
import { ref, onMounted } from 'vue'
import { getOtherPosts } from './utils'
import { post } from '@/utils/request'
+import { useStore } from '@/store/index'
import type { responseGetOtherPosts } from './utils'
+import { errorMsg } from '@/utils/message'
const isPopup = ref(false)
+const store = useStore()
const postsList = ref({
posts: []
})
@@ -96,7 +99,11 @@ onMounted(async () => {
})
const likePost = (thisPost: any) => {
- //还需要判断用户是否登录,只有登录才可以点赞
+ const longToken = store.getUserLongToken()
+ if (!longToken) {
+ errorMsg('请先登录')
+ return
+ }
post('/relation/createRelation', {
toId: thisPost.postId,
toType: 4,