+
+
-
-
-
![good.name]()
-
{{ good.name }}
-
-
- {{ good.cost }} 积分
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+ 发送帖子
+ {{
+ item.postTitle
+ }}
+ ,获得{{ item.amount }}积分
+
+
+ 在文章
+ {{
+ item.postTitle
+ }}
+ 中
+
+ 发送评论
+ {{ stripMarkdownLength(item.commentContent, 100) }}
+ ,获得{{ item.amount }}积分
+
+
+ 被评论
+ {{ stripMarkdownLength(item.commentContent, 100) }}
+ ,获得{{ item.amount }}积分
+
+
+
+ 帖子
+ {{
+ item.postTitle
+ }}
+ 被
+ {{
+ item.fromUserName
+ }}
+ 按赞,获得{{ item.amount }}积分
+
+
+ 评论
+ {{ stripMarkdownLength(item.commentContent, 100) }}
+ 被
+ {{
+ item.fromUserName
+ }}
+ 按赞,获得{{ item.amount }}积分
+
+
+ 邀请了好友
+ {{
+ item.fromUserName
+ }}
+ 加入社区 🎉,获得 {{ item.amount }} 积分
+
+
+ 文章
+ {{
+ item.postTitle
+ }}
+ 被收录为精选,获得 {{ item.amount }} 积分
+
+
+ 兑换商品,消耗 {{ -item.amount }} 积分
+
+ 积分历史系统上线
+ 你目前的积分是 {{ item.balance }}
+
+ {{ TimeManager.format(item.createdAt) }}
+
+
+
+
@@ -1067,6 +1071,7 @@ onMounted(async () => {
white-space: nowrap;
}
+.article-closed-button,
.article-subscribe-button-text,
.article-unsubscribe-button-text {
white-space: nowrap;
diff --git a/frontend_nuxt/pages/settings.vue b/frontend_nuxt/pages/settings.vue
index 7178ee347..cc2028e38 100644
--- a/frontend_nuxt/pages/settings.vue
+++ b/frontend_nuxt/pages/settings.vue
@@ -38,10 +38,7 @@
@@ -76,6 +73,7 @@ import { ref, onMounted, watch } from 'vue'
import AvatarCropper from '~/components/AvatarCropper.vue'
import BaseInput from '~/components/BaseInput.vue'
import Dropdown from '~/components/Dropdown.vue'
+import BaseSwitch from '~/components/BaseSwitch.vue'
import { toast } from '~/main'
import { fetchCurrentUser, getToken, setToken } from '~/utils/auth'
import { frostedState, setFrosted } from '~/utils/frosted'
@@ -318,51 +316,6 @@ const save = async () => {
max-width: 200px;
}
-.switch {
- position: relative;
- display: inline-block;
- width: 40px;
- height: 20px;
-}
-
-.switch input {
- opacity: 0;
- width: 0;
- height: 0;
-}
-
-.slider {
- position: absolute;
- cursor: pointer;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- background-color: #ccc;
- transition: 0.2s;
- border-radius: 20px;
-}
-
-.slider:before {
- position: absolute;
- content: '';
- height: 16px;
- width: 16px;
- left: 2px;
- bottom: 2px;
- background-color: white;
- transition: 0.2s;
- border-radius: 50%;
-}
-
-input:checked + .slider {
- background-color: var(--primary-color);
-}
-
-input:checked + .slider:before {
- transform: translateX(20px);
-}
-
.profile-section {
margin-bottom: 30px;
}
diff --git a/frontend_nuxt/plugins/auth-fetch.client.ts b/frontend_nuxt/plugins/auth-fetch.client.ts
index 0a07440b8..dae8d6e3b 100644
--- a/frontend_nuxt/plugins/auth-fetch.client.ts
+++ b/frontend_nuxt/plugins/auth-fetch.client.ts
@@ -1,7 +1,7 @@
import { clearToken } from '~/utils/auth'
export default defineNuxtPlugin(() => {
- if (process.client) {
+ if (import.meta.client) {
const originalFetch = window.fetch
window.fetch = async (input, init) => {
const response = await originalFetch(input, init)
diff --git a/frontend_nuxt/plugins/toastification.client.ts b/frontend_nuxt/plugins/toastification.client.ts
index 2a9fd3f31..789a8f5a9 100644
--- a/frontend_nuxt/plugins/toastification.client.ts
+++ b/frontend_nuxt/plugins/toastification.client.ts
@@ -4,7 +4,7 @@ import '~/assets/toast.css'
export default defineNuxtPlugin(async (nuxtApp) => {
// 确保只在客户端环境中注册插件
- if (process.client) {
+ if (import.meta.client) {
try {
// 使用动态导入来避免 CommonJS 模块问题
const { default: Toast, POSITION } = await import('vue-toastification')
diff --git a/frontend_nuxt/public/tencent2707107139169774686.txt b/frontend_nuxt/public/tencent2707107139169774686.txt
new file mode 100644
index 000000000..71aded954
--- /dev/null
+++ b/frontend_nuxt/public/tencent2707107139169774686.txt
@@ -0,0 +1 @@
+1839503219847005265
\ No newline at end of file
diff --git a/frontend_nuxt/utils/auth.js b/frontend_nuxt/utils/auth.js
index a4f87e15e..6fb558c13 100644
--- a/frontend_nuxt/utils/auth.js
+++ b/frontend_nuxt/utils/auth.js
@@ -12,7 +12,7 @@ export const authState = reactive({
role: null,
})
-if (process.client) {
+if (import.meta.client) {
authState.loggedIn =
localStorage.getItem(TOKEN_KEY) !== null && localStorage.getItem(TOKEN_KEY) !== ''
authState.userId = localStorage.getItem(USER_ID_KEY)
@@ -21,18 +21,18 @@ if (process.client) {
}
export function getToken() {
- return process.client ? localStorage.getItem(TOKEN_KEY) : null
+ return import.meta.client ? localStorage.getItem(TOKEN_KEY) : null
}
export function setToken(token) {
- if (process.client) {
+ if (import.meta.client) {
localStorage.setItem(TOKEN_KEY, token)
authState.loggedIn = true
}
}
export function clearToken() {
- if (process.client) {
+ if (import.meta.client) {
localStorage.removeItem(TOKEN_KEY)
clearUserInfo()
authState.loggedIn = false
@@ -40,7 +40,7 @@ export function clearToken() {
}
export function setUserInfo({ id, username }) {
- if (process.client) {
+ if (import.meta.client) {
authState.userId = id
authState.username = username
if (arguments[0] && arguments[0].role) {
@@ -53,7 +53,7 @@ export function setUserInfo({ id, username }) {
}
export function clearUserInfo() {
- if (process.client) {
+ if (import.meta.client) {
localStorage.removeItem(USER_ID_KEY)
localStorage.removeItem(USERNAME_KEY)
localStorage.removeItem(ROLE_KEY)
diff --git a/frontend_nuxt/utils/medal.js b/frontend_nuxt/utils/medal.js
index 2f61e537d..efc8ea1f8 100644
--- a/frontend_nuxt/utils/medal.js
+++ b/frontend_nuxt/utils/medal.js
@@ -1,6 +1,7 @@
export const medalTitles = {
COMMENT: '评论达人',
POST: '发帖达人',
+ FEATURED: '精选作者',
SEED: '种子用户',
CONTRIBUTOR: '贡献者',
PIONEER: '开山鼻祖',
diff --git a/frontend_nuxt/utils/notification.js b/frontend_nuxt/utils/notification.js
index 512b4267a..2d3fcc410 100644
--- a/frontend_nuxt/utils/notification.js
+++ b/frontend_nuxt/utils/notification.js
@@ -26,6 +26,8 @@ const iconMap = {
LOTTERY_WIN: 'fas fa-trophy',
LOTTERY_DRAW: 'fas fa-bullhorn',
MENTION: 'fas fa-at',
+ POST_DELETED: 'fas fa-trash',
+ POST_FEATURED: 'fas fa-star',
}
export async function fetchUnreadCount() {
@@ -158,7 +160,7 @@ function createFetchNotifications() {
...n,
src: n.comment.author.avatar,
iconClick: () => {
- markRead(n.id)
+ markNotificationRead(n.id)
navigateTo(`/users/${n.comment.author.id}`, { replace: true })
},
})
@@ -168,7 +170,7 @@ function createFetchNotifications() {
emoji: reactionEmojiMap[n.reactionType],
iconClick: () => {
if (n.fromUser) {
- markRead(n.id)
+ markNotificationRead(n.id)
navigateTo(`/users/${n.fromUser.id}`, { replace: true })
}
},
@@ -180,7 +182,19 @@ function createFetchNotifications() {
icon: n.fromUser ? undefined : iconMap[n.type],
iconClick: () => {
if (n.fromUser) {
- markRead(n.id)
+ markNotificationRead(n.id)
+ navigateTo(`/users/${n.fromUser.id}`, { replace: true })
+ }
+ },
+ })
+ } else if (n.type === 'POST_DELETED') {
+ arr.push({
+ ...n,
+ src: n.fromUser ? n.fromUser.avatar : null,
+ icon: n.fromUser ? undefined : iconMap[n.type],
+ iconClick: () => {
+ if (n.fromUser) {
+ markNotificationRead(n.id)
navigateTo(`/users/${n.fromUser.id}`, { replace: true })
}
},
@@ -191,7 +205,7 @@ function createFetchNotifications() {
icon: iconMap[n.type],
iconClick: () => {
if (n.post) {
- markRead(n.id)
+ markNotificationRead(n.id)
navigateTo(`/posts/${n.post.id}`)
}
},
@@ -201,7 +215,7 @@ function createFetchNotifications() {
...n,
src: n.comment.author.avatar,
iconClick: () => {
- markRead(n.id)
+ markNotificationRead(n.id)
navigateTo(`/users/${n.comment.author.id}`, { replace: true })
},
})
@@ -211,7 +225,7 @@ function createFetchNotifications() {
icon: iconMap[n.type],
iconClick: () => {
if (n.fromUser) {
- markRead(n.id)
+ markNotificationRead(n.id)
navigateTo(`/users/${n.fromUser.id}`, { replace: true })
}
},
@@ -222,7 +236,7 @@ function createFetchNotifications() {
icon: iconMap[n.type],
iconClick: () => {
if (n.fromUser) {
- markRead(n.id)
+ markNotificationRead(n.id)
navigateTo(`/users/${n.fromUser.id}`, { replace: true })
}
},
@@ -237,7 +251,7 @@ function createFetchNotifications() {
icon: iconMap[n.type],
iconClick: () => {
if (n.post) {
- markRead(n.id)
+ markNotificationRead(n.id)
navigateTo(`/posts/${n.post.id}`, { replace: true })
}
},
@@ -249,7 +263,18 @@ function createFetchNotifications() {
icon: n.fromUser ? undefined : iconMap[n.type],
iconClick: () => {
if (n.post) {
- markRead(n.id)
+ markNotificationRead(n.id)
+ navigateTo(`/posts/${n.post.id}`, { replace: true })
+ }
+ },
+ })
+ } else if (n.type === 'POST_FEATURED') {
+ arr.push({
+ ...n,
+ icon: iconMap[n.type],
+ iconClick: () => {
+ if (n.post) {
+ markNotificationRead(n.id)
navigateTo(`/posts/${n.post.id}`, { replace: true })
}
},
@@ -277,7 +302,7 @@ function createFetchNotifications() {
}
}
- const markRead = async (id) => {
+ const markNotificationRead = async (id) => {
if (!id) return
const n = notifications.value.find((n) => n.id === id)
if (!n || n.read) return
@@ -319,7 +344,7 @@ function createFetchNotifications() {
}
return {
fetchNotifications,
- markRead,
+ markNotificationRead,
notifications,
isLoadingMessage,
markAllRead,
@@ -329,7 +354,7 @@ function createFetchNotifications() {
export const {
fetchNotifications,
- markRead,
+ markNotificationRead,
notifications,
isLoadingMessage,
markAllRead,