feat: feature-token支持传入忽略的Exception列表,并在刷新token时若出现该异常则不强制退出登录

This commit is contained in:
Pan Qiancheng 2025-12-23 15:31:30 +08:00
parent 40d69bf0f4
commit 35f8bfcc0b
108 changed files with 256 additions and 258 deletions

View File

@ -19,6 +19,6 @@ export declare function syncWechatTemplate<ED extends EntityDict>(params: {
example: string;
keywordEnumValueList: {
keywordCode: string;
enumValueList: string[];
enumValueList: Array<string>;
}[];
}[]>;

View File

@ -2577,8 +2577,8 @@ export async function refreshToken(params, context) {
// 只有server模式去刷新token
// 'development' | 'production' | 'staging'
const intervals = {
development: 7200 * 1000,
staging: 600 * 1000,
development: 7200 * 1000, // 2小时
staging: 600 * 1000, // 十分钟
production: 600 * 1000, // 十分钟
};
let applicationId = token.applicationId;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "address", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "address", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,4 +1,3 @@
/// <reference types="@uiw/react-amap-types" />
import React from 'react';
export type PositionProps = {
loadUI: boolean;

View File

@ -1,4 +1,3 @@
/// <reference types="@uiw/react-amap-types" />
import React from 'react';
import { ModalProps } from 'antd';
import { GeolocationProps } from '@uiw/react-amap';

View File

@ -1,4 +1,3 @@
/// <reference types="@uiw/react-amap-types" />
import React from 'react';
import { MapProps, APILoaderConfig } from '@uiw/react-amap';
import './index.less';

View File

@ -2,7 +2,7 @@ import React from 'react';
import { WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../oak-app-domain';
declare const Cos: (props: WebComponentProps<EntityDict, keyof EntityDict, false, {
currentConfig: EntityDict['application']['OpSchema']['config'];
currentConfig: EntityDict["application"]["OpSchema"]["config"];
dirty: boolean;
entity: string;
name: string;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "application", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "application", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,4 +1,3 @@
/// <reference types="wechat-miniprogram" />
import { EntityDict } from '../../../oak-app-domain';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "application", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "article", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -5,7 +5,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
tocPosition: "none" | "left" | "right";
highlightBgColor: string;
onArticlePreview: (content?: string, title?: string) => void;
origin: import("../../../types/Config").CosOrigin | null;
origin: null | EntityDict["extraFile"]["Schema"]["origin"];
scrollId: string;
height: number | "auto";
activeColor: string | undefined;

View File

@ -1,10 +1,9 @@
/// <reference types="react" />
import { GenerateUrlFn } from "../../../types/Article";
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "article", true, {
entityId: string;
articleMenuId: string | undefined;
generateUrl: GenerateUrlFn;
empty: import("react").ReactNode;
empty: React.ReactNode | undefined;
menuCheck: (isArticle: boolean) => void;
}>) => React.ReactElement;
export default _default;

View File

@ -1,7 +1,7 @@
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "article", true, {
articleMenuId: string | undefined;
onChildEditArticleChange: (data: string) => void;
show: "preview" | "edit" | "doc";
show: "edit" | "doc" | "preview";
getBreadcrumbItemsByParent: (breadcrumbItems: string[]) => void;
breadcrumbItems: string[];
drawerOpen: boolean;

View File

@ -5,7 +5,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
tocPosition: "none" | "left" | "right";
highlightBgColor: string;
onArticlePreview: (content?: string, title?: string) => void;
origin: import("../../../types/Config").CosOrigin | null;
origin: EntityDict["extraFile"]["Schema"]["origin"] | null;
scrollId: string;
height: number | "auto";
activeColor: string | undefined;

View File

@ -1,13 +1,12 @@
/// <reference types="react" />
import { EntityDict } from "../../../oak-app-domain";
import { GenerateUrlFn } from "../../../types/Article";
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, keyof EntityDict, false, {
entity: string;
entityId: string;
title: string;
origin: import("../../../types/Config").CosOrigin | null;
menuEmpty: import("react").ReactNode;
articleEmpty: import("react").ReactNode;
origin: null | EntityDict["extraFile"]["Schema"]["origin"];
menuEmpty: React.ReactNode | undefined;
articleEmpty: React.ReactNode | undefined;
generateUrl: GenerateUrlFn;
}>) => React.ReactElement;
export default _default;

View File

@ -1,14 +1,13 @@
/// <reference types="react" />
import { GenerateUrlFn } from "../../../types/Article";
import { EntityDict } from "../../../oak-app-domain";
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "articleMenu", true, {
entity: string;
entityId: string;
parentId: string | undefined;
origin: import("../../../types/Config").CosOrigin | null;
origin: EntityDict["extraFile"]["Schema"]["origin"] | null;
onMenuClick: (menuId: string, menuName: string, isArticle: boolean) => void;
onArticleClick: (atricleId: string) => void;
empty: import("react").ReactNode;
empty: React.ReactNode | undefined;
changeAddArticle: (show: boolean) => void;
generateUrl: GenerateUrlFn;
}>) => React.ReactElement;

View File

@ -3,7 +3,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
onRemove: () => void;
onUpdateName: (name: string) => Promise<void>;
onChildEditArticleChange: (data: string) => void;
show: "preview" | "edit" | "doc";
show: "edit" | "doc" | "preview";
getBreadcrumbItemsByParent: (breadcrumbItems: string[]) => void;
breadItems: string[];
drawerOpen: boolean;
@ -25,6 +25,6 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
setCurrentArticle: (id: string) => void;
onMenuViewById: (articleMenuId: string) => void;
setCopyArticleUrl: (id: string) => string;
origin: import("../../../types/Config").CosOrigin | null;
origin: null | EntityDict["extraFile"]["Schema"]["origin"];
}>) => React.ReactElement;
export default _default;

View File

@ -4,7 +4,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
entityId: string;
parentId: string | undefined;
onGrandChildEditArticleChange: (data: string) => void;
show: "preview" | "edit" | "doc";
show: "edit" | "doc" | "preview";
articleMenuId: string;
articleId: string;
getBreadcrumbItems: (breadcrumbItems: string[]) => void;
@ -31,6 +31,6 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
setCurrentArticle: (id: string) => void;
onMenuViewById: (articleMenuId: string) => void;
setCopyArticleUrl: (id: string) => string;
origin: import("../../../types/Config").CosOrigin | null;
origin: null | EntityDict["extraFile"]["Schema"]["origin"];
}>) => React.ReactElement;
export default _default;

View File

@ -2,7 +2,7 @@ import { EntityDict } from "../../../oak-app-domain/EntityDict";
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "articleMenu", true, {
entity: string;
entityId: string;
show: "preview" | "edit" | "doc";
show: "edit" | "doc" | "preview";
articleMenuId: string;
articleId: string;
tocPosition: "none" | "left" | "right";
@ -13,7 +13,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
onArticlePreview: (content?: string, title?: string) => void;
onArticleEdit: (articleId: string) => void;
setCopyArticleUrl: (articleId: string) => string;
origin: import("../../../types/Config").CosOrigin | null;
origin: EntityDict["extraFile"]["Schema"]["origin"] | null;
scrollId: string;
activeColor: string | undefined;
}>) => React.ReactElement;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "user", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "user", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,4 +1,3 @@
/// <reference types="node" />
import * as React from 'react';
type IDownloadProps = {
children?: React.ReactNode;
@ -9,9 +8,9 @@ type IDownloadProps = {
};
declare function Download(props: IDownloadProps): React.JSX.Element;
declare namespace Download {
var onDownload: (data: ArrayBuffer | ReadableStream<any>, filename: string) => Promise<void>;
var onDownload: (data: ArrayBuffer | ReadableStream, filename: string) => Promise<void>;
var base64ToBlob: (base64String: string) => Blob;
var arrayBufferToBase64: (buffer: Buffer) => string;
var base64ToArrayBuffer: (base64String: string) => ArrayBufferLike;
var base64ToArrayBuffer: (base64String: string) => ArrayBuffer;
}
export default Download;

View File

@ -4,8 +4,8 @@ import { ReactComponentProps } from 'oak-frontend-base';
import { ECode } from '../../../types/ErrorPage';
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
code: ECode;
title?: string | undefined;
desc?: string | undefined;
title?: string;
desc?: string;
children?: React.ReactNode;
icon?: React.ReactNode;
}>) => React.ReactElement;

View File

@ -2,21 +2,21 @@ import { EntityDict } from '../../../oak-app-domain';
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
import { ReactComponentProps } from 'oak-frontend-base';
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, false, {
filename?: string | undefined;
expiresAt?: number | undefined;
filename?: string;
expiresAt?: number;
tips?: React.ReactNode;
onDownload?: ((qrCodeImage: string, filename?: string) => void) | undefined;
onRefresh?: (() => void) | undefined;
size?: number | undefined;
onDownload?: (qrCodeImage: string, filename?: string) => void;
onRefresh?: () => void;
size?: number;
url: string;
loading?: boolean | undefined;
disableDownload?: boolean | undefined;
loading?: boolean;
disableDownload?: boolean;
disabled: boolean;
color: string;
bgColor: string;
maskColor: string;
maskTextColor: string;
maskText: string;
mode: 'simple' | 'default';
mode: "simple" | "default";
}>) => React.ReactElement;
export default _default;

View File

@ -6,11 +6,11 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
redDot: boolean;
text: string;
pagePath: string;
iconName?: string | undefined;
selectedIconName?: string | undefined;
iconPath?: string | undefined;
selectedIconPath?: string | undefined;
iconSize?: string | undefined;
iconName?: string;
selectedIconName?: string;
iconPath?: string;
selectedIconPath?: string;
iconSize?: string;
}[];
color: string;
selectedColor: string;

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" | "system" | "platform";
entity: "system" | "platform" | "application";
entityId: string;
name: string;
}>) => React.ReactElement;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "domain", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "domain", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -12,6 +12,6 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
entityId: string;
tag1: string;
tag2: string;
origin: import("../../types/Config").CosOrigin | null;
origin: EntityDict["extraFile"]["Schema"]["origin"] | null;
}>) => React.ReactElement;
export default _default;

View File

@ -4,6 +4,6 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
entity: keyof EntityDict;
entityId: string;
autoUpload: boolean;
origin: import("../../../types/Config").CosOrigin | null;
origin: EntityDict["extraFile"]["Schema"]["origin"] | null;
}>) => React.ReactElement;
export default _default;

View File

@ -1,4 +1,3 @@
/// <reference types="react" />
import { EntityDict } from '../../../oak-app-domain';
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
import { ReactComponentProps } from 'oak-frontend-base/lib/types/Page';
@ -9,31 +8,14 @@ type AfterCommit = (() => void) | undefined;
type BeforeCommit = (() => boolean | undefined | Promise<boolean | undefined>) | undefined;
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
entity: keyof ED2;
action?: string | undefined;
size?: ButtonProps['size'] | AmButtonProps['size'];
block?: boolean | undefined;
type?: ButtonProps['type'] | AmButtonProps['type'];
executeText?: string | undefined;
buttonProps?: (ButtonProps & {
color?: "default" | "success" | "primary" | "warning" | "danger" | undefined;
fill?: "none" | "solid" | "outline" | 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" | "reset" | "submit" | undefined;
shape?: "default" | "rounded" | "rectangular" | undefined;
children?: import("react").ReactNode;
} & 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;
} & import("react").AriaAttributes) | undefined;
action?: string;
size?: ButtonProps["size"] | AmButtonProps["size"];
block?: boolean;
type?: ButtonProps["type"] | AmButtonProps["type"];
executeText?: string;
buttonProps?: ButtonProps & AmButtonProps;
afterCommit?: AfterCommit;
beforeCommit?: BeforeCommit;
messageProps?: boolean | MessageProps | undefined;
messageProps?: MessageProps | boolean;
}>) => React.ReactElement;
export default _default;

View File

@ -20,7 +20,7 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
extension: string[];
selectCount: number;
sourceType: SourceType[];
mediaType: ('image' | 'video')[];
mediaType: ("image" | "video")[];
mode: ImageMode;
size: number;
showUploadList: boolean;
@ -52,7 +52,7 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
aspect: number;
minZoom: number;
maxZoom: number;
cropShape: 'rect' | 'round';
cropShape: "rect" | "round";
cropperProps: object;
modalTitle: string;
modalWidth: string;
@ -67,7 +67,7 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
minHeight: number;
compressWidth: number;
compressHeight: number;
resize: 'contain' | 'cover' | 'none';
resize: "contain" | "cover" | "none";
compressQuality: number;
mimeType: string;
convertTypes: string[];

View File

@ -11,6 +11,6 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
tag2: string;
entity: keyof ED2;
entityId: string;
style?: string | undefined;
style?: string;
}>) => React.ReactElement;
export default _default;

View File

@ -1,4 +1,3 @@
/// <reference types="react" />
import { EntityDict } from '../../../oak-app-domain';
import { FileState } from '../../../features/extraFile';
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
@ -21,7 +20,7 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
extension: string[];
selectCount: number;
sourceType: SourceType[];
mediaType: ('image' | 'video')[];
mediaType: ("image" | "video")[];
mode: ImageMode;
size: number;
showUploadList: boolean;
@ -41,8 +40,8 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
entityId: string;
theme: Theme;
children?: React.ReactNode;
style?: import("react").CSSProperties | undefined;
className?: string | undefined;
style?: React.CSSProperties;
className?: string;
beforeUpload: (file: File) => Promise<string>;
}>) => React.ReactElement;
export default _default;

View File

@ -8,23 +8,23 @@ export interface UploadHandle {
}
declare const _default: React.ForwardRefExoticComponent<WebComponentProps<EntityDict, "extraFile", true, {
files: EnhancedExtraFile[];
accept?: string | undefined;
maxNumber?: number | undefined;
multiple?: boolean | undefined;
draggable?: boolean | undefined;
theme?: Theme | undefined;
beforeUpload?: ((file: File) => Promise<boolean> | boolean) | undefined;
style?: React.CSSProperties | undefined;
className?: string | undefined;
directory?: boolean | undefined;
onPreview?: ((file: UploadFile<any>) => void) | undefined;
onDownload?: ((file: UploadFile<any>) => void) | undefined;
showUploadList?: boolean | undefined;
children?: JSX.Element | undefined;
disableInsert?: boolean | undefined;
disableDownload?: boolean | undefined;
disableDelete?: boolean | undefined;
disablePreview?: boolean | undefined;
accept?: string;
maxNumber?: number;
multiple?: boolean;
draggable?: boolean;
theme?: Theme;
beforeUpload?: (file: File) => Promise<boolean> | boolean;
style?: React.CSSProperties;
className?: string;
directory?: boolean;
onPreview?: (file: UploadFile<any>) => void;
onDownload?: (file: UploadFile<any>) => void;
showUploadList?: boolean;
children?: JSX.Element;
disableInsert?: boolean;
disableDownload?: boolean;
disableDelete?: boolean;
disablePreview?: boolean;
}, {
onRemove: (file: UploadFile) => void;
addFileByWeb: (file: UploadFile) => void;

View File

@ -5,13 +5,13 @@ declare const Authorize: (props: WebComponentProps<EntityDict, keyof EntityDict,
loading: boolean;
hasError: boolean;
errorMsg: string;
userInfo: EntityDict['token']['Schema']['user'] | null;
userInfo: EntityDict["token"]["Schema"]["user"] | null;
response_type: string;
client_id: string;
redirect_uri: string;
scope: string;
state: string;
clientInfo: EntityDict['oauthApplication']['Schema'] | null;
clientInfo: EntityDict["oauthApplication"]["Schema"] | null;
name: string;
nickname: string;
mobile: string;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, keyof import("../../../oak-app-domain").EntityDict, boolean, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "message", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "message", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,6 +1,6 @@
import { EntityDict } from '../../../oak-app-domain';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "messageTypeSmsTemplate", true, {
systemId: string;
origin: import("../../../oak-app-domain/SmsTemplate/_baseSchema").Origin;
origin: EntityDict["smsTemplate"]["Schema"]["origin"];
}>) => React.ReactElement;
export default _default;

View File

@ -2,6 +2,6 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
onlyCaptcha: boolean;
onlyPassword: boolean;
eventLoggedIn: string;
callback: (() => void) | undefined;
callback: ((() => void) | undefined);
}>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "mobile", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,6 +1,6 @@
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, keyof import("../../../oak-app-domain").EntityDict, false, {
shape: string;
size: string | number;
size: number | string;
iconColor: string;
iconName: string;
}>) => React.ReactElement;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, keyof import("../../../oak-app-domain").EntityDict, false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,8 +1,8 @@
import React from 'react';
import { RowWithActions, WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../../../oak-app-domain';
declare const Upsert: (props: WebComponentProps<EntityDict, 'oauthApplication', false, {
item: RowWithActions<EntityDict, 'oauthApplication'>;
declare const Upsert: (props: WebComponentProps<EntityDict, "oauthApplication", false, {
item: RowWithActions<EntityDict, "oauthApplication">;
clientSecret: string;
isCreation: boolean;
}, {

View File

@ -1,8 +1,8 @@
import React from 'react';
import { RowWithActions, WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../../oak-app-domain';
declare const OauthProvider: (props: WebComponentProps<EntityDict, 'oauthApplication', true, {
list: RowWithActions<EntityDict, 'oauthApplication'>[];
declare const OauthProvider: (props: WebComponentProps<EntityDict, "oauthApplication", true, {
list: RowWithActions<EntityDict, "oauthApplication">[];
systemId: string;
}>) => React.JSX.Element;
export default OauthProvider;

View File

@ -1,7 +1,7 @@
import React from 'react';
import { RowWithActions, WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../../../oak-app-domain';
declare const Upsert: (props: WebComponentProps<EntityDict, 'oauthProvider', false, {
item: RowWithActions<EntityDict, 'oauthProvider'>;
declare const Upsert: (props: WebComponentProps<EntityDict, "oauthProvider", false, {
item: RowWithActions<EntityDict, "oauthProvider">;
}>) => React.JSX.Element;
export default Upsert;

View File

@ -1,8 +1,8 @@
import React from 'react';
import { RowWithActions, WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../../oak-app-domain';
declare const OauthProvider: (props: WebComponentProps<EntityDict, 'oauthProvider', true, {
list: RowWithActions<EntityDict, 'oauthProvider'>[];
declare const OauthProvider: (props: WebComponentProps<EntityDict, "oauthProvider", true, {
list: RowWithActions<EntityDict, "oauthProvider">[];
systemId: string;
}>) => React.JSX.Element;
export default OauthProvider;

View File

@ -2,8 +2,8 @@ import React from 'react';
import { RowWithActions, WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../oak-app-domain';
declare const Records: (props: WebComponentProps<EntityDict, "oauthUserAuthorization", true, {
list: RowWithActions<EntityDict, 'oauthUserAuthorization'>[];
list: RowWithActions<EntityDict, "oauthUserAuthorization">[];
}, {
revoke: (item: RowWithActions<EntityDict, 'oauthUserAuthorization'>) => void;
revoke: (item: RowWithActions<EntityDict, "oauthUserAuthorization">) => void;
}>) => React.JSX.Element;
export default Records;

View File

@ -1,4 +1,3 @@
/// <reference types="wechat-miniprogram" />
import { EntityDict } from '../../../oak-app-domain';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, keyof EntityDict, false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -5,7 +5,7 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
entity: keyof ED2;
entityId: string;
relation: string;
redirectTo: EntityDict['parasite']['Schema']['redirectTo'];
redirectTo: EntityDict["parasite"]["Schema"]["redirectTo"];
multiple: boolean;
nameLabel: string;
nameRequired: boolean;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "platform", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "platform", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,7 +1,7 @@
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, keyof import("../../../oak-app-domain").EntityDict, false, {
sessionId: string;
isEntity: boolean;
entityDisplay: (data: any) => any[];
entityDisplay: (data: any) => Array<any>;
entityProjection: any;
}>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, keyof import("../../../oak-app-domain").EntityDict, false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -4,10 +4,10 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
entity: string;
entityFilter: any;
entityFilterSubStr: string;
entityDisplay: (data: EntityDict['session']['Schema'][] | RowWithActions<EntityDict, 'session'>[]) => any[];
entityDisplay: (data: EntityDict["session"]["Schema"][] | RowWithActions<EntityDict, "session">[]) => Array<any>;
entityProjection: any;
sessionId: string;
dialog: boolean;
onItemClick: ((sessionId: string) => {}) | null | undefined;
onItemClick: ((sessionId: string) => {}) | undefined | null;
}>) => React.ReactElement;
export default _default;

View File

@ -6,7 +6,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
dialog: boolean;
entity: string;
entityId: string;
entityDisplay: (data: EntityDict['session']['Schema'][] | RowWithActions<EntityDict, 'session'>[]) => any[];
entityDisplay: (data: EntityDict["session"]["Schema"][] | RowWithActions<EntityDict, "session">[]) => Array<any>;
entityProjection: any;
}>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../../oak-app-domain").EntityDict, "subscription", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "subscription", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,5 +1,5 @@
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, keyof import("../../../oak-app-domain").EntityDict, true, {
areaId: string | null | undefined;
areaId: string | undefined | null;
onCancel: (() => void) | undefined;
onConfirm: ((stationIds: string[]) => void) | undefined;
selectIds: string[] | undefined;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "system", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "system", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../../oak-app-domain").EntityDict, keyof import("../../../../oak-app-domain").EntityDict, boolean, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,9 +1,8 @@
/// <reference types="react" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "token", true, {
onMyInfoClicked: () => void;
myInfoUrl: string;
manageUserUrl: string;
loginUrl: string;
Body: import("react").ReactNode;
Body: React.ReactNode | undefined;
}>) => React.ReactElement;
export default _default;

View File

@ -1,6 +1,6 @@
import { EntityDict } from '../../../../oak-app-domain';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "extraFile", true, {
origin: import("../../../../types/Config").CosOrigin | null;
origin: EntityDict["extraFile"]["Schema"]["origin"] | null;
idCardType: string;
entityId: string;
entity: string;

View File

@ -1,6 +1,6 @@
import { EntityDict } from '../../../oak-app-domain';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "user", false, {
origin: import("../../../types/Config").CosOrigin | null;
origin: EntityDict["extraFile"]["Schema"]["origin"] | null;
autoUpload: boolean;
onFinish: (() => void) | undefined;
needUploadPhotos: boolean;

View File

@ -1,4 +1,4 @@
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../../oak-app-domain").EntityDict, keyof import("../../../../oak-app-domain").EntityDict, boolean, {
onVerified: (() => void) | undefined;
onVerified: undefined | (() => void);
}>) => React.ReactElement;
export default _default;

View File

@ -1,4 +1,3 @@
/// <reference types="react" />
import { WebComponentProps } from "oak-frontend-base";
import { EntityDict } from "../../../../oak-app-domain";
export default function Render(props: WebComponentProps<EntityDict, 'user', false, {

View File

@ -1,4 +1,3 @@
/// <reference types="react" />
import { WebComponentProps } from "oak-frontend-base";
import { EntityDict } from "../../../../oak-app-domain";
export default function Render(props: WebComponentProps<EntityDict, 'user', false, {

View File

@ -1,20 +1,20 @@
import { EntityDict } from '../../../oak-app-domain';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "userEntityGrant", false, {
picker: ((props: {
disabled?: boolean | undefined;
disabled?: boolean;
entity: keyof EntityDict;
entityFilter: object;
relationIds: string[];
rule: EntityDict['userEntityGrant']['OpSchema']['rule'];
ruleOnRow: EntityDict['userEntityGrant']['OpSchema']['ruleOnRow'];
rule: EntityDict["userEntityGrant"]["OpSchema"]["rule"];
ruleOnRow: EntityDict["userEntityGrant"]["OpSchema"]["ruleOnRow"];
onPickRelations: (ids: string[]) => void;
onPickRows: (ids: string[]) => void;
pickedRowIds?: string[] | undefined;
pickedRelationIds?: string[] | undefined;
pickedRowIds?: string[];
pickedRelationIds?: string[];
oakPath: string;
}) => React.ReactElement) | undefined;
hideInfo: boolean;
hideTip: boolean;
afterClaim: ((ueg: EntityDict['userEntityGrant']['OpSchema']) => void) | undefined;
afterClaim: ((ueg: EntityDict["userEntityGrant"]["OpSchema"]) => void) | undefined;
}>) => React.ReactElement;
export default _default;

View File

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

View File

@ -6,12 +6,12 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
relationEntity: string;
relationEntityFilter: any;
relationIds: string[];
type: "grant" | "transfer";
redirectToAfterConfirm: import("../../../oak-app-domain/UserEntityGrant/_baseSchema").RedirectToProps | null | undefined;
type: EntityDict["userEntityGrant"]["Schema"]["type"];
redirectToAfterConfirm: EntityDict["userEntityGrant"]["Schema"]["redirectTo"];
claimUrl: string;
qrCodeType: QrCodeType;
multiple: boolean;
rule: "single" | "all" | "free";
ruleOnRow: "single" | "all" | "free";
rule: EntityDict["userEntityGrant"]["OpSchema"]["rule"];
ruleOnRow: EntityDict["userEntityGrant"]["OpSchema"]["ruleOnRow"];
}>) => React.ReactElement;
export default _default;

View File

@ -4,9 +4,9 @@ import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
entity: keyof ED2;
entityId: string;
relations: EntityDict['relation']['OpSchema'][];
passwordRequired?: boolean | undefined;
allowUpdateName?: boolean | undefined;
allowUpdateNickname?: boolean | undefined;
relations: EntityDict["relation"]["OpSchema"][];
passwordRequired?: boolean;
allowUpdateName?: boolean;
allowUpdateNickname?: boolean;
}>) => React.ReactElement;
export default _default;

View File

@ -4,7 +4,7 @@ import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends keyof ED2>(props: ReactComponentProps<ED2, T2, true, {
entity: keyof ED2;
entityId: string;
allowUpdateName?: boolean | undefined;
allowUpdateNickname?: boolean | undefined;
allowUpdateName?: boolean;
allowUpdateNickname?: boolean;
}>) => React.ReactElement;
export default _default;

View File

@ -7,12 +7,12 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
entityId: string;
redirectToAfterConfirm: ED2["userEntityGrant"]["Schema"]["redirectTo"];
qrCodeType: QrCodeType;
type: EntityDict['userEntityGrant']['Schema']['type'];
relations: EntityDict['relation']['OpSchema'][];
type: EntityDict["userEntityGrant"]["Schema"]["type"];
relations: EntityDict["relation"]["OpSchema"][];
claimUrl: string;
multiple: boolean;
rule: EntityDict['userEntityGrant']['Schema']['rule'];
ruleOnRow: EntityDict['userEntityGrant']['OpSchema']['ruleOnRow'];
onUserEntityGrantCreated?: ((id: string) => void) | undefined;
rule: EntityDict["userEntityGrant"]["Schema"]["rule"];
ruleOnRow: EntityDict["userEntityGrant"]["OpSchema"]["ruleOnRow"];
onUserEntityGrantCreated?: (id: string) => void;
}>) => React.ReactElement;
export default _default;

View File

@ -7,8 +7,8 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
redirectToAfterConfirm: ED2["userEntityGrant"]["Schema"]["redirectTo"];
claimUrl: string;
qrCodeType: string;
passwordRequired?: boolean | undefined;
disabledMethods: Array<'email' | 'mobile' | 'userEntityGrant'>;
mode: 'byMobile' | 'byUserEntityGrant' | 'byEmail';
passwordRequired?: boolean;
disabledMethods: Array<"email" | "mobile" | "userEntityGrant">;
mode: "byMobile" | "byUserEntityGrant" | "byEmail";
}>) => React.ReactElement;
export default _default;

View File

@ -2,7 +2,7 @@ import { EntityDict } from '../../../../oak-app-domain';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "user", false, {
entity: keyof EntityDict;
entityId: string;
relations: import("../../../../oak-app-domain/Relation/_baseSchema").OpSchema[];
relations: EntityDict["relation"]["OpSchema"][];
mobile: string;
setPasswordConfirm: (value: boolean) => void;
passwordRequired: boolean;

View File

@ -2,6 +2,6 @@ import { EntityDict } from '../../../../../oak-app-domain';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "userRelation", true, {
entity: keyof EntityDict;
entityId: string;
relations: import("../../../../../oak-app-domain/Relation/_baseSchema").OpSchema[];
relations: EntityDict["relation"]["OpSchema"][];
}>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "wechatLogin", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,6 +1,6 @@
import { EntityDict } from '../../../oak-app-domain';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, keyof EntityDict, false, {
type: "bind" | "login";
type: EntityDict["wechatLogin"]["Schema"]["type"];
url: string;
size: undefined;
}>) => React.ReactElement;

View File

@ -3,7 +3,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
config: any;
menuIndex: number;
changeConfig: (config: any) => void;
publish: (iState: 'wait' | 'fail') => void;
publish: (iState: "wait" | "fail") => void;
getErrorIndex: (errorIndex: number[]) => void;
createMenu: () => void;
selectedBtn: number;

View File

@ -1,4 +1,3 @@
/// <reference types="wechat-miniprogram" />
import { EntityDict } from '../../../oak-app-domain';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "wechatUser", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,3 +1,2 @@
/// <reference types="wechat-miniprogram" />
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, keyof import("../../../oak-app-domain").EntityDict, false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,4 +1,3 @@
/// <reference types="wechat-miniprogram" />
import { EntityDict } from '../../../oak-app-domain';
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "wechatUser", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
export default _default;

View File

@ -1,4 +1,5 @@
import { Feature } from 'oak-frontend-base/es/types/Feature';
import { OakException } from 'oak-domain/lib/types/Exception';
import { Cache } from 'oak-frontend-base/es/features/cache';
import { LocalStorage } from 'oak-frontend-base/es/features/localStorage';
import { Environment } from 'oak-frontend-base/es/features/environment';
@ -10,6 +11,7 @@ export declare class Token<ED extends EntityDict> extends Feature {
protected cache: Cache<ED>;
protected storage: LocalStorage;
protected application: Application<ED>;
protected ignoreExceptionList: typeof OakException<ED>[];
protected loadSavedToken(): Promise<void>;
constructor(cache: Cache<ED>, storage: LocalStorage, environment: Environment, application: Application<ED>);
protected checkNeedSetPassword(): Promise<never> | undefined;
@ -48,4 +50,6 @@ export declare class Token<ED extends EntityDict> extends Feature {
wakeupParasite(id: string): Promise<void>;
needVerifyPassword(): boolean | null | undefined;
verifyPassword(password: string): Promise<void>;
addIgnoreException(clazz: typeof OakException<ED>): void;
removeIgnoreException(clazz: typeof OakException<ED>): void;
}

View File

@ -1,5 +1,5 @@
import { Feature } from 'oak-frontend-base/es/types/Feature';
import { OakUnloggedInException, OakNetworkException, OakServerProxyException, OakPreConditionUnsetException, OakRequestTimeoutException, OakClockDriftException } from 'oak-domain/lib/types/Exception';
import { isOakException, OakUnloggedInException, OakNetworkException, OakServerProxyException, OakPreConditionUnsetException, OakRequestTimeoutException, OakClockDriftException } from 'oak-domain/lib/types/Exception';
import { tokenProjection } from '../types/Projection';
import { OakPasswordUnset, OakUserInfoLoadingException } from '../types/Exception';
import { LOCAL_STORAGE_KEYS } from '../config/constants';
@ -10,6 +10,7 @@ export class Token extends Feature {
cache;
storage;
application;
ignoreExceptionList = [OakNetworkException, OakServerProxyException, OakRequestTimeoutException, OakClockDriftException];
async loadSavedToken() {
this.tokenValue = await this.storage.load(LOCAL_STORAGE_KEYS.token);
await this.refreshTokenData(this.tokenValue);
@ -75,10 +76,17 @@ export class Token extends Feature {
catch (err) {
// refresh出了任何错都无视(排除网络异常)直接放弃此token
console.warn(err);
if (err instanceof OakNetworkException ||
err instanceof OakServerProxyException ||
err instanceof OakRequestTimeoutException ||
err instanceof OakClockDriftException) {
// if (
// err instanceof OakNetworkException ||
// err instanceof OakServerProxyException ||
// err instanceof OakRequestTimeoutException ||
// err instanceof OakClockDriftException
// ) {
// return;
// }
if (this.ignoreExceptionList.some((clazz) => {
return isOakException(err, clazz);
})) {
return;
}
this.removeToken(true);
@ -362,4 +370,12 @@ export class Token extends Feature {
env,
});
}
addIgnoreException(clazz) {
if (!this.ignoreExceptionList.includes(clazz)) {
this.ignoreExceptionList.push(clazz);
}
}
removeIgnoreException(clazz) {
this.ignoreExceptionList = this.ignoreExceptionList.filter((c) => c !== clazz);
}
}

View File

@ -1,2 +1,2 @@
declare const _default: (import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "system", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "passport", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "oauthApplication", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "oauthProvider", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "oauthUser", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "oauthUserAuthorization", import("../context/BackendRuntimeContext").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "mobile", import("..").BRC<import("../oak-app-domain").EntityDict>>)[];
declare const _default: (import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "system", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "passport", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "oauthApplication", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "oauthProvider", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "oauthUser", import("..").BRC<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "oauthUserAuthorization", import("../context/BackendRuntimeContext").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain/lib/types").Trigger<import("../oak-app-domain").EntityDict, "mobile", import("..").BRC<import("../oak-app-domain").EntityDict>>)[];
export default _default;

View File

@ -14,7 +14,7 @@ export declare function createToDo<ED extends EntityDict & BaseEntityDict, T ext
redirectTo: EntityDict['toDo']['OpSchema']['redirectTo'];
entity: any;
entityId: string;
}, userIds?: string[]): Promise<0 | 1>;
}, userIds?: string[]): Promise<1 | 0>;
/**
* todo例程entity对象上进行action操作时filtertodo完成
* entity的action的后trigger中调用

View File

@ -10,5 +10,5 @@ export declare function getEmail<ED extends EntityDict>(origin: string): Email<E
export declare function getOrigin(): string[];
export declare function sendEmail<ED extends EntityDict>(options: EmailOptions, context: BRC<ED>): Promise<{
success: boolean;
error?: string | undefined;
error?: string;
}>;

View File

@ -10,8 +10,8 @@ type UserID = {
avatarUrl: string | null;
};
export type UserInfoHandler = (data: UserInfo) => UserID | Promise<UserID>;
export declare const registerOauthUserinfoHandler: (type: EntityDict['oauthProvider']['Schema']['type'], handler: UserInfoHandler) => void;
export declare const processUserInfo: (type: EntityDict['oauthProvider']['Schema']['type'], data: UserInfo) => UserID | Promise<UserID>;
export declare const registerOauthUserinfoHandler: (type: EntityDict["oauthProvider"]["Schema"]["type"], handler: UserInfoHandler) => void;
export declare const processUserInfo: (type: EntityDict["oauthProvider"]["Schema"]["type"], data: UserInfo) => UserID | Promise<UserID>;
export declare function checkOauthTokenAvaliable(context: BackendRuntimeContext<EntityDict>, token: string | undefined): Promise<{
error: string | null;
statusCode?: number;

View File

@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.syncSmsTemplate = void 0;
exports.syncSmsTemplate = syncSmsTemplate;
const uuid_1 = require("oak-domain/lib/utils/uuid");
const index_1 = require("../utils/sms/index");
async function syncSmsTemplate(params, context) {
@ -87,4 +87,3 @@ async function syncSmsTemplate(params, context) {
// );
// }
}
exports.syncSmsTemplate = syncSmsTemplate;

View File

@ -19,6 +19,6 @@ export declare function syncWechatTemplate<ED extends EntityDict>(params: {
example: string;
keywordEnumValueList: {
keywordCode: string;
enumValueList: string[];
enumValueList: Array<string>;
}[];
}[]>;

View File

@ -1,6 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.syncWechatTemplate = exports.getMessageType = exports.registerMessageType = void 0;
exports.registerMessageType = registerMessageType;
exports.getMessageType = getMessageType;
exports.syncWechatTemplate = syncWechatTemplate;
const tslib_1 = require("tslib");
const assert_1 = require("oak-domain/lib/utils/assert");
const uuid_1 = require("oak-domain/lib/utils/uuid");
@ -11,11 +13,9 @@ function registerMessageType(messageType) {
let messageTypes2 = messageTypes.concat(messageType);
messageTypes = (0, lodash_1.uniq)(messageTypes2);
}
exports.registerMessageType = registerMessageType;
async function getMessageType() {
return messageTypes;
}
exports.getMessageType = getMessageType;
function analyseContent(content) {
let content2 = content;
let result = {};
@ -129,4 +129,3 @@ async function syncWechatTemplate(params, context) {
}
return template_list;
}
exports.syncWechatTemplate = syncWechatTemplate;

View File

@ -1,6 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loginWebByMpToken = exports.refreshToken = exports.wakeupParasite = exports.logout = exports.getWechatMpUserPhoneNumber = exports.switchTo = exports.sendCaptchaByEmail = exports.sendCaptchaByMobile = exports.syncUserInfoWechatMp = exports.loginWechatMp = exports.loginWechat = exports.loginWechatNative = exports.loginByWechat = exports.refreshWechatPublicUserInfo = exports.setUserAvatarFromWechat = exports.bindByEmail = exports.bindByMobile = exports.loginByEmail = exports.loginByAccount = exports.verifyPassword = exports.loginByMobile = exports.loadTokenInfo = exports.setUpTokenAndUser = void 0;
exports.setUpTokenAndUser = setUpTokenAndUser;
exports.loadTokenInfo = loadTokenInfo;
exports.loginByMobile = loginByMobile;
exports.verifyPassword = verifyPassword;
exports.loginByAccount = loginByAccount;
exports.loginByEmail = loginByEmail;
exports.bindByMobile = bindByMobile;
exports.bindByEmail = bindByEmail;
exports.setUserAvatarFromWechat = setUserAvatarFromWechat;
exports.refreshWechatPublicUserInfo = refreshWechatPublicUserInfo;
exports.loginByWechat = loginByWechat;
exports.loginWechatNative = loginWechatNative;
exports.loginWechat = loginWechat;
exports.loginWechatMp = loginWechatMp;
exports.syncUserInfoWechatMp = syncUserInfoWechatMp;
exports.sendCaptchaByMobile = sendCaptchaByMobile;
exports.sendCaptchaByEmail = sendCaptchaByEmail;
exports.switchTo = switchTo;
exports.getWechatMpUserPhoneNumber = getWechatMpUserPhoneNumber;
exports.logout = logout;
exports.wakeupParasite = wakeupParasite;
exports.refreshToken = refreshToken;
exports.loginWebByMpToken = loginWebByMpToken;
const tslib_1 = require("tslib");
const uuid_1 = require("oak-domain/lib/utils/uuid");
const WechatSDK_1 = tslib_1.__importDefault(require("oak-external-sdk/lib/WechatSDK"));
@ -380,7 +402,6 @@ createData, user) {
}
}
}
exports.setUpTokenAndUser = setUpTokenAndUser;
async function setupMobile(mobile, env, context) {
const result2 = await context.select('mobile', {
data: {
@ -444,7 +465,6 @@ async function loadTokenInfo(tokenValue, context) {
},
}, {});
}
exports.loadTokenInfo = loadTokenInfo;
async function loginByMobile(params, context) {
const { mobile, captcha, env, disableRegister } = params;
const loginLogic = async (isRoot) => {
@ -540,7 +560,6 @@ async function loginByMobile(params, context) {
closeRootMode();
return tokenValue;
}
exports.loginByMobile = loginByMobile;
async function verifyPassword(params, context) {
const { password } = params;
const systemId = context.getSystemId();
@ -605,7 +624,6 @@ async function verifyPassword(params, context) {
}
}, {});
}
exports.verifyPassword = verifyPassword;
async function loginByAccount(params, context) {
const { account, password, env } = params;
let needUpdatePassword = false;
@ -958,7 +976,6 @@ async function loginByAccount(params, context) {
closeRootMode();
return tokenValue;
}
exports.loginByAccount = loginByAccount;
async function loginByEmail(params, context) {
const { email, captcha, env, disableRegister } = params;
const loginLogic = async () => {
@ -1029,7 +1046,6 @@ async function loginByEmail(params, context) {
closeRootMode();
return tokenValue;
}
exports.loginByEmail = loginByEmail;
async function bindByMobile(params, context) {
const { mobile, captcha, env, } = params;
const userId = context.getCurrentUserId();
@ -1141,7 +1157,6 @@ async function bindByMobile(params, context) {
await bindLogic();
closeRootMode();
}
exports.bindByMobile = bindByMobile;
async function bindByEmail(params, context) {
const { email, captcha, env, } = params;
const userId = context.getCurrentUserId();
@ -1254,7 +1269,6 @@ async function bindByEmail(params, context) {
await bindLogic();
closeRootMode();
}
exports.bindByEmail = bindByEmail;
async function setupLoginName(name, env, context) {
const result2 = await context.select('loginName', {
data: {
@ -1495,7 +1509,6 @@ async function setUserAvatarFromWechat(params, context) {
}, {});
}
}
exports.setUserAvatarFromWechat = setUserAvatarFromWechat;
async function tryRefreshWechatPublicUserInfo(wechatUserId, context) {
const [wechatUser] = await context.select('wechatUser', {
data: {
@ -1598,7 +1611,6 @@ async function refreshWechatPublicUserInfo({}, context) {
(0, assert_1.assert)(token.entityId);
return await tryRefreshWechatPublicUserInfo(token.entityId, context);
}
exports.refreshWechatPublicUserInfo = refreshWechatPublicUserInfo;
// 用户在微信端授权登录后在web端触发该方法
async function loginByWechat(params, context) {
const { wechatLoginId, env } = params;
@ -1628,7 +1640,6 @@ async function loginByWechat(params, context) {
closeRootMode();
return tokenValue;
}
exports.loginByWechat = loginByWechat;
async function loginFromWechatEnv(code, env, context, wechatLoginId) {
const application = context.getApplication();
const { type, config, systemId } = application;
@ -1975,7 +1986,6 @@ async function loginWechatNative({ code, env, }, context) {
closeRootMode();
return tokenValue;
}
exports.loginWechatNative = loginWechatNative;
/**
* 公众号授权登录
* @param param0
@ -2006,7 +2016,6 @@ async function loginWechat({ code, env, wechatLoginId, }, context) {
closeRootMode();
return tokenValue;
}
exports.loginWechat = loginWechat;
/**
* 小程序授权登录
* @param param0
@ -2020,7 +2029,6 @@ async function loginWechatMp({ code, env, }, context) {
closeRootMode();
return tokenValue;
}
exports.loginWechatMp = loginWechatMp;
/**
* 同步从wx.getUserProfile拿到的用户信息
* @param param0
@ -2074,7 +2082,6 @@ async function syncUserInfoWechatMp({ nickname, avatarUrl, encryptedData, iv, si
// 实测发现解密出来的和userInfo完全一致……
await setUserInfoFromWechat(user, { nickname, avatar: avatarUrl }, context);
}
exports.syncUserInfoWechatMp = syncUserInfoWechatMp;
async function sendCaptchaByMobile({ mobile, env, type: captchaType, }, context) {
const { type } = env;
let visitorId = mobile;
@ -2248,7 +2255,6 @@ async function sendCaptchaByMobile({ mobile, env, type: captchaType, }, context)
return '验证码发送失败';
}
}
exports.sendCaptchaByMobile = sendCaptchaByMobile;
async function sendCaptchaByEmail({ email, env, type: captchaType, }, context) {
const { type } = env;
let visitorId = email;
@ -2401,7 +2407,6 @@ async function sendCaptchaByEmail({ email, env, type: captchaType, }, context) {
return '验证码发送失败';
}
}
exports.sendCaptchaByEmail = sendCaptchaByEmail;
async function switchTo({ userId }, context) {
const reallyRoot = context.isReallyRoot();
if (!reallyRoot) {
@ -2423,7 +2428,6 @@ async function switchTo({ userId }, context) {
},
}, {});
}
exports.switchTo = switchTo;
async function getWechatMpUserPhoneNumber({ code, env }, context) {
const application = context.getApplication();
const { type, config, systemId } = application;
@ -2439,7 +2443,6 @@ async function getWechatMpUserPhoneNumber({ code, env }, context) {
closeRootMode();
return reuslt;
}
exports.getWechatMpUserPhoneNumber = getWechatMpUserPhoneNumber;
async function logout(params, context) {
const { tokenValue } = params;
if (tokenValue) {
@ -2462,7 +2465,6 @@ async function logout(params, context) {
closeRootMode();
}
}
exports.logout = logout;
/**
* 创建一个当前parasite上的token
* @param params
@ -2529,7 +2531,6 @@ async function wakeupParasite(params, context) {
closeRootMode();
return tokenValue;
}
exports.wakeupParasite = wakeupParasite;
/**
* todo 检查登录环境一致性同一个token不能跨越不同设备
* @param env1
@ -2602,8 +2603,8 @@ async function refreshToken(params, context) {
// 只有server模式去刷新token
// 'development' | 'production' | 'staging'
const intervals = {
development: 7200 * 1000,
staging: 600 * 1000,
development: 7200 * 1000, // 2小时
staging: 600 * 1000, // 十分钟
production: 600 * 1000, // 十分钟
};
let applicationId = token.applicationId;
@ -2676,7 +2677,6 @@ async function refreshToken(params, context) {
closeRootMode();
return tokenValue;
}
exports.refreshToken = refreshToken;
/**
* 使用微信小程序中的token登录web
* @param tokenValue
@ -2744,4 +2744,3 @@ async function loginWebByMpToken(params, context) {
closeRootMode();
return tokenValue;
}
exports.loginWebByMpToken = loginWebByMpToken;

View File

@ -1,6 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.unbindingWechat = void 0;
exports.unbindingWechat = unbindingWechat;
const types_1 = require("oak-domain/lib/types");
const uuid_1 = require("oak-domain/lib/utils/uuid");
const assert_1 = require("oak-domain/lib/utils/assert");
@ -67,4 +67,3 @@ async function unbindingWechat(params, context) {
fn();
}
}
exports.unbindingWechat = unbindingWechat;

View File

@ -1,6 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initialize = exports.create = void 0;
exports.create = create;
exports.initialize = initialize;
const tslib_1 = require("tslib");
const token_1 = require("./token");
const extraFile_1 = require("./extraFile");
@ -37,7 +38,6 @@ function create(basicFeatures) {
userWechatPublicTag,
};
}
exports.create = create;
const selectionRewriter_1 = require("../utils/selectionRewriter");
async function initialize(features, access, config, clazzes) {
features.cache.registerSelectionRewriter(selectionRewriter_1.rewriteSelection);
@ -56,4 +56,3 @@ async function initialize(features, access, config, clazzes) {
}
}
}
exports.initialize = initialize;

View File

@ -1,4 +1,5 @@
import { Feature } from 'oak-frontend-base/es/types/Feature';
import { OakException } from 'oak-domain/lib/types/Exception';
import { Cache } from 'oak-frontend-base/es/features/cache';
import { LocalStorage } from 'oak-frontend-base/es/features/localStorage';
import { Environment } from 'oak-frontend-base/es/features/environment';
@ -10,6 +11,7 @@ export declare class Token<ED extends EntityDict> extends Feature {
protected cache: Cache<ED>;
protected storage: LocalStorage;
protected application: Application<ED>;
protected ignoreExceptionList: typeof OakException<ED>[];
protected loadSavedToken(): Promise<void>;
constructor(cache: Cache<ED>, storage: LocalStorage, environment: Environment, application: Application<ED>);
protected checkNeedSetPassword(): Promise<never> | undefined;
@ -48,4 +50,6 @@ export declare class Token<ED extends EntityDict> extends Feature {
wakeupParasite(id: string): Promise<void>;
needVerifyPassword(): boolean | null | undefined;
verifyPassword(password: string): Promise<void>;
addIgnoreException(clazz: typeof OakException<ED>): void;
removeIgnoreException(clazz: typeof OakException<ED>): void;
}

View File

@ -13,6 +13,7 @@ class Token extends Feature_1.Feature {
cache;
storage;
application;
ignoreExceptionList = [Exception_1.OakNetworkException, Exception_1.OakServerProxyException, Exception_1.OakRequestTimeoutException, Exception_1.OakClockDriftException];
async loadSavedToken() {
this.tokenValue = await this.storage.load(constants_1.LOCAL_STORAGE_KEYS.token);
await this.refreshTokenData(this.tokenValue);
@ -78,10 +79,17 @@ class Token extends Feature_1.Feature {
catch (err) {
// refresh出了任何错都无视(排除网络异常)直接放弃此token
console.warn(err);
if (err instanceof Exception_1.OakNetworkException ||
err instanceof Exception_1.OakServerProxyException ||
err instanceof Exception_1.OakRequestTimeoutException ||
err instanceof Exception_1.OakClockDriftException) {
// if (
// err instanceof OakNetworkException ||
// err instanceof OakServerProxyException ||
// err instanceof OakRequestTimeoutException ||
// err instanceof OakClockDriftException
// ) {
// return;
// }
if (this.ignoreExceptionList.some((clazz) => {
return (0, Exception_1.isOakException)(err, clazz);
})) {
return;
}
this.removeToken(true);
@ -365,5 +373,13 @@ class Token extends Feature_1.Feature {
env,
});
}
addIgnoreException(clazz) {
if (!this.ignoreExceptionList.includes(clazz)) {
this.ignoreExceptionList.push(clazz);
}
}
removeIgnoreException(clazz) {
this.ignoreExceptionList = this.ignoreExceptionList.filter((c) => c !== clazz);
}
}
exports.Token = Token;

Some files were not shown because too many files have changed in this diff Show More