完善联调标准化与诊断链路
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { clearBackendAuthTokens, loadBackendAuthTokens, loadBackendBaseUrl } from '../../utils/backendAuth'
|
||||
import { getEntryHome, type BackendCardResult, type BackendEntryHomeResult } from '../../utils/backendApi'
|
||||
import { reportBackendClientLog } from '../../utils/backendClientLogs'
|
||||
import { setGlobalMockDebugBridgeEnabled } from '../../utils/globalMockDebugBridge'
|
||||
|
||||
const DEFAULT_CHANNEL_CODE = 'mini-demo'
|
||||
const DEFAULT_CHANNEL_TYPE = 'wechat_mini'
|
||||
@@ -100,6 +102,18 @@ Page({
|
||||
},
|
||||
|
||||
applyEntryHomeResult(result: BackendEntryHomeResult) {
|
||||
reportBackendClientLog({
|
||||
level: 'info',
|
||||
category: 'entry-home',
|
||||
message: 'entry home loaded',
|
||||
details: {
|
||||
ongoingSessionId: result.ongoingSession && result.ongoingSession.id ? result.ongoingSession.id : '',
|
||||
ongoingEventId: result.ongoingSession && result.ongoingSession.eventId ? result.ongoingSession.eventId : '',
|
||||
recentSessionId: result.recentSession && result.recentSession.id ? result.recentSession.id : '',
|
||||
recentEventId: result.recentSession && result.recentSession.eventId ? result.recentSession.eventId : '',
|
||||
cardEventIds: (result.cards || []).map((item) => (item.event && item.event.id ? item.event.id : '')),
|
||||
},
|
||||
})
|
||||
this.setData({
|
||||
loading: false,
|
||||
statusText: '首页加载完成',
|
||||
@@ -141,6 +155,7 @@ Page({
|
||||
|
||||
handleLogout() {
|
||||
clearBackendAuthTokens()
|
||||
setGlobalMockDebugBridgeEnabled(false)
|
||||
const app = getApp<IAppOption>()
|
||||
if (app.globalData) {
|
||||
app.globalData.backendAuthTokens = null
|
||||
|
||||
Reference in New Issue
Block a user