feat:性能优化

This commit is contained in:
2026-07-25 09:12:36 +08:00
parent 3eba959b48
commit 9ab39d2aec
138 changed files with 232 additions and 1511 deletions
+27
View File
@@ -0,0 +1,27 @@
import { KEFU_BASE_URL, Authorization } from '@/utils/config.js'
import { getStorageFun, TOKEN_NAME } from '@/utils/auth.js'
export function getUnreadCount(userId) {
const token = getStorageFun(TOKEN_NAME)
return new Promise((resolve, reject) => {
uni.request({
url: `${KEFU_BASE_URL}/kefu/user/unread-count`,
method: 'GET',
data: { userId },
header: {
Authorization,
'HSM-AUTH': token || '',
'content-type': 'application/json'
},
success: response => {
const body = response.data || {}
if (response.statusCode >= 200 && response.statusCode < 300 && body.bizcode === 100) {
resolve(Number(body.data || 0))
return
}
resolve(0)
},
fail: () => resolve(0)
})
})
}