feat(chat): handle daily message paywall
This commit is contained in:
@@ -21,12 +21,17 @@ export interface ChatState {
|
||||
* - false:走 HTTP,消耗次数
|
||||
*/
|
||||
wsConnected: boolean;
|
||||
/** 当前非游客用户是否 VIP;游客会话固定 false。 */
|
||||
isVip: boolean;
|
||||
/** 游客剩余配额(次/天)—— 仅游客业务展示用
|
||||
*/
|
||||
guestRemainingQuota: number;
|
||||
/** 游客总配额(仅游客展示用) */
|
||||
guestTotalQuota: number;
|
||||
quotaExceededTrigger: number;
|
||||
paywallTriggered: boolean;
|
||||
paywallReason: "daily_limit" | null;
|
||||
paywallDetail: { usedToday: number; limit: number } | null;
|
||||
isLoadingMore: boolean;
|
||||
hasMore: boolean;
|
||||
historyOffset: number;
|
||||
@@ -46,9 +51,13 @@ export const initialState: ChatState = {
|
||||
messages: [],
|
||||
isReplyingAI: false,
|
||||
wsConnected: false,
|
||||
isVip: false,
|
||||
guestRemainingQuota: 0,
|
||||
guestTotalQuota: 0,
|
||||
quotaExceededTrigger: 0,
|
||||
paywallTriggered: false,
|
||||
paywallReason: null,
|
||||
paywallDetail: null,
|
||||
isLoadingMore: false,
|
||||
hasMore: true,
|
||||
historyOffset: 0,
|
||||
|
||||
Reference in New Issue
Block a user