style: remove markdown bold syntax from code comments
Remove `**...**` emphasis markers from inline comments and JSDoc blocks across auth and chat components, machine mappers, and quota helpers. These are plain code comments, not rendered markdown, so the bold syntax was noise. Files touched: - src/app/auth/components/auth-screen.tsx - src/app/chat/components/chat-header.tsx - src/app/chat/components/chat-screen.tsx - chat machine mapper / quota helpers No functional or behavioral changes.
This commit is contained in:
@@ -6,8 +6,8 @@
|
||||
* 认证仓库:编排远程 API + 本地 AuthStorage + UserStorage。
|
||||
* 行为对齐原 Dart `lib/data/repositories/auth_repository_impl.dart`:
|
||||
* - 登录成功后调 `_saveLoginData` 持久化 token + User
|
||||
* - 登出先调 API,再**强制**清本地态(无论 API 成败)
|
||||
* - `getCurrentUser` 成功后**尽力**写本地 User 缓存(不因缓存失败影响主流程)
|
||||
* - 登出先调 API,再强制清本地态(无论 API 成败)
|
||||
* - `getCurrentUser` 成功后尽力写本地 User 缓存(不因缓存失败影响主流程)
|
||||
* - 写 storage 失败用 `console.warn` 记录,不让本地缓存失败影响主流程
|
||||
*
|
||||
* 原始 Dart: lib/data/repositories/auth_repository_impl.dart
|
||||
@@ -98,7 +98,7 @@ export class AuthRepository implements IAuthRepository {
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出登录:先调 API 注销服务端会话,**无论成败**都清本地登录态。
|
||||
* 退出登录:先调 API 注销服务端会话,无论成败都清本地登录态。
|
||||
* 强制清本地的逻辑:用户即使在 API 失败时也想从设备上登出。
|
||||
*/
|
||||
async logout(): Promise<Result<void>> {
|
||||
@@ -237,7 +237,7 @@ export class AuthRepository implements IAuthRepository {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录用户。成功后**尽力**写本地 User 缓存(offline hydrate),
|
||||
* 获取当前登录用户。成功后尽力写本地 User 缓存(offline hydrate),
|
||||
* 缓存失败用 `console.warn` 记录,不影响主流程。
|
||||
*/
|
||||
async getCurrentUser(): Promise<Result<User>> {
|
||||
|
||||
@@ -40,7 +40,7 @@ export interface IAuthRepository {
|
||||
sendCode(email: string): Promise<Result<void>>;
|
||||
|
||||
/**
|
||||
* 退出登录:先调 API 注销服务端会话,**无论成败**都清本地登录态。
|
||||
* 退出登录:先调 API 注销服务端会话,无论成败都清本地登录态。
|
||||
*/
|
||||
logout(): Promise<Result<void>>;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export const ChatSendResponseSchema = z.object({
|
||||
currentMood: z.string().default(""),
|
||||
messageId: z.string(),
|
||||
isGuest: z.boolean().default(false),
|
||||
// 函数式 default —— 每次 parse 时**重新**调 Date.now()(后端不返回 timestamp 时用**当下**时间)
|
||||
// 函数式 default —— 每次 parse 时重新调 Date.now()(后端不返回 timestamp 时用当下时间)
|
||||
timestamp: z.number().default(() => Date.now()),
|
||||
});
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ export class ChatStorage implements IChatStorage {
|
||||
// ---- guest daily chat quota ----
|
||||
|
||||
getGuestDailyChatQuota(): Promise<ResultT<GuestChatQuotaData | null>> {
|
||||
// get-or-init:**有**返**有**,**无**则**用** DTO 默认**值**(`threshold` = max per day)**初**始**化**并**返**回**
|
||||
// get-or-init:有返有,无则用 DTO 默认值(`threshold` = max per day)初始化并返回
|
||||
return SpAsyncUtil.getJson(
|
||||
StorageKeys.guestChatQuota,
|
||||
GuestChatQuotaSchema,
|
||||
@@ -57,7 +57,7 @@ export class ChatStorage implements IChatStorage {
|
||||
today,
|
||||
);
|
||||
if (Result.isErr(initResult)) {
|
||||
return existing; // **初**始**化**失**败** → **返**原**始** null
|
||||
return existing; // 初始化失败 → 返原始 null
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
@@ -78,7 +78,7 @@ export class ChatStorage implements IChatStorage {
|
||||
// ---- guest total quota ----
|
||||
|
||||
getGuestTotalQuota(): Promise<ResultT<number | null>> {
|
||||
// get-or-init:**有**返**有**,**无**则**用** DTO 默认**值**(`totalQuotaDefault`)**初**始**化**并**返**回**
|
||||
// get-or-init:有返有,无则用 DTO 默认值(`totalQuotaDefault`)初始化并返回
|
||||
return SpAsyncUtil.getJson(
|
||||
StorageKeys.guestTotalQuotaRemaining,
|
||||
z.number(),
|
||||
|
||||
Reference in New Issue
Block a user