F2-9: 选择窗完整化——e2e测试、AmisRenderer注入orgId、auth解析JWT org
- e2e/picker.spec.ts:列表选择(搜索→选中→回填)+树形选择(部门树)+多选+onEvent联动 4个场景全绿
- AmisRenderer:注入 orgId 到 amis props 数据域,供 select-tree source 中 \${orgId} 使用
- auth.ts:toProfile 从 JWT payload 解析 org 字段;UserProfile 添加 org 可选字段
- e2e/artifacts/f2-9/:截图三态存档
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { http } from '../api/http';
|
||||
import { registerReplayAction } from '../amis/registerReplayAction';
|
||||
import { getProfile } from '../auth/token';
|
||||
|
||||
interface AmisRendererProps {
|
||||
schema: Record<string, unknown>;
|
||||
@@ -54,10 +55,14 @@ export function AmisRenderer({ schema }: AmisRendererProps) {
|
||||
return http.request({ url, method: m as never, data, responseType: responseType as never });
|
||||
};
|
||||
|
||||
// F2-9:注入当前用户 org 到 amis 数据域,供 select-tree source 中 ${orgId} 使用
|
||||
const profile = getProfile();
|
||||
const amisProps = profile?.org ? { orgId: profile.org } : {};
|
||||
|
||||
const instance = amis.embed(
|
||||
rootRef.current,
|
||||
schema,
|
||||
{},
|
||||
amisProps,
|
||||
{
|
||||
fetcher,
|
||||
// 与后端 amis CRUD 约定对齐:status===0 为成功
|
||||
|
||||
Reference in New Issue
Block a user