backendruntimecontext中setTokenValue

This commit is contained in:
Xu Chang 2024-05-09 21:51:40 +08:00
parent fc0c0b235c
commit 66648129e4
10 changed files with 16 additions and 16 deletions

View File

@ -1,7 +1,7 @@
import { Style } from '../../../../types/Style';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../../oak-app-domain").EntityDict, keyof import("../../../../oak-app-domain").EntityDict, false, {
style: Style;
entity: "application" | "platform" | "system";
entity: "application" | "system" | "platform";
entityId: string;
name: string;
}>) => React.ReactElement;

View File

@ -1,7 +1,7 @@
import { Config } from '../../../types/Config';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, keyof import("../../../oak-app-domain").EntityDict, false, {
config: Config;
entity: "platform" | "system";
entity: "system" | "platform";
name: string;
entityId: string;
}>) => React.ReactElement;

View File

@ -13,19 +13,19 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
type?: ButtonProps['type'] | AmButtonProps['type'];
executeText?: string | undefined;
buttonProps?: (ButtonProps & {
color?: "default" | "success" | "warning" | "primary" | "danger" | undefined;
color?: "default" | "success" | "primary" | "warning" | "danger" | undefined;
fill?: "none" | "solid" | "outline" | undefined;
size?: "small" | "middle" | "large" | "mini" | undefined;
size?: "small" | "large" | "middle" | "mini" | undefined;
block?: boolean | undefined;
loading?: boolean | "auto" | undefined;
loadingText?: string | undefined;
loadingIcon?: import("react").ReactNode;
disabled?: boolean | undefined;
onClick?: ((event: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => unknown) | undefined;
type?: "button" | "submit" | "reset" | undefined;
type?: "reset" | "submit" | "button" | undefined;
shape?: "default" | "rounded" | "rectangular" | undefined;
children?: import("react").ReactNode;
} & Pick<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>, "id" | "onMouseDown" | "onMouseUp" | "onTouchStart" | "onTouchEnd"> & {
} & Pick<import("react").ClassAttributes<HTMLButtonElement> & import("react").ButtonHTMLAttributes<HTMLButtonElement>, "id" | "onMouseUp" | "onMouseDown" | "onTouchStart" | "onTouchEnd"> & {
className?: string | undefined;
style?: (import("react").CSSProperties & Partial<Record<"--text-color" | "--background-color" | "--border-radius" | "--border-width" | "--border-style" | "--border-color", string>>) | undefined;
tabIndex?: number | undefined;

View File

@ -4,8 +4,8 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
entity: keyof EntityDict;
entityFilter: any;
relationIds: string[];
rule: "all" | "single" | "free";
ruleOnRow: "all" | "single" | "free";
rule: "single" | "all" | "free";
ruleOnRow: "single" | "all" | "free";
onPickRelations: (ids: string[]) => void;
onPickRows: (ids: string[]) => void;
pickedRowIds: string[] | undefined;

View File

@ -11,7 +11,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
claimUrl: string;
qrCodeType: QrCodeType;
multiple: boolean;
rule: "all" | "single" | "free";
ruleOnRow: "all" | "single" | "free";
rule: "single" | "all" | "free";
ruleOnRow: "single" | "all" | "free";
}>) => React.ReactElement;
export default _default;

View File

@ -14,7 +14,7 @@ export declare abstract class BackendRuntimeContext<ED extends EntityDict & Base
protected rootMode?: boolean;
private userId?;
refineOpRecords(): Promise<void>;
setTokenValue(tokenValue: string, userId?: string): Promise<void>;
setTokenValue(tokenValue?: string, userId?: string): Promise<void>;
setApplication(appId: string): Promise<void>;
initialize(data?: SerializedData, later?: boolean): Promise<void>;
getApplicationId(): ED["application"]["Schema"]["id"] | undefined;

View File

@ -123,7 +123,7 @@ export class BackendRuntimeContext extends BRC {
if (appId) {
promises.push(this.setApplication(appId));
}
if (tokenValue) {
if (tokenValue || userId) {
promises.push(this.setTokenValue(tokenValue, userId));
}
if (promises.length > 0) {

View File

@ -14,7 +14,7 @@ export declare abstract class BackendRuntimeContext<ED extends EntityDict & Base
protected rootMode?: boolean;
private userId?;
refineOpRecords(): Promise<void>;
setTokenValue(tokenValue: string, userId?: string): Promise<void>;
setTokenValue(tokenValue?: string, userId?: string): Promise<void>;
setApplication(appId: string): Promise<void>;
initialize(data?: SerializedData, later?: boolean): Promise<void>;
getApplicationId(): ED["application"]["Schema"]["id"] | undefined;

View File

@ -126,7 +126,7 @@ class BackendRuntimeContext extends oak_frontend_base_1.BackendRuntimeContext {
if (appId) {
promises.push(this.setApplication(appId));
}
if (tokenValue) {
if (tokenValue || userId) {
promises.push(this.setTokenValue(tokenValue, userId));
}
if (promises.length > 0) {

View File

@ -65,7 +65,7 @@ export abstract class BackendRuntimeContext<ED extends EntityDict & BaseEntityDi
}
}
async setTokenValue(tokenValue: string, userId?: string) {
async setTokenValue(tokenValue?: string, userId?: string) {
if (tokenValue) {
// 前台传递
const result = await this.select(
@ -162,7 +162,7 @@ export abstract class BackendRuntimeContext<ED extends EntityDict & BaseEntityDi
if (appId) {
promises.push(this.setApplication(appId));
}
if (tokenValue) {
if (tokenValue || userId) {
promises.push(this.setTokenValue(tokenValue, userId));
}
if (promises.length > 0) {