@lark-apaas/coding-template-nestjs-react-fullstack 0.1.52 → 0.1.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/coding-template-nestjs-react-fullstack",
3
- "version": "0.1.52",
3
+ "version": "0.1.54",
4
4
  "description": "NestJS + React fullstack template for miaoda coding",
5
5
  "type": "module",
6
6
  "files": [
@@ -10,7 +10,13 @@ export const userProfileQueries = {
10
10
  queryOptions({
11
11
  queryKey: [...userProfileQueries.all(), 'byId', accountType, userId],
12
12
  queryFn: ({ signal }) => fetchUserProfile(userId, accountType, signal),
13
- staleTime: 1 * 60 * 1000,
13
+ // staleTime 0:每次打开都在后台取一次新的,和飞书名片那条路保持一致
14
+ // ——「打开渲染缓存、后台乐观更新」。缓存命中时 isPending 为 false,
15
+ // 卡片瞬间渲出不转圈;新数据回来后 React 只 patch 变化的字段,不闪不跳。
16
+ //
17
+ // 之前是 60s:那段窗口内连请求都不发,远端改了最多要等 60 秒才看得到。
18
+ staleTime: 0,
19
+ // gcTime 决定缓存能留多久 —— 它才是「秒出」的来源,不要跟着一起调小。
14
20
  gcTime: 5 * 60 * 1000,
15
21
  enabled: !!userId,
16
22
  }),
@@ -13,6 +13,18 @@ import {
13
13
  PopoverTrigger,
14
14
  } from '@client/src/components/ui/popover';
15
15
 
16
+ /**
17
+ * 阻止 Popover 打开时的自动聚焦。
18
+ *
19
+ * Radix 的 FocusScope 在弹层挂载时会把焦点给容器里第一个可聚焦元素。人员卡片
20
+ * 挂载那一刻内容就已经在了(飞书名片里有「消息」等按钮),于是一打开就有个
21
+ * 按钮带上焦点环。这是张只读预览卡,焦点应该留在触发器上 —— Radix 自己的
22
+ * HoverCard 也是这么处理的。
23
+ */
24
+ const handleProfileOpenAutoFocus = (event: Event) => {
25
+ event.preventDefault();
26
+ };
27
+
16
28
  export interface IUserDisplayProps {
17
29
  /**
18
30
  * 用户列表
@@ -88,6 +100,7 @@ export const UserDisplay: React.FC<IUserDisplayProps> = ({
88
100
  <PopoverContent
89
101
  align="start"
90
102
  sideOffset={8}
103
+ onOpenAutoFocus={handleProfileOpenAutoFocus}
91
104
  className="w-[320px] border-0 border-border/50 bg-card p-0 shadow-[0px_8px_24px_8px_rgba(31,35,41,0.04),0px_6px_12px_rgba(31,35,41,0.04),0px_4px_8px_-8px_rgba(31,35,41,0.06)]"
92
105
  >
93
106
  <UserProfile value={user} />
@@ -0,0 +1,217 @@
1
+ /**
2
+ * 飞书名片 `<tt-profile>` 的 DOM 池。
3
+ *
4
+ * 为什么 DOM 能被复用:
5
+ * 飞书 h5-js-sdk 的 `tt-profile` 在 `customRender()` 里把 React 渲染进元素自身
6
+ * (`ReactDOM.render(..., this)`),但 `disconnectedCallback()` 卸载的是
7
+ * `this.shadowRoot` —— 两者不是同一个节点,`unmountComponentAtNode` 打空,
8
+ * 所以把元素从文档里摘下来并不会销毁它的内容。又因为基类的 `componentRender()`
9
+ * 被 `_hasMounted` 一次性闸门挡住,重新挂回文档也不会触发二次渲染。
10
+ * 净效果:摘下来存着、下次挂回去,内容原样还在,且不会重新发请求。
11
+ *
12
+ * ⚠️ 这依赖 SDK 当前实现(h5-js-sdk 1.2.21)。升级 SDK 后必须重新验证:
13
+ * 把一个已渲染的 `<tt-profile>` `remove()` 再 `appendChild()` 回去,
14
+ * 内容是否仍在、交互是否仍可用。失效时本模块应整体降级为「每次重建」。
15
+ */
16
+
17
+ /** 池容量上限,超出按最近使用顺序淘汰 */
18
+ /* 暂时放大到 20:观察同时备更多人时的内存与渲染开销,确认后再定最终值 */
19
+ let maxEntries = 20;
20
+
21
+ /**
22
+ * 调整缓存策略:需要同时备好更多人的卡片时调大 maxEntries。
23
+ *
24
+ * 没有 TTL —— 每次打开都会重新渲染一次做更新,备用卡只决定「打开瞬间
25
+ * 显示什么」,不决定数据新鲜度。
26
+ */
27
+ export function configureCardPool(options: { maxEntries?: number }): void {
28
+ if (typeof options.maxEntries === 'number') maxEntries = options.maxEntries;
29
+ }
30
+
31
+ /** 飞书名片渲染完成的标志节点:姓名有文字即认为内容已就绪(骨架屏阶段为空) */
32
+ const READY_SELECTOR = '.larkw-userprofile__profile__alias-or-username-text';
33
+
34
+ /** 等待渲染完成的上限,超时按失败处理,不替换当前展示的卡片 */
35
+ const READY_TIMEOUT_MS = 8 * 1000;
36
+
37
+ /**
38
+ * 备用卡池:每个 openId 一张**已渲染好、但从未显示过**的活 `<tt-profile>`,
39
+ * 停在离屏容器里。
40
+ *
41
+ * 为什么不直接缓存用户看过的那张:活元素会被用户操作 —— 滚动、点进上级的
42
+ * 名片、点开个性签名编辑框。这些状态一半在 DOM(inline 样式,能读能写),
43
+ * 一半在飞书 React 的内部 state(外部读不到也写不回)。既然无法可靠地把它
44
+ * 恢复成初始态,就干脆不复用它,而是另外备一张从没被碰过的。
45
+ *
46
+ * 代价是一个开关周期要渲染两次:一次换上去做更新,一次补充下次的备用卡。
47
+ */
48
+ const pool = new Map<string, Element>();
49
+
50
+ /** 取走某人的备用卡(取走即消耗,调用方负责挂载)。没有则返回 null。 */
51
+ export function takeSpare(openId: string): Element | null {
52
+ const spare = pool.get(openId);
53
+ if (!spare) return null;
54
+ pool.delete(openId);
55
+ return spare;
56
+ }
57
+
58
+ /**
59
+ * 停放一张备用卡。元素应当停留在离屏容器里,不要挂进可见区域 ——
60
+ * 一旦被用户看到就可能被操作,就不再是初始态了。
61
+ */
62
+ export function putSpare(openId: string, live: Element): void {
63
+ pool.get(openId)?.remove();
64
+ pool.delete(openId);
65
+ pool.set(openId, live);
66
+
67
+ while (pool.size > maxEntries) {
68
+ const oldest = pool.keys().next().value;
69
+ if (oldest === undefined) break;
70
+ pool.get(oldest)?.remove();
71
+ pool.delete(oldest);
72
+ }
73
+ }
74
+
75
+ /** 某人是否已经备好卡(用于决定要不要补渲染) */
76
+ export function hasSpare(openId: string): boolean {
77
+ return pool.has(openId);
78
+ }
79
+
80
+ /** 同一个人同时在途的渲染任务,用于去重 */
81
+ const inflight = new Map<string, Promise<Element | null>>();
82
+
83
+ /**
84
+ * 保证同一个人同时只有一次渲染在途:重复调用复用同一个 Promise。
85
+ *
86
+ * 这不是优化而是正确性要求 —— effect 会被重复执行(React dev 下的双调用、
87
+ * 依赖变化、popover 快速开关),没有这层去重就会创建出多个 `<tt-profile>`,
88
+ * 每个都往飞书发一次请求。
89
+ *
90
+ * key 由调用方给 —— 同一个人的「打开后更新」和「补充备用卡」是两件独立的
91
+ * 事,不能互相去重,所以用 `<openId>:update` / `<openId>:spare` 区分。
92
+ */
93
+ export function ensureRender(
94
+ key: string,
95
+ create: () => Promise<Element | null>,
96
+ ): Promise<Element | null> {
97
+ const existing = inflight.get(key);
98
+ if (existing) return existing;
99
+
100
+ const task = create().finally(() => {
101
+ inflight.delete(key);
102
+ });
103
+
104
+ inflight.set(key, task);
105
+ return task;
106
+ }
107
+
108
+ /** 丢弃某人的备用卡(渲染出错或需要强制重建时) */
109
+ export function dropSpare(openId: string): void {
110
+ pool.get(openId)?.remove();
111
+ pool.delete(openId);
112
+ }
113
+
114
+ /** 清空整个池。页面级登出 / 切租户时调用。 */
115
+ export function clearCardPool(): void {
116
+ pool.forEach((el) => {
117
+ el.remove();
118
+ });
119
+ pool.clear();
120
+ }
121
+
122
+ /**
123
+ * 等待一个 `<tt-profile>` 从骨架屏变成真实内容。
124
+ * 超时返回 false —— 调用方据此放弃替换,继续展示旧卡片。
125
+ */
126
+ export function waitForCardReady(
127
+ el: Element,
128
+ timeoutMs: number = READY_TIMEOUT_MS,
129
+ ): Promise<boolean> {
130
+ const isReady = () => {
131
+ const node = el.querySelector(READY_SELECTOR);
132
+ return Boolean(node?.textContent?.trim());
133
+ };
134
+
135
+ if (isReady()) return Promise.resolve(true);
136
+
137
+ return new Promise<boolean>((resolve) => {
138
+ const observer = new MutationObserver(() => {
139
+ if (!isReady()) return;
140
+ clearTimeout(timer);
141
+ observer.disconnect();
142
+ resolve(true);
143
+ });
144
+
145
+ const timer = setTimeout(() => {
146
+ observer.disconnect();
147
+ resolve(false);
148
+ }, timeoutMs);
149
+
150
+ observer.observe(el, {
151
+ childList: true,
152
+ subtree: true,
153
+ characterData: true,
154
+ });
155
+ });
156
+ }
157
+
158
+ /**
159
+ * 取「卡片里本人那一屏」的文字,用来判断本人的数据有没有被改动过。
160
+ *
161
+ * 不能直接用整张卡的 textContent —— 飞书名片是个卡片栈,用户点进上级的
162
+ * 名片时会往里压入第二屏,整张卡的文字就变了,但**本人的数据一个字没动**。
163
+ * 把那种情况误判成「数据变了」会白白丢弃备用卡,下次打开退回完整 loading。
164
+ *
165
+ * 栈里第一个 `.larkw-userprofile__manager__profile` 就是本人那一屏。
166
+ * 找不到这个结构时退回整张卡,宁可偶尔多丢一次缓存,也不要漏掉真实改动。
167
+ */
168
+ export function ownProfileText(el: Element): string {
169
+ const own =
170
+ el.querySelector('.larkw-userprofile__manager__profile') ?? el;
171
+ return own.textContent?.trim() ?? '';
172
+ }
173
+
174
+ const OFFSCREEN_ID = 'lark-profile-offscreen';
175
+
176
+ /**
177
+ * 离屏渲染容器:后台渲染的 `<tt-profile>` 先在这里成形,就绪后再挂到
178
+ * 可见位置,这样用户看不到骨架屏。
179
+ *
180
+ * 用绝对定位移出视口而不是 `display:none` —— 后者会让元素没有布局盒,
181
+ * 飞书名片内部依赖尺寸的逻辑可能不工作。
182
+ */
183
+ /**
184
+ * 为「一次渲染」开一个专属的离屏插槽。
185
+ *
186
+ * SDK 的 render() 只是把元素 append 到给定容器,不返回它,我们只能从容器
187
+ * 里取。多次渲染共用一个容器时(命中备用卡后,「打开后更新」和「预备下一张」
188
+ * 是并发的;一页多张卡片时更多),谁 append 在前无法保证,按「最后一个子节点」
189
+ * 取会张冠李戴 —— 两次渲染可能拿到同一个元素,甚至取到别人的名片。
190
+ *
191
+ * 每次渲染独占一个插槽,容器里就只会有本次创建的那一个。
192
+ */
193
+ export function createOffscreenSlot(): HTMLElement {
194
+ const slot = document.createElement('div');
195
+ getOffscreenHost().appendChild(slot);
196
+ return slot;
197
+ }
198
+
199
+ export function getOffscreenHost(): HTMLElement {
200
+ const existing = document.getElementById(OFFSCREEN_ID);
201
+ if (existing) return existing;
202
+
203
+ const host = document.createElement('div');
204
+ host.id = OFFSCREEN_ID;
205
+ host.setAttribute('aria-hidden', 'true');
206
+ host.style.cssText = [
207
+ 'position:absolute',
208
+ 'top:0',
209
+ 'left:-10000px',
210
+ 'width:320px',
211
+ 'height:520px',
212
+ 'overflow:hidden',
213
+ 'pointer-events:none',
214
+ ].join(';');
215
+ document.body.appendChild(host);
216
+ return host;
217
+ }
@@ -2,14 +2,30 @@
2
2
 
3
3
  import { logger } from '@lark-apaas/client-toolkit/logger';
4
4
 
5
- import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
5
+ import React, {
6
+ useCallback,
7
+ useEffect,
8
+ useId,
9
+ useMemo,
10
+ useRef,
11
+ useState,
12
+ } from 'react';
6
13
  import SHA1 from 'crypto-js/sha1';
7
14
 
8
- import {
9
- fetchUserProfile,
10
- getAssetsUrl,
11
- } from '@client/src/components/business-ui/api/user-profiles/service';
15
+ import { getAssetsUrl } from '@client/src/components/business-ui/api/user-profiles/service';
16
+ import { useUserProfile } from '@client/src/components/business-ui/api/user-profiles/queries';
12
17
  import { ErrorImage } from '@client/src/components/business-ui/user-profile/error-image';
18
+ import {
19
+ dropSpare,
20
+ ownProfileText,
21
+ ensureRender,
22
+ createOffscreenSlot,
23
+ getOffscreenHost,
24
+ hasSpare,
25
+ putSpare,
26
+ takeSpare,
27
+ waitForCardReady,
28
+ } from '@client/src/components/business-ui/user-profile/lark-card-pool';
13
29
  import { getEnv } from '@lark-apaas/client-toolkit/utils/getEnv';
14
30
  import { useExternalScript } from '@client/src/components/business-ui/user-profile/user-external-script';
15
31
  import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
@@ -67,8 +83,6 @@ function generateRandomString(length: number): string {
67
83
  return result;
68
84
  }
69
85
 
70
- type BaseUserProfileProps = BaseSimpleProfileProps | BaseOfficialProfileProps;
71
-
72
86
  const ACCOUNT_STATUS = {
73
87
  UNSPECIFIED: 0,
74
88
  Inactive: 1,
@@ -90,28 +104,31 @@ const AccountStatusMap: Record<AccountStatus, string> = {
90
104
  [ACCOUNT_STATUS.Resigned]: '已停用',
91
105
  };
92
106
 
93
- interface BaseSimpleProfileProps {
107
+ interface SimpleProfileInfo {
108
+ readonly name?: string;
109
+ readonly avatar?: string;
110
+ readonly email?: string;
111
+ readonly userStatus: AccountStatus;
112
+ readonly userType: '_employee' | '_externalUser';
113
+ }
114
+
115
+ interface SimpleProfileData {
94
116
  readonly useLarkCard: false;
95
- readonly userProfileInfo: {
96
- readonly name?: string;
97
- readonly avatar?: string;
98
- readonly email?: string;
99
- //
100
- readonly userStatus: AccountStatus;
101
- readonly userType: '_employee' | '_externalUser';
102
- };
117
+ readonly userProfileInfo: SimpleProfileInfo;
103
118
  }
104
119
 
105
- interface BaseOfficialProfileProps {
120
+ interface OfficialProfileData {
106
121
  readonly useLarkCard: true;
107
- readonly larkCardParam: {
108
- readonly needRedirect?: boolean;
109
- readonly redirectURL?: string;
110
- readonly larkAppID: string;
111
- readonly jsAPITicket: string;
112
- readonly larkOpenID: string;
113
- readonly targetLarkOpenID: string;
114
- };
122
+ readonly larkCardParam: LarkCardParam;
123
+ }
124
+
125
+ interface LarkCardParam {
126
+ readonly needRedirect?: boolean;
127
+ readonly redirectURL?: string;
128
+ readonly larkAppID: string;
129
+ readonly jsAPITicket: string;
130
+ readonly larkOpenID: string;
131
+ readonly targetLarkOpenID: string;
115
132
  }
116
133
 
117
134
  /**
@@ -122,15 +139,55 @@ export interface WithCommonResponse<T> {
122
139
  data: T;
123
140
  }
124
141
 
125
- async function renderLarkProfile({
126
- larkAppID,
127
- jsAPITicket,
128
- larkOpenID,
129
- cardRef,
130
- targetLarkOpenID,
131
- }: BaseOfficialProfileProps['larkCardParam'] & {
132
- cardRef: React.RefObject<HTMLDivElement | null>;
133
- }) {
142
+ // 按需注入飞书 H5 JS SDK,仅在走飞书名片分支时才加载
143
+ const LARK_SDK_URL =
144
+ 'https://lf3-cdn-tos.bytegoofy.com/obj/goofy/locl/lark/external_js_sdk/h5-js-sdk-1.2.21.js';
145
+
146
+ /**
147
+ * 鉴权重定向地址放在模块级而不是组件 ref 里。
148
+ * 原因:useExternalScript 在「脚本已存在」时会跳过 onloadCallback,
149
+ * 所以 onAuthError 只会在页面首个实例挂载时注册一次。若闭包捕获的是
150
+ * 某个实例的 ref,该实例卸载后,后续实例的 redirectURL 就永远送不到
151
+ * 已注册的 handler 里。用模块级变量保证读到的始终是最新值。
152
+ */
153
+ let currentRedirectURL = '';
154
+ let authHandlerRegistered = false;
155
+
156
+ function registerLarkAuthHandler(): void {
157
+ if (authHandlerRegistered) return;
158
+ if (typeof globalThis.webComponent === 'undefined') return;
159
+ authHandlerRegistered = true;
160
+
161
+ globalThis.webComponent.onAuthError(function (error: Error) {
162
+ let errorMessage: { msg?: { code?: number; msg?: string } } | undefined;
163
+ try {
164
+ errorMessage = JSON.parse(error.message);
165
+ } catch {
166
+ logger.info('webComponent onAuthError: 非 JSON 错误体', error);
167
+ return;
168
+ }
169
+ // 存在token过期情况,但后端无法识别,需要前端这边主动识别error,并进行鉴权重定向
170
+ if (
171
+ errorMessage?.msg?.code === 20442 &&
172
+ errorMessage?.msg?.msg === 'jsapi-ticket not exist' &&
173
+ currentRedirectURL
174
+ ) {
175
+ globalThis.location.replace(currentRedirectURL);
176
+ }
177
+ });
178
+
179
+ globalThis.webComponent.onError(function (error: Error) {
180
+ logger.info('webComponent onError', error);
181
+ });
182
+ }
183
+
184
+ /** 在指定容器里创建并渲染一个飞书名片,返回创建出来的 `<tt-profile>` 元素 */
185
+ async function renderLarkProfile(
186
+ param: LarkCardParam,
187
+ host: HTMLElement,
188
+ ): Promise<Element | null> {
189
+ const { larkAppID, jsAPITicket, larkOpenID, targetLarkOpenID } = param;
190
+
134
191
  const timestamp = Date.now().toString();
135
192
  const nonceStr = generateRandomString(10);
136
193
  const url = globalThis.location.href.split('#')[0] ?? '';
@@ -146,20 +203,53 @@ async function renderLarkProfile({
146
203
  url,
147
204
  jsApiList: ['user_profile'],
148
205
  locale: ['zh_cn'],
149
- ...(getEnv() === 'BOE'
150
- ? { env: 'feishu_boe' }
151
- : {}),
206
+ ...(getEnv() === 'BOE' ? { env: 'feishu_boe' } : {}),
152
207
  });
153
208
 
154
- const myComponent = await globalThis.webComponent.render(
209
+ await globalThis.webComponent.render(
155
210
  'UserProfile',
156
- {
157
- openId: targetLarkOpenID,
158
- },
159
- cardRef.current,
211
+ { openId: targetLarkOpenID },
212
+ host,
160
213
  );
161
214
 
162
- return myComponent;
215
+ // SDK 把 <tt-profile> append 到 host 上,取最后一个即本次创建的
216
+ return host.lastElementChild;
217
+ }
218
+
219
+ /**
220
+ * 渲染一张完整可用的名片。
221
+ *
222
+ * `visibleHost` 非空时直接渲进可见容器(首次打开,让用户看到飞书自己的骨架屏);
223
+ * 否则开一个专属离屏插槽 —— 并发渲染共用容器会取错元素。插槽只用来隔离本次
224
+ * 渲染,拿到元素后就把它挪到离屏容器下并撤掉插槽,否则空壳 div 会累积。
225
+ *
226
+ * 放在模块级而不是 effect 内,是为了让「真正卸载时补备用卡」那条路径也能用,
227
+ * 不必把它写进 effect 的闭包、从而被迫放宽依赖。
228
+ */
229
+ async function renderCard(
230
+ param: LarkCardParam,
231
+ visibleHost: HTMLElement | null,
232
+ ): Promise<Element | null> {
233
+ const slot = visibleHost ? null : createOffscreenSlot();
234
+ const live = await renderLarkProfile(param, visibleHost ?? slot!);
235
+
236
+ const settle = () => {
237
+ if (!slot) return;
238
+ if (live && live.parentNode === slot) getOffscreenHost().appendChild(live);
239
+ slot.remove();
240
+ };
241
+
242
+ if (!live) {
243
+ settle();
244
+ return null;
245
+ }
246
+ if (!(await waitForCardReady(live))) {
247
+ live.remove();
248
+ settle();
249
+ return null;
250
+ }
251
+ settle();
252
+ return live;
163
253
  }
164
254
 
165
255
  function UserProfile(props: UserProfileProps) {
@@ -172,96 +262,30 @@ function UserProfile(props: UserProfileProps) {
172
262
  user_id ||
173
263
  originUserId;
174
264
 
175
- const cardRef = useRef<HTMLDivElement>(null);
176
- const [loading, setLoading] = useState<boolean>(true);
177
- const redirectURLRef = useRef<string>('');
178
- const [response, setResponse] = useState<BaseUserProfileProps>(
179
- {} as BaseUserProfileProps,
180
- );
181
- const [error, setError] = useState<boolean>(false);
182
-
183
- const onAuthError = useCallback(() => {
184
- globalThis.webComponent.onAuthError(function (error: Error) {
185
- const errorMessage = JSON.parse(error.message);
186
- // 存在token过期情况,但后端无法识别,需要前端这边主动识别error,并进行鉴权重定向
187
- if (
188
- errorMessage?.msg?.code === 20442 &&
189
- errorMessage?.msg?.msg === 'jsapi-ticket not exist'
190
- ) {
191
- globalThis.location.replace(redirectURLRef.current);
192
- }
193
- });
194
-
195
- globalThis.webComponent.onError(function (error: Error) {
196
- logger.info('webComponent onError', error);
197
- });
198
- }, []);
199
-
200
- // 按需注入飞书 H5 JS SDK,仅在组件使用时加载
201
- const larkSdkURl =
202
- 'https://lf3-cdn-tos.bytegoofy.com/obj/goofy/locl/lark/external_js_sdk/h5-js-sdk-1.2.21.js';
203
- const scriptOptions = useMemo(
204
- () => ({ onloadCallback: onAuthError }),
205
- [onAuthError],
206
- );
207
- const scriptStatus = useExternalScript(larkSdkURl, scriptOptions);
208
-
209
- const fetchData = useCallback(async () => {
210
- if (!userId) return;
211
-
212
- const controller = new AbortController();
213
-
214
- setLoading(true);
215
- setError(false);
216
-
217
- try {
218
- const data = await fetchUserProfile(userId, accountType, controller.signal);
219
- setResponse(data as BaseUserProfileProps);
220
-
221
- if (data.useLarkCard && !data.larkCardParam.needRedirect) {
222
- redirectURLRef.current = data.larkCardParam.redirectURL ?? '';
223
- await renderLarkProfile({
224
- ...data.larkCardParam,
225
- cardRef,
226
- });
227
- setLoading(false);
228
- } else {
229
- setLoading(false);
230
- }
231
- } catch (error: unknown) {
232
- if (error instanceof Error && error.name === 'AbortError') {
233
- // 直接退出,不处理 AbortError
234
- } else {
235
- // 最终的UI反馈
236
- setError(true);
237
- setLoading(false);
238
- }
239
- }
240
- }, [userId, accountType]);
265
+ const { data, isPending, isError, refetch } = useUserProfile({
266
+ userId: userId ?? '',
267
+ accountType,
268
+ enabled: Boolean(userId),
269
+ });
241
270
 
242
- useEffect(() => {
243
- if (scriptStatus !== 'ready') return;
271
+ const handleRetry = useCallback(() => {
272
+ void refetch();
273
+ }, [refetch]);
244
274
 
245
- void fetchData();
246
- }, [fetchData, scriptStatus]);
275
+ // 没有 userId 时不渲染任何东西。旧实现在这里会停在 loading 上永远转圈。
276
+ if (!userId) return null;
247
277
 
248
- if (error) {
278
+ if (isError) {
249
279
  return (
250
- <Card
251
- ref={cardRef}
252
- className="flex min-h-124 w-80 flex-col items-center justify-center gap-4 border-0 p-0"
253
- >
280
+ <Card className="flex min-h-124 w-80 flex-col items-center justify-center gap-4 border-0 p-0">
254
281
  <ErrorImage />
255
- {/* <Button variant="outline" className="border-red-500 text-black hover:bg-red-50" onClick={fetchData}>
256
- 加载失败 请重试
257
- </Button> */}
258
282
  <div>
259
283
  <span className="text-sm">加载失败 请</span>
260
284
  <Button
261
285
  size="sm"
262
286
  variant="ghost"
263
287
  className="pr-1 pl-1 text-primary! not-disabled:hover:bg-primary/10 not-disabled:hover:text-primary/90 focus-visible:bg-primary/20"
264
- onClick={fetchData}
288
+ onClick={handleRetry}
265
289
  >
266
290
  重试
267
291
  </Button>
@@ -269,42 +293,269 @@ function UserProfile(props: UserProfileProps) {
269
293
  </Card>
270
294
  );
271
295
  }
296
+
297
+ // isPending 只在「无缓存且首次请求中」为真。
298
+ // 命中缓存时直接跳过 loading,卡片零延迟出现,后台静默 revalidate。
299
+ if (isPending || !data) {
300
+ return (
301
+ <Card className="flex h-130 w-80 flex-col items-center justify-center gap-6 border-0 p-0">
302
+ <Spinner className="size-8 animate-spin text-primary" />
303
+ </Card>
304
+ );
305
+ }
306
+
307
+ // 业务仓的 tsconfig 继承自 fullstack-presets,是 strictNullChecks: false。
308
+ // TS 在该模式下不做判别联合窄化(本地现写的同形状联合一样窄化失败),
309
+ // 所以这里必须显式断言分支类型,不能简化成 data.userProfileInfo。
310
+ if (!data.useLarkCard) {
311
+ const { userProfileInfo } = data as SimpleProfileData;
312
+ return <SimpleUserProfile userProfileInfo={userProfileInfo} />;
313
+ }
314
+
315
+ const { larkCardParam } = data as OfficialProfileData;
316
+ // key 绑 openId:切换到另一个人时整个重挂,备用卡引用、文字基线、loading
317
+ // 状态一并重置。否则 spareRef 的 `??=` 会把上一个人的卡片留下来复用。
272
318
  return (
273
- <Card
274
- ref={cardRef}
275
- className="flex h-130 w-80 flex-col items-center justify-center gap-6 border-0 p-0"
276
- >
277
- {loading ? <LoadingComponent /> : <BaseUserProfile {...response} />}
278
- </Card>
319
+ <LarkProfileCard
320
+ key={larkCardParam.targetLarkOpenID}
321
+ larkCardParam={larkCardParam}
322
+ />
279
323
  );
280
324
  }
281
325
 
282
- function LoadingComponent() {
283
- return <Spinner className="size-8 animate-spin text-primary" />;
284
- }
326
+ /**
327
+ * 飞书名片分支。
328
+ *
329
+ * 人员数据由 `<tt-profile>` 自己拉取,不经过我们的 state,因此这里无法做
330
+ * 字段级的 stale-while-revalidate。退而求其次:缓存整个已渲染的 DOM,
331
+ * 命中即刻展示;内容陈旧时在离屏容器里渲染一份新的,就绪后整体替换,
332
+ * 这样换新过程中用户看到的始终是旧卡片,不会出现骨架屏。
333
+ */
334
+ function LarkProfileCard(props: { readonly larkCardParam: LarkCardParam }) {
335
+ const { larkCardParam } = props;
336
+ const { needRedirect, redirectURL, targetLarkOpenID } = larkCardParam;
337
+
338
+ // 「打开后更新」渲染出的元素由本实例独占 —— 它会被 attach 进本实例的容器,
339
+ // 取消时也由本实例回收。所以去重必须按实例隔离:ensureRender 的 key 是模块级的,
340
+ // 同一个人的两个实例共享一次渲染的话,两边会拿到同一个 DOM 元素,
341
+ // 后挂载的那个会把节点从前一个容器里抢走(前者变空白),先卸载的那个
342
+ // 还会把另一个正在显示的节点 remove 掉。
343
+ //
344
+ // 备用卡池仍然按人共享 —— 那条路径是 takeSpare 独占领取,不存在同一元素
345
+ // 被两个实例同时持有的问题。
346
+ const instanceId = useId();
347
+
348
+ const hostRef = useRef<HTMLDivElement>(null);
349
+ // 初值在渲染期就定下来:有备用卡就不该出现转圈。effect 在首次绘制之后
350
+ // 才跑,若初值恒为 true,命中缓存也会先闪一帧 loading。
351
+ const [showSpinner, setShowSpinner] = useState(() =>
352
+ !hasSpare(targetLarkOpenID),
353
+ );
354
+ const [renderFailed, setRenderFailed] = useState(false);
355
+ const [retryToken, setRetryToken] = useState(0);
356
+
357
+ // 这次挂载取到的备用卡。takeSpare 是「取走」语义,effect 可能重复执行,
358
+ // 不记在 ref 里第二次就拿不到,会误判成没有缓存而走完整 loading。
359
+ const spareRef = useRef<Element | null>(null);
360
+ // 当前挂在容器里的那一张。卸载清理要用它,而那时 hostRef 可能已被置空。
361
+ const shownRef = useRef<Element | null>(null);
362
+ // 挂上那一刻、本人那一屏的文字。卸载时比对,判断用户有没有改过本人的数据。
363
+ const attachedTextRef = useRef<string>('');
364
+ // 组件是否还活着。异步回调的归属是「组件实例」而不是「某一次 effect 执行」,
365
+ // 所以用它而不是 effect 内的 cancelled 标志 —— 否则依赖一变化,正在途中的
366
+ // 渲染结果就会被当成已取消而丢弃。
367
+ const aliveRef = useRef(true);
368
+ // 已经为哪一轮 retryToken 启动过渲染,保证依赖变化时不重复发起。
369
+ const startedRef = useRef(-1);
285
370
 
286
- function BaseUserProfile(props: BaseUserProfileProps) {
287
- const { useLarkCard } = props;
288
- if (!useLarkCard) {
289
- const { userProfileInfo } = props as BaseSimpleProfileProps;
371
+ const scriptOptions = useMemo(
372
+ () => ({ onloadCallback: registerLarkAuthHandler }),
373
+ [],
374
+ );
375
+ const scriptStatus = useExternalScript(LARK_SDK_URL, scriptOptions);
290
376
 
291
- return <SimpleUserProfile userProfileInfo={userProfileInfo} />;
292
- }
377
+ // 卸载清理需要的值走 ref,避免为了它们把依赖写宽
378
+ const teardownRef = useRef({ param: larkCardParam, scriptReady: false });
379
+ teardownRef.current = {
380
+ param: larkCardParam,
381
+ scriptReady: scriptStatus === 'ready',
382
+ };
293
383
 
294
- const { larkCardParam } = props;
295
- const { needRedirect, redirectURL } = larkCardParam;
296
- if (needRedirect) {
297
- if (!redirectURL) {
298
- return null;
384
+ // 需要走鉴权重定向时整页跳转,不渲染名片
385
+ useEffect(() => {
386
+ if (needRedirect && redirectURL) {
387
+ globalThis.location.replace(redirectURL);
299
388
  }
389
+ }, [needRedirect, redirectURL]);
390
+
391
+ /**
392
+ * 只在**真正卸载**时回收。
393
+ *
394
+ * 不能放进主 effect 的 cleanup —— 那个 cleanup 在任何依赖变化时都会跑
395
+ * (scriptStatus 从 loading 变 ready、react-query 刷新导致 larkCardParam
396
+ * 换引用,都是必经路径)。在那里 remove 掉正在显示的卡片,会造成可见的
397
+ * 闪白回退,而且被摘掉的若是「打开后更新」那张,它既不在池里也不在容器里,
398
+ * 直接成了孤儿。
399
+ */
400
+ useEffect(() => {
401
+ aliveRef.current = true;
402
+ return () => {
403
+ aliveRef.current = false;
404
+
405
+ const shown = shownRef.current;
406
+ shownRef.current = null;
407
+ if (!shown) return;
408
+
409
+ const changed = ownProfileText(shown) !== attachedTextRef.current;
410
+ // 用过的那张直接丢弃 —— 它可能被滚动过、点进过别人的名片,
411
+ // 而这些状态有一半在飞书 React 内部,无法可靠恢复
412
+ shown.remove();
413
+
414
+ const { param, scriptReady } = teardownRef.current;
415
+ if (!changed || !scriptReady) return;
416
+
417
+ // 用户在卡片里改过本人的数据(最典型的是编辑个性签名)。已经备好的那张
418
+ // 是改动之前渲染的,内容已过时:丢掉,并立刻重新备一张 —— 只丢不补的话
419
+ // 下次打开会退回完整 loading。带时间戳的 key 绕开去重,确保拿到的是
420
+ // 改动之后重新渲染的结果。
421
+ dropSpare(param.targetLarkOpenID);
422
+ void ensureRender(
423
+ `${param.targetLarkOpenID}:spare:${String(Date.now())}`,
424
+ async () => {
425
+ const live = await renderCard(param, null);
426
+ if (live) putSpare(param.targetLarkOpenID, live);
427
+ return live;
428
+ },
429
+ ).catch((error: unknown) => {
430
+ logger.info('re-prepare spare lark profile failed', error);
431
+ });
432
+ };
433
+ }, []);
300
434
 
301
- globalThis.location.replace(redirectURL);
302
- return null;
303
- }
435
+ // 主逻辑。对重复执行幂等:已经挂了东西就不再顶备用卡,已经发起过的渲染
436
+ // 不重复发起。
437
+ useEffect(() => {
438
+ if (needRedirect) return;
439
+
440
+ const host = hostRef.current;
441
+ if (!host) return;
442
+
443
+ currentRedirectURL = redirectURL ?? '';
444
+ // 脚本已存在时 useExternalScript 会跳过 onloadCallback,这里补注册一次
445
+ if (scriptStatus === 'ready') registerLarkAuthHandler();
446
+
447
+ const attach = (el: Element | null) => {
448
+ if (!aliveRef.current || !el) return;
449
+ host.replaceChildren(el);
450
+ shownRef.current = el;
451
+ attachedTextRef.current = ownProfileText(el);
452
+ setShowSpinner(false);
453
+ setRenderFailed(false);
454
+ };
455
+
456
+ if (!shownRef.current) {
457
+ // 备用卡是渲染好后一直停在离屏、从没显示过的,所以必然是初始态,
458
+ // 而且是活元素 —— 挂上即可交互,不是静态快照
459
+ spareRef.current ??= takeSpare(targetLarkOpenID);
460
+ if (spareRef.current) attach(spareRef.current);
461
+ }
462
+
463
+ if (scriptStatus !== 'ready') return;
464
+ if (startedRef.current === retryToken) return;
465
+ startedRef.current = retryToken;
466
+
467
+ const hadSpare = Boolean(shownRef.current);
468
+ if (!hadSpare) setShowSpinner(true);
469
+
470
+ // 打开后更新一次:再渲染一张,就绪后换上去,让这次看到的是最新数据。
471
+ // 有备用卡顶着就离屏渲染(用户看不到骨架屏),没有就直接渲进可见容器。
472
+ void ensureRender(
473
+ `${targetLarkOpenID}:update:${instanceId}:${String(retryToken)}`,
474
+ () => renderCard(larkCardParam, hadSpare ? null : host),
475
+ )
476
+ .then((live) => {
477
+ if (!aliveRef.current) {
478
+ // 组件已卸载。元素此时在常驻离屏容器里,既不会被 attach 也不进
479
+ // 受 maxEntries 约束的池 —— 放着不管会随反复开关一直累积。
480
+ live?.remove();
481
+ return;
482
+ }
483
+ if (live) {
484
+ attach(live);
485
+ return;
486
+ }
487
+ // 渲染没能就绪。已经挂着备用卡就保持现状;什么都没有的话必须收掉
488
+ // loading 并给出重试入口,否则会一直转圈。
489
+ if (!shownRef.current) {
490
+ setShowSpinner(false);
491
+ setRenderFailed(true);
492
+ }
493
+ })
494
+ .catch((error: unknown) => {
495
+ logger.info('update lark profile failed', error);
496
+ if (!aliveRef.current) return;
497
+ setShowSpinner(false);
498
+ if (!shownRef.current) setRenderFailed(true);
499
+ });
500
+
501
+ // 立刻开始备下一张。必须在「打开」时做而不是「关闭」时 —— 真实环境渲染
502
+ // 一张要走鉴权、render、网关取数、图片加载,几秒起步;放在关闭时做的话,
503
+ // 用户点快一点下次打开就还没备好,又掉回完整 loading。
504
+ if (!hasSpare(targetLarkOpenID)) {
505
+ void ensureRender(`${targetLarkOpenID}:spare`, async () => {
506
+ const live = await renderCard(larkCardParam, null);
507
+ if (live) putSpare(targetLarkOpenID, live);
508
+ return live;
509
+ }).catch((error: unknown) => {
510
+ logger.info('prepare spare lark profile failed', error);
511
+ });
512
+ }
513
+ }, [
514
+ instanceId,
515
+ larkCardParam,
516
+ needRedirect,
517
+ redirectURL,
518
+ retryToken,
519
+ scriptStatus,
520
+ targetLarkOpenID,
521
+ ]);
522
+
523
+ const handleRetryRender = useCallback(() => {
524
+ setRenderFailed(false);
525
+ setShowSpinner(true);
526
+ setRetryToken((n) => n + 1);
527
+ }, []);
528
+
529
+ if (needRedirect) return null;
530
+
531
+ return (
532
+ <Card className="relative flex h-130 w-80 flex-col items-center justify-center gap-6 border-0 p-0">
533
+ <div ref={hostRef} className="h-full w-full" />
534
+ {showSpinner && (
535
+ <Spinner className="absolute size-8 animate-spin text-primary" />
536
+ )}
537
+ {renderFailed && (
538
+ <div className="absolute flex flex-col items-center gap-4">
539
+ <ErrorImage />
540
+ <div>
541
+ <span className="text-sm">加载失败 请</span>
542
+ <Button
543
+ size="sm"
544
+ variant="ghost"
545
+ className="pr-1 pl-1 text-primary! not-disabled:hover:bg-primary/10 not-disabled:hover:text-primary/90 focus-visible:bg-primary/20"
546
+ onClick={handleRetryRender}
547
+ >
548
+ 重试
549
+ </Button>
550
+ </div>
551
+ </div>
552
+ )}
553
+ </Card>
554
+ );
304
555
  }
305
556
 
306
557
  function SimpleUserProfile(props: {
307
- readonly userProfileInfo: BaseSimpleProfileProps['userProfileInfo'];
558
+ readonly userProfileInfo: SimpleProfileInfo;
308
559
  }) {
309
560
  const { userProfileInfo } = props;
310
561
 
@@ -16,6 +16,18 @@ import {
16
16
  PopoverTrigger,
17
17
  } from '@client/src/components/ui/popover';
18
18
 
19
+ /**
20
+ * 阻止 Popover 打开时的自动聚焦。
21
+ *
22
+ * Radix 的 FocusScope 在弹层挂载时会把焦点给容器里第一个可聚焦元素。人员卡片
23
+ * 挂载那一刻内容就已经在了(飞书名片里有「消息」等按钮),于是一打开就有个
24
+ * 按钮带上焦点环。这是张只读预览卡,焦点应该留在触发器上 —— Radix 自己的
25
+ * HoverCard 也是这么处理的。
26
+ */
27
+ const handleProfileOpenAutoFocus = (event: Event) => {
28
+ event.preventDefault();
29
+ };
30
+
19
31
  export type UserPillProps = {
20
32
  /**
21
33
  * 用户 ID,用于 UserProfile 展示
@@ -117,6 +129,7 @@ export const UserPill: React.FC<UserPillProps> = ({
117
129
  side="bottom"
118
130
  align="start"
119
131
  sideOffset={8}
132
+ onOpenAutoFocus={handleProfileOpenAutoFocus}
120
133
  className="w-80 p-0"
121
134
  >
122
135
  <UserProfile userId={userId} accountType={accountType} />
@@ -8,7 +8,7 @@
8
8
  "name": "fullstack-nestjs-template",
9
9
  "version": "2.3.0",
10
10
  "dependencies": {
11
- "@lark-apaas/fullstack-nestjs-core": "^1.1.69",
11
+ "@lark-apaas/fullstack-nestjs-core": "^1.1.70",
12
12
  "@nestjs/axios": "^4.0.1",
13
13
  "@nestjs/cache-manager": "^3.1.3",
14
14
  "@nestjs/common": "^10.4.20",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@hookform/resolvers": "^5.2.2",
35
- "@lark-apaas/client-toolkit": "^1.2.75",
35
+ "@lark-apaas/client-toolkit": "^1.2.76",
36
36
  "@lark-apaas/coding-preset-vite-react": "^1.0.26",
37
37
  "@lark-apaas/fullstack-presets": "^1.1.25",
38
38
  "@nestjs/cli": "^10.4.9",
@@ -1579,9 +1579,9 @@
1579
1579
  }
1580
1580
  },
1581
1581
  "node_modules/@lark-apaas/client-toolkit": {
1582
- "version": "1.2.75",
1583
- "resolved": "https://registry.npmmirror.com/@lark-apaas/client-toolkit/-/client-toolkit-1.2.75.tgz",
1584
- "integrity": "sha512-whvXDWN+EQp8y89jqMVoSgyVHt5ZfDHhjbCd9/vm7CqJwQsNacAYaHMmjxKINqNRGPQ2mEdKeFK6K00+D125cw==",
1582
+ "version": "1.2.76",
1583
+ "resolved": "https://registry.npmmirror.com/@lark-apaas/client-toolkit/-/client-toolkit-1.2.76.tgz",
1584
+ "integrity": "sha512-fLy76Om47vuxUjQvME7GzAOeXycfozi1SqG6HqfgZErUqjBdCmEAkZfD50S39Zhp2FMpeCpkt+Of93S12+gbDQ==",
1585
1585
  "dev": true,
1586
1586
  "dependencies": {
1587
1587
  "@ant-design/colors": "^7.2.1",
@@ -1589,7 +1589,7 @@
1589
1589
  "@lark-apaas/aily-web-sdk": "^0.0.12",
1590
1590
  "@lark-apaas/auth-sdk": "^0.1.5",
1591
1591
  "@lark-apaas/client-capability": "^0.1.7",
1592
- "@lark-apaas/dataloom": "^0.1.5",
1592
+ "@lark-apaas/dataloom": "^0.1.6",
1593
1593
  "@lark-apaas/internal-slardar": "^0.0.3",
1594
1594
  "@lark-apaas/miaoda-inspector": "^1.0.25",
1595
1595
  "@lark-apaas/observable-web": "^1.0.6",
@@ -1679,9 +1679,9 @@
1679
1679
  }
1680
1680
  },
1681
1681
  "node_modules/@lark-apaas/dataloom": {
1682
- "version": "0.1.5",
1683
- "resolved": "https://registry.npmmirror.com/@lark-apaas/dataloom/-/dataloom-0.1.5.tgz",
1684
- "integrity": "sha512-pcVZeO7QtxjzcV1SXQtUSPHO88/f1rhc3Dp/ubXVHV92W+T65Z9Adlyh3f+OdGGMhhn2+hIUnYLsLyS9gS1vhA==",
1682
+ "version": "0.1.6",
1683
+ "resolved": "https://registry.npmmirror.com/@lark-apaas/dataloom/-/dataloom-0.1.6.tgz",
1684
+ "integrity": "sha512-NaMLYODTYlp4ziH1memTuEnARQhlbwMBm+MaWYT2Ue/3nf729i13hjkvxdmMTJq2qyWAnAhgEZvJ4Sccy+rmEQ==",
1685
1685
  "dev": true,
1686
1686
  "dependencies": {
1687
1687
  "@lark-apaas/internal-slardar": "^0.0.3"
@@ -1697,9 +1697,9 @@
1697
1697
  }
1698
1698
  },
1699
1699
  "node_modules/@lark-apaas/fullstack-nestjs-core": {
1700
- "version": "1.1.69",
1701
- "resolved": "https://registry.npmmirror.com/@lark-apaas/fullstack-nestjs-core/-/fullstack-nestjs-core-1.1.69.tgz",
1702
- "integrity": "sha512-SBSBDVy0lSXdgVyTEMUnkLPig0jhdDEM8f0dU8KsI3r293dW579ZRNFtb7azkwY/ouo7TyKhVFFHn2DpOB2Yrg==",
1700
+ "version": "1.1.70",
1701
+ "resolved": "https://registry.npmmirror.com/@lark-apaas/fullstack-nestjs-core/-/fullstack-nestjs-core-1.1.70.tgz",
1702
+ "integrity": "sha512-W3aHeHB8XH3DUmoSGHUEyJz5U+zGdXWDCK7ewNp/FSeUE0iZDF3A7lUYIgr4AEIbQsRj1CVfkbblqo1kxXrFlg==",
1703
1703
  "license": "MIT",
1704
1704
  "dependencies": {
1705
1705
  "@lark-apaas/cache-service": "^0.1.3",
@@ -1710,7 +1710,7 @@
1710
1710
  "@lark-apaas/nestjs-capability": "^0.1.14",
1711
1711
  "@lark-apaas/nestjs-common": "^0.1.9",
1712
1712
  "@lark-apaas/nestjs-datapaas": "^1.0.23",
1713
- "@lark-apaas/nestjs-http-forwarder": "^0.1.3",
1713
+ "@lark-apaas/nestjs-http-forwarder": "^0.1.4",
1714
1714
  "@lark-apaas/nestjs-logger": "^1.0.19",
1715
1715
  "@lark-apaas/nestjs-mcp": "^0.1.2",
1716
1716
  "@lark-apaas/nestjs-observable": "^0.0.13",
@@ -1908,9 +1908,9 @@
1908
1908
  }
1909
1909
  },
1910
1910
  "node_modules/@lark-apaas/nestjs-http-forwarder": {
1911
- "version": "0.1.3",
1912
- "resolved": "https://registry.npmmirror.com/@lark-apaas/nestjs-http-forwarder/-/nestjs-http-forwarder-0.1.3.tgz",
1913
- "integrity": "sha512-mhgTN0M1B0DdalZ5iJkccivqfvXA2CX1487YmbT27ywqXi36ZCMLhl6jm4OaqSzKXf5lacrpadOjkW0v/6N0ag==",
1911
+ "version": "0.1.4",
1912
+ "resolved": "https://registry.npmmirror.com/@lark-apaas/nestjs-http-forwarder/-/nestjs-http-forwarder-0.1.4.tgz",
1913
+ "integrity": "sha512-AOWaeHrZvXRsK/F+2KkEPDJYbNjeuFc2OqhWEWm7u+KSuDE2iQ0dgNm1fTCvf9tkqrLNWEczqDhsP+CNmKndEQ==",
1914
1914
  "license": "MIT",
1915
1915
  "dependencies": {
1916
1916
  "@lark-apaas/nestjs-common": "^0.1.9",
@@ -22463,9 +22463,9 @@
22463
22463
  }
22464
22464
  },
22465
22465
  "node_modules/undici": {
22466
- "version": "7.29.0",
22467
- "resolved": "https://registry.npmmirror.com/undici/-/undici-7.29.0.tgz",
22468
- "integrity": "sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw==",
22466
+ "version": "7.30.1",
22467
+ "resolved": "https://registry.npmmirror.com/undici/-/undici-7.30.1.tgz",
22468
+ "integrity": "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==",
22469
22469
  "license": "MIT",
22470
22470
  "engines": {
22471
22471
  "node": ">=20.18.1"
@@ -28,7 +28,7 @@
28
28
  "upgrade": "npx -y @lark-apaas/fullstack-cli sync --disable-gen-openapi"
29
29
  },
30
30
  "dependencies": {
31
- "@lark-apaas/fullstack-nestjs-core": "^1.1.69",
31
+ "@lark-apaas/fullstack-nestjs-core": "^1.1.70",
32
32
  "@nestjs/axios": "^4.0.1",
33
33
  "@nestjs/cache-manager": "^3.1.3",
34
34
  "@nestjs/common": "^10.4.20",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@hookform/resolvers": "^5.2.2",
55
- "@lark-apaas/client-toolkit": "^1.2.75",
55
+ "@lark-apaas/client-toolkit": "^1.2.76",
56
56
  "@lark-apaas/coding-preset-vite-react": "^1.0.26",
57
57
  "@lark-apaas/fullstack-presets": "^1.1.25",
58
58
  "@nestjs/cli": "^10.4.9",