feat 首页不登陆
This commit is contained in:
@@ -13,7 +13,12 @@
|
||||
</view>
|
||||
|
||||
<view class="record-section">
|
||||
<view v-if="recordList.length > 0" class="record-list">
|
||||
<view v-if="isNotLoggedIn" class="empty-record">
|
||||
<text class="empty-icon">🔐</text>
|
||||
<text class="empty-text">需要登录</text>
|
||||
<text class="empty-hint">登录后才会记录答题记录</text>
|
||||
</view>
|
||||
<view v-else-if="recordList.length > 0" class="record-list">
|
||||
<view v-for="(record, index) in recordList" :key="index" class="record-item" @click="handleRecordClick(record)">
|
||||
<view class="record-header">
|
||||
<view class="record-category">{{ record.category }}</view>
|
||||
@@ -105,7 +110,8 @@ export default {
|
||||
isFirstLoad: true,
|
||||
showDetail: false,
|
||||
detailQuestion: null,
|
||||
detailLoading: false
|
||||
detailLoading: false,
|
||||
isNotLoggedIn: false
|
||||
}
|
||||
},
|
||||
|
||||
@@ -168,6 +174,7 @@ export default {
|
||||
if (!isLoadMore) {
|
||||
this.currentPage = 1
|
||||
this.hasMore = true
|
||||
this.isNotLoggedIn = false
|
||||
}
|
||||
|
||||
if (!this.hasMore) return
|
||||
@@ -198,6 +205,10 @@ export default {
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取答题记录失败:', error)
|
||||
// 检查是否是401错误
|
||||
if (error.message && error.message.includes('401')) {
|
||||
this.isNotLoggedIn = true
|
||||
}
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user