mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-08-17 08:40:59 +00:00
feat: update header
This commit is contained in:
@@ -86,7 +86,9 @@ export default {
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
goToHome() {
|
goToHome() {
|
||||||
this.$router.push('/')
|
this.$router.push('/').then(() => {
|
||||||
|
window.location.reload()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
goToLogin() {
|
goToLogin() {
|
||||||
this.$router.push('/login')
|
this.$router.push('/login')
|
||||||
|
|||||||
@@ -19,19 +19,11 @@
|
|||||||
<div v-if="status === 'REJECTED'" class="article-block-button">
|
<div v-if="status === 'REJECTED'" class="article-block-button">
|
||||||
已拒绝
|
已拒绝
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="loggedIn && !isAuthor && !subscribed" class="article-subscribe-button" @click="subscribePost">
|
||||||
v-if="loggedIn && !isAuthor && !subscribed"
|
|
||||||
class="article-subscribe-button"
|
|
||||||
@click="subscribePost"
|
|
||||||
>
|
|
||||||
<i class="fas fa-user-plus"></i>
|
<i class="fas fa-user-plus"></i>
|
||||||
订阅文章
|
订阅文章
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="loggedIn && !isAuthor && subscribed" class="article-unsubscribe-button" @click="unsubscribePost">
|
||||||
v-if="loggedIn && !isAuthor && subscribed"
|
|
||||||
class="article-unsubscribe-button"
|
|
||||||
@click="unsubscribePost"
|
|
||||||
>
|
|
||||||
<i class="fas fa-user-minus"></i>
|
<i class="fas fa-user-minus"></i>
|
||||||
取消订阅
|
取消订阅
|
||||||
</div>
|
</div>
|
||||||
@@ -332,13 +324,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const unsubscribePost = async () => {
|
|
||||||
const token = getToken()
|
|
||||||
if (!token) {
|
|
||||||
toast.error('请先登录')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const approvePost = async () => {
|
const approvePost = async () => {
|
||||||
const token = getToken()
|
const token = getToken()
|
||||||
if (!token) return
|
if (!token) return
|
||||||
@@ -368,6 +353,14 @@ export default {
|
|||||||
toast.error('操作失败')
|
toast.error('操作失败')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const unsubscribePost = async () => {
|
||||||
|
const token = getToken()
|
||||||
|
if (!token) {
|
||||||
|
toast.error('请先登录')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const res = await fetch(`${API_BASE_URL}/api/subscriptions/posts/${postId}`, {
|
const res = await fetch(`${API_BASE_URL}/api/subscriptions/posts/${postId}`, {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
headers: { Authorization: `Bearer ${token}` }
|
headers: { Authorization: `Bearer ${token}` }
|
||||||
|
|||||||
Reference in New Issue
Block a user