toDo修改
This commit is contained in:
parent
e268bf95cd
commit
5856df8dab
|
|
@ -21,20 +21,17 @@ export async function getApplication(params, context) {
|
||||||
}, {});
|
}, {});
|
||||||
//微信小程序环境下 没有就报错
|
//微信小程序环境下 没有就报错
|
||||||
if (type === 'wechatMp') {
|
if (type === 'wechatMp') {
|
||||||
assert(
|
assert(application, '微信小程序环境下 application必须存在小程序相关配置');
|
||||||
application,
|
}
|
||||||
'微信小程序环境下 application必须存在小程序相关配置'
|
else if (type === 'native') {
|
||||||
);
|
|
||||||
} else if (type === 'native') {
|
|
||||||
assert(application, 'APP环境下 application必须存在APP相关配置');
|
assert(application, 'APP环境下 application必须存在APP相关配置');
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
//web 或 wechatPublic
|
//web 或 wechatPublic
|
||||||
if (type === 'wechatPublic') {
|
if (type === 'wechatPublic') {
|
||||||
// 如果微信公众号环境下 application不存在公众号配置,但又在公众号访问,这时可以使用web的application
|
// 如果微信公众号环境下 application不存在公众号配置,但又在公众号访问,这时可以使用web的application
|
||||||
if (!application) {
|
if (!application) {
|
||||||
const [application2] = await context.select(
|
const [application2] = await context.select('application', {
|
||||||
'application',
|
|
||||||
{
|
|
||||||
data: cloneDeep(applicationProjection),
|
data: cloneDeep(applicationProjection),
|
||||||
filter: {
|
filter: {
|
||||||
type: 'web',
|
type: 'web',
|
||||||
|
|
@ -44,16 +41,12 @@ export async function getApplication(params, context) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
}, {});
|
||||||
{}
|
assert(application2, '微信公众号环境下 application不存在公众号配置,但必须存在web相关配置');
|
||||||
);
|
|
||||||
assert(
|
|
||||||
application2,
|
|
||||||
'微信公众号环境下 application不存在公众号配置,但必须存在web相关配置'
|
|
||||||
);
|
|
||||||
return application2.id;
|
return application2.id;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
assert(application, 'web环境下 application必须存在web相关配置');
|
assert(application, 'web环境下 application必须存在web相关配置');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1148,24 +1148,18 @@ export async function sendCaptcha({ mobile, env, type: type2, }, context) {
|
||||||
}, {
|
}, {
|
||||||
dontCollect: true,
|
dontCollect: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'development' || mockSend) {
|
if (process.env.NODE_ENV === 'development' || mockSend) {
|
||||||
closeRootMode();
|
closeRootMode();
|
||||||
return `验证码[${code}]已创建`;
|
return `验证码[${code}]已创建`;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
//发送短信
|
//发送短信
|
||||||
const result = await sendSms(
|
const result = await sendSms({
|
||||||
{
|
|
||||||
origin: 'tencent',
|
origin: 'tencent',
|
||||||
templateName: '登录',
|
templateName: '登录',
|
||||||
mobile,
|
mobile,
|
||||||
templateParam: {
|
templateParam: { code, duration: duration.toString() },
|
||||||
code,
|
}, context);
|
||||||
duration: duration.toString(),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
context
|
|
||||||
);
|
|
||||||
closeRootMode();
|
closeRootMode();
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
return '验证码已发送';
|
return '验证码已发送';
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { Style } from '../../../../types/Style';
|
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, {
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../../oak-app-domain").EntityDict, keyof import("../../../../oak-app-domain").EntityDict, false, {
|
||||||
style: Style;
|
style: Style;
|
||||||
entity: "application" | "platform" | "system";
|
entity: "application" | "system" | "platform";
|
||||||
entityId: string;
|
entityId: string;
|
||||||
name: string;
|
name: string;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { Config } from '../../../types/Config';
|
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, {
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, keyof import("../../../oak-app-domain").EntityDict, false, {
|
||||||
config: Config;
|
config: Config;
|
||||||
entity: "platform" | "system";
|
entity: "system" | "platform";
|
||||||
name: string;
|
name: string;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||||
|
|
|
||||||
|
|
@ -14,17 +14,17 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
|
||||||
buttonProps?: (ButtonProps & {
|
buttonProps?: (ButtonProps & {
|
||||||
color?: "success" | "default" | "warning" | "primary" | "danger" | undefined;
|
color?: "success" | "default" | "warning" | "primary" | "danger" | undefined;
|
||||||
fill?: "none" | "solid" | "outline" | undefined;
|
fill?: "none" | "solid" | "outline" | undefined;
|
||||||
size?: "small" | "middle" | "large" | "mini" | undefined;
|
size?: "small" | "large" | "middle" | "mini" | undefined;
|
||||||
block?: boolean | undefined;
|
block?: boolean | undefined;
|
||||||
loading?: boolean | "auto" | undefined;
|
loading?: boolean | "auto" | undefined;
|
||||||
loadingText?: string | undefined;
|
loadingText?: string | undefined;
|
||||||
loadingIcon?: import("react").ReactNode;
|
loadingIcon?: import("react").ReactNode;
|
||||||
disabled?: boolean | undefined;
|
disabled?: boolean | undefined;
|
||||||
onClick?: ((event: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => unknown) | undefined;
|
onClick?: ((event: import("react").MouseEvent<HTMLButtonElement, MouseEvent>) => unknown) | undefined;
|
||||||
type?: "button" | "reset" | "submit" | undefined;
|
type?: "button" | "submit" | "reset" | undefined;
|
||||||
shape?: "default" | "rounded" | "rectangular" | undefined;
|
shape?: "default" | "rounded" | "rectangular" | undefined;
|
||||||
children?: import("react").ReactNode;
|
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" | "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & {
|
||||||
className?: string | undefined;
|
className?: string | undefined;
|
||||||
style?: (import("react").CSSProperties & Partial<Record<"--text-color" | "--background-color" | "--border-radius" | "--border-width" | "--border-style" | "--border-color", 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;
|
tabIndex?: number | undefined;
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ export default OakComponent({
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
id: 1,
|
id: 1,
|
||||||
|
$$createAt$$: 1,
|
||||||
name: 1,
|
name: 1,
|
||||||
nickname: 1,
|
nickname: 1,
|
||||||
mobile$user: {
|
mobile$user: {
|
||||||
|
|
@ -91,6 +92,18 @@ export default OakComponent({
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
sorters: [
|
||||||
|
{
|
||||||
|
sorter() {
|
||||||
|
return {
|
||||||
|
$attr: {
|
||||||
|
$$createAt$$: 1,
|
||||||
|
},
|
||||||
|
$direction: 'desc'
|
||||||
|
};
|
||||||
|
},
|
||||||
|
}
|
||||||
|
],
|
||||||
filters: [
|
filters: [
|
||||||
{
|
{
|
||||||
filter() {
|
filter() {
|
||||||
|
|
|
||||||
|
|
@ -5,5 +5,6 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
|
||||||
entity: keyof ED2;
|
entity: keyof ED2;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
relations: EntityDict['relation']['OpSchema'][];
|
relations: EntityDict['relation']['OpSchema'][];
|
||||||
|
passwordRequire: boolean;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@ export default OakComponent({
|
||||||
isList: false,
|
isList: false,
|
||||||
formData({ data: mobile }) {
|
formData({ data: mobile }) {
|
||||||
const { oakFullpath } = this.state;
|
const { oakFullpath } = this.state;
|
||||||
const userRelations = oakFullpath && this.features.runningTree.getOperations(`${oakFullpath}.user.userRelation$user`);
|
const userRelations = oakFullpath &&
|
||||||
|
this.features.runningTree.getOperations(`${oakFullpath}.user.userRelation$user`);
|
||||||
return {
|
return {
|
||||||
userId: mobile?.userId,
|
userId: mobile?.userId,
|
||||||
legal: userRelations && userRelations.length > 0,
|
legal: userRelations && userRelations.length > 0,
|
||||||
|
|
@ -20,6 +21,7 @@ export default OakComponent({
|
||||||
entity: '',
|
entity: '',
|
||||||
entityId: '',
|
entityId: '',
|
||||||
relations: [],
|
relations: [],
|
||||||
|
passwordRequire: false,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
mobileValue: '',
|
mobileValue: '',
|
||||||
|
|
@ -40,7 +42,7 @@ export default OakComponent({
|
||||||
filter: {
|
filter: {
|
||||||
mobile: value,
|
mobile: value,
|
||||||
ableState: 'enabled',
|
ableState: 'enabled',
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
this.clean();
|
this.clean();
|
||||||
|
|
@ -102,6 +104,6 @@ export default OakComponent({
|
||||||
},
|
},
|
||||||
searchCancelMp() {
|
searchCancelMp() {
|
||||||
this.onReset();
|
this.onReset();
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ export default function Render(props: WebComponentProps<EntityDict, 'mobile', fa
|
||||||
mobileValue: string;
|
mobileValue: string;
|
||||||
mobileValueReady: boolean;
|
mobileValueReady: boolean;
|
||||||
userId: string;
|
userId: string;
|
||||||
|
passwordRequire: boolean;
|
||||||
}, {
|
}, {
|
||||||
onMobileChange: (value: string) => Promise<void>;
|
onMobileChange: (value: string) => Promise<void>;
|
||||||
onConfirm: () => Promise<void>;
|
onConfirm: () => Promise<void>;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { Form, Input, Button } from 'antd-mobile';
|
||||||
import Style from './web.module.less';
|
import Style from './web.module.less';
|
||||||
import OnUser from '../onUser/index';
|
import OnUser from '../onUser/index';
|
||||||
export default function Render(props) {
|
export default function Render(props) {
|
||||||
const { mobileValue, mobileValueReady, relations, entity, entityId, userId, oakFullpath, oakExecutable, oakDirty } = props.data;
|
const { mobileValue, mobileValueReady, relations, entity, entityId, userId, oakFullpath, oakExecutable, oakDirty, passwordRequire, } = props.data;
|
||||||
const { onConfirm, onMobileChange, onReset, t } = props.methods;
|
const { onConfirm, onMobileChange, onReset, t } = props.methods;
|
||||||
return (<Form footer={<div className={Style.btnContainer}>
|
return (<Form footer={<div className={Style.btnContainer}>
|
||||||
<Button color="primary" style={{ flex: 2 }} onClick={() => {
|
<Button color="primary" style={{ flex: 2 }} onClick={() => {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ export default function Render(props: WebComponentProps<EntityDict, 'mobile', fa
|
||||||
userId: string;
|
userId: string;
|
||||||
legal: boolean;
|
legal: boolean;
|
||||||
isNew: boolean;
|
isNew: boolean;
|
||||||
|
passwordRequire: boolean;
|
||||||
}, {
|
}, {
|
||||||
onMobileChange: (value: string) => Promise<void>;
|
onMobileChange: (value: string) => Promise<void>;
|
||||||
onConfirm: () => Promise<void>;
|
onConfirm: () => Promise<void>;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import { Form, Input, Button, Space } from 'antd';
|
||||||
import Style from './web.pc.module.less';
|
import Style from './web.pc.module.less';
|
||||||
import OnUser from '../onUser/index';
|
import OnUser from '../onUser/index';
|
||||||
export default function Render(props) {
|
export default function Render(props) {
|
||||||
const { mobileValue, mobileValueReady, relations, entity, entityId, userId, oakFullpath, oakExecutable, legal, isNew } = props.data;
|
const { mobileValue, mobileValueReady, relations, entity, entityId, userId, oakFullpath, oakExecutable, legal, isNew, passwordRequire, } = props.data;
|
||||||
const { onConfirm, onMobileChange, onReset, t } = props.methods;
|
const { onConfirm, onMobileChange, onReset, t } = props.methods;
|
||||||
const [passwordConfirm, setPasswordConfirm] = useState(true);
|
const [passwordConfirm, setPasswordConfirm] = useState(true);
|
||||||
return (<div className={Style.container}>
|
return (<div className={Style.container}>
|
||||||
|
|
|
||||||
|
|
@ -7,5 +7,6 @@ declare const _default: <ED2 extends EntityDict & BaseEntityDict, T2 extends key
|
||||||
redirectToAfterConfirm: ED2["userEntityGrant"]["Schema"]["redirectTo"];
|
redirectToAfterConfirm: ED2["userEntityGrant"]["Schema"]["redirectTo"];
|
||||||
claimUrl: string;
|
claimUrl: string;
|
||||||
qrCodeType: string;
|
qrCodeType: string;
|
||||||
|
passwordRequire: boolean;
|
||||||
}>) => React.ReactElement;
|
}>) => React.ReactElement;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ export default OakComponent({
|
||||||
qrCodeType: '',
|
qrCodeType: '',
|
||||||
rule: 'single',
|
rule: 'single',
|
||||||
ruleOnRow: 'single',
|
ruleOnRow: 'single',
|
||||||
|
passwordRequire: false,
|
||||||
},
|
},
|
||||||
lifetimes: {
|
lifetimes: {
|
||||||
ready() {
|
ready() {
|
||||||
|
|
|
||||||
|
|
@ -6,5 +6,6 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps<
|
||||||
mobile: string;
|
mobile: string;
|
||||||
isComponent: boolean;
|
isComponent: boolean;
|
||||||
setPasswordConfirm: (value: boolean) => void;
|
setPasswordConfirm: (value: boolean) => void;
|
||||||
|
passwordRequire: boolean;
|
||||||
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
}>) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ export default OakComponent({
|
||||||
relations: [],
|
relations: [],
|
||||||
mobile: '',
|
mobile: '',
|
||||||
isComponent: false,
|
isComponent: false,
|
||||||
setPasswordConfirm: (value) => { }
|
setPasswordConfirm: (value) => { },
|
||||||
|
passwordRequire: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ export default function Render(props: WebComponentProps<EntityDict, 'user', fals
|
||||||
entity: keyof EntityDict;
|
entity: keyof EntityDict;
|
||||||
entityId: string;
|
entityId: string;
|
||||||
isNew: boolean;
|
isNew: boolean;
|
||||||
|
passwordRequire: boolean;
|
||||||
}, {
|
}, {
|
||||||
onMobileChange: (value: string) => Promise<void>;
|
onMobileChange: (value: string) => Promise<void>;
|
||||||
onConfirm: () => Promise<void>;
|
onConfirm: () => Promise<void>;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||||
import { Form, Input } from 'antd-mobile';
|
import { Form, Input } from 'antd-mobile';
|
||||||
import UserRelation from './userRelation';
|
import UserRelation from './userRelation';
|
||||||
export default function Render(props) {
|
export default function Render(props) {
|
||||||
const { name, isNew, nickname, password, relations, oakFullpath, entity, entityId } = props.data;
|
const { name, isNew, nickname, password, relations, oakFullpath, entity, entityId, passwordRequire, } = props.data;
|
||||||
const { t, update } = props.methods;
|
const { t, update } = props.methods;
|
||||||
return (<>
|
return (<>
|
||||||
<Form.Item style={{ marginBottom: 0 }} label={!isNew ? t('existedUser') : t('newUser')}/>
|
<Form.Item style={{ marginBottom: 0 }} label={!isNew ? t('existedUser') : t('newUser')}/>
|
||||||
|
|
@ -29,7 +29,7 @@ export default function Render(props) {
|
||||||
</>
|
</>
|
||||||
</Form.Item>) : (<Form.Item label={t('user:attr.password')} name="password" rules={[
|
</Form.Item>) : (<Form.Item label={t('user:attr.password')} name="password" rules={[
|
||||||
{
|
{
|
||||||
required: true,
|
required: passwordRequire,
|
||||||
},
|
},
|
||||||
]}>
|
]}>
|
||||||
<>
|
<>
|
||||||
|
|
|
||||||
|
|
@ -14,4 +14,5 @@ export default function Render(props: WebComponentProps<EntityDict, 'user', fals
|
||||||
qrCodeType?: QrCodeType;
|
qrCodeType?: QrCodeType;
|
||||||
rule: EntityDict['userEntityGrant']['OpSchema']['rule'];
|
rule: EntityDict['userEntityGrant']['OpSchema']['rule'];
|
||||||
ruleOnRow: EntityDict['userEntityGrant']['OpSchema']['ruleOnRow'];
|
ruleOnRow: EntityDict['userEntityGrant']['OpSchema']['ruleOnRow'];
|
||||||
|
passwordRequire: boolean;
|
||||||
}, {}>): JSX.Element;
|
}, {}>): JSX.Element;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import ByMobile from './byMobile/index';
|
||||||
import ByUserEntityGrant from './byUserEntityGrant';
|
import ByUserEntityGrant from './byUserEntityGrant';
|
||||||
import { assert } from 'oak-domain/lib/utils/assert';
|
import { assert } from 'oak-domain/lib/utils/assert';
|
||||||
export default function Render(props) {
|
export default function Render(props) {
|
||||||
const { entity, entityId, relations, grantByUserEntityGrant, grantByEmail, grantByMobile, grantMethodCount, oakFullpath, redirectToAfterConfirm, qrCodeType, claimUrl, rule, ruleOnRow, } = props.data;
|
const { entity, entityId, relations, grantByUserEntityGrant, grantByEmail, grantByMobile, grantMethodCount, oakFullpath, redirectToAfterConfirm, qrCodeType, claimUrl, rule, ruleOnRow, passwordRequire, } = props.data;
|
||||||
let SubPart = <></>;
|
let SubPart = <></>;
|
||||||
if (grantMethodCount === 0) {
|
if (grantMethodCount === 0) {
|
||||||
SubPart = (<div className={Style.container}>
|
SubPart = (<div className={Style.container}>
|
||||||
|
|
@ -17,7 +17,7 @@ export default function Render(props) {
|
||||||
SubPart = <div className={Style.container}>尚未实现</div>;
|
SubPart = <div className={Style.container}>尚未实现</div>;
|
||||||
}
|
}
|
||||||
else if (grantByMobile) {
|
else if (grantByMobile) {
|
||||||
SubPart = (<ByMobile entity={entity} entityId={entityId} relations={relations} oakPath="$userRelation-upsert-by-mobile" oakAutoUnmount={true}/>);
|
SubPart = (<ByMobile passwordRequire={passwordRequire} entity={entity} entityId={entityId} relations={relations} oakPath="$userRelation-upsert-by-mobile" oakAutoUnmount={true}/>);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
assert(grantByUserEntityGrant === true);
|
assert(grantByUserEntityGrant === true);
|
||||||
|
|
@ -53,7 +53,7 @@ export default function Render(props) {
|
||||||
items2.push(items[2]);
|
items2.push(items[2]);
|
||||||
}
|
}
|
||||||
SubPart = (<Tabs className={Style.tab}>
|
SubPart = (<Tabs className={Style.tab}>
|
||||||
{items2.map(ele => (<Tabs.Tab title={ele.label} key={ele.key}>
|
{items2.map((ele) => (<Tabs.Tab title={ele.label} key={ele.key}>
|
||||||
{ele.children}
|
{ele.children}
|
||||||
</Tabs.Tab>))}
|
</Tabs.Tab>))}
|
||||||
</Tabs>);
|
</Tabs>);
|
||||||
|
|
|
||||||
|
|
@ -14,4 +14,5 @@ export default function Render(props: WebComponentProps<EntityDict, 'relation',
|
||||||
qrCodeType?: QrCodeType;
|
qrCodeType?: QrCodeType;
|
||||||
rule: EntityDict['userEntityGrant']['OpSchema']['rule'];
|
rule: EntityDict['userEntityGrant']['OpSchema']['rule'];
|
||||||
ruleOnRow: EntityDict['userEntityGrant']['OpSchema']['ruleOnRow'];
|
ruleOnRow: EntityDict['userEntityGrant']['OpSchema']['ruleOnRow'];
|
||||||
|
passwordRequire: boolean;
|
||||||
}, {}>): JSX.Element;
|
}, {}>): JSX.Element;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import ByMobile from './byMobile/index';
|
||||||
import ByUserEntityGrant from './byUserEntityGrant';
|
import ByUserEntityGrant from './byUserEntityGrant';
|
||||||
import { assert } from 'oak-domain/lib/utils/assert';
|
import { assert } from 'oak-domain/lib/utils/assert';
|
||||||
export default function Render(props) {
|
export default function Render(props) {
|
||||||
const { entity, entityId, relations, grantByUserEntityGrant, grantByEmail, grantByMobile, grantMethodCount, oakFullpath, redirectToAfterConfirm, qrCodeType, claimUrl, rule, ruleOnRow, } = props.data;
|
const { entity, entityId, relations, grantByUserEntityGrant, grantByEmail, grantByMobile, grantMethodCount, oakFullpath, redirectToAfterConfirm, qrCodeType, claimUrl, rule, ruleOnRow, passwordRequire, } = props.data;
|
||||||
let SubPart = <></>;
|
let SubPart = <></>;
|
||||||
if (grantMethodCount === 0) {
|
if (grantMethodCount === 0) {
|
||||||
SubPart = (<div className={Style.container}>
|
SubPart = (<div className={Style.container}>
|
||||||
|
|
@ -17,7 +17,7 @@ export default function Render(props) {
|
||||||
SubPart = <div className={Style.container}>尚未实现</div>;
|
SubPart = <div className={Style.container}>尚未实现</div>;
|
||||||
}
|
}
|
||||||
else if (grantByMobile) {
|
else if (grantByMobile) {
|
||||||
SubPart = (<ByMobile entity={entity} entityId={entityId} relations={relations} oakPath="$userRelation-upsert-by-mobile" oakAutoUnmount={true}/>);
|
SubPart = (<ByMobile passwordRequire={passwordRequire} entity={entity} entityId={entityId} relations={relations} oakPath="$userRelation-upsert-by-mobile" oakAutoUnmount={true}/>);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
assert(grantByUserEntityGrant === true);
|
assert(grantByUserEntityGrant === true);
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ export interface Schema extends EntityShape {
|
||||||
codes: Array<WechatQrCode>;
|
codes: Array<WechatQrCode>;
|
||||||
isRoot?: Boolean;
|
isRoot?: Boolean;
|
||||||
addresses?: Address[];
|
addresses?: Address[];
|
||||||
accounts: Account[];
|
accounts?: Account[];
|
||||||
}
|
}
|
||||||
type IdAction = 'verify' | 'accept' | 'reject';
|
type IdAction = 'verify' | 'accept' | 'reject';
|
||||||
type IdState = 'unverified' | 'verified' | 'verifying';
|
type IdState = 'unverified' | 'verified' | 'verifying';
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
declare const _default: (import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "account", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>>)[];
|
declare const _default: (import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "account", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC>)[];
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ export async function completeToDo(entity, filter, action, context) {
|
||||||
targetEntity: entity,
|
targetEntity: entity,
|
||||||
targetFilter: filter,
|
targetFilter: filter,
|
||||||
action,
|
action,
|
||||||
|
iState: 'active',
|
||||||
}
|
}
|
||||||
}, {});
|
}, {});
|
||||||
assert(toDos.length > 0, `对${entity}相关的todo进行完成操作时,找不到对应的数据。filter是${JSON.stringify(filter)}`);
|
assert(toDos.length > 0, `对${entity}相关的todo进行完成操作时,找不到对应的数据。filter是${JSON.stringify(filter)}`);
|
||||||
|
|
|
||||||
|
|
@ -25,26 +25,18 @@ async function getApplication(params, context) {
|
||||||
}, {});
|
}, {});
|
||||||
//微信小程序环境下 没有就报错
|
//微信小程序环境下 没有就报错
|
||||||
if (type === 'wechatMp') {
|
if (type === 'wechatMp') {
|
||||||
(0, assert_1.assert)(
|
(0, assert_1.assert)(application, '微信小程序环境下 application必须存在小程序相关配置');
|
||||||
application,
|
}
|
||||||
'微信小程序环境下 application必须存在小程序相关配置'
|
else if (type === 'native') {
|
||||||
);
|
(0, assert_1.assert)(application, 'APP环境下 application必须存在APP相关配置');
|
||||||
} else if (type === 'native') {
|
}
|
||||||
(0, assert_1.assert)(
|
else {
|
||||||
application,
|
|
||||||
'APP环境下 application必须存在APP相关配置'
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
//web 或 wechatPublic
|
//web 或 wechatPublic
|
||||||
if (type === 'wechatPublic') {
|
if (type === 'wechatPublic') {
|
||||||
// 如果微信公众号环境下 application不存在公众号配置,但又在公众号访问,这时可以使用web的application
|
// 如果微信公众号环境下 application不存在公众号配置,但又在公众号访问,这时可以使用web的application
|
||||||
if (!application) {
|
if (!application) {
|
||||||
const [application2] = await context.select(
|
const [application2] = await context.select('application', {
|
||||||
'application',
|
data: (0, lodash_1.cloneDeep)(Projection_1.applicationProjection),
|
||||||
{
|
|
||||||
data: (0, lodash_1.cloneDeep)(
|
|
||||||
Projection_1.applicationProjection
|
|
||||||
),
|
|
||||||
filter: {
|
filter: {
|
||||||
type: 'web',
|
type: 'web',
|
||||||
system: {
|
system: {
|
||||||
|
|
@ -53,20 +45,13 @@ async function getApplication(params, context) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
}, {});
|
||||||
{}
|
(0, assert_1.assert)(application2, '微信公众号环境下 application不存在公众号配置,但必须存在web相关配置');
|
||||||
);
|
|
||||||
(0, assert_1.assert)(
|
|
||||||
application2,
|
|
||||||
'微信公众号环境下 application不存在公众号配置,但必须存在web相关配置'
|
|
||||||
);
|
|
||||||
return application2.id;
|
return application2.id;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
(0, assert_1.assert)(
|
else {
|
||||||
application,
|
(0, assert_1.assert)(application, 'web环境下 application必须存在web相关配置');
|
||||||
'web环境下 application必须存在web相关配置'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return application.id;
|
return application.id;
|
||||||
|
|
|
||||||
|
|
@ -1157,21 +1157,18 @@ async function sendCaptcha({ mobile, env, type: type2, }, context) {
|
||||||
}, {
|
}, {
|
||||||
dontCollect: true,
|
dontCollect: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (process.env.NODE_ENV === 'development' || mockSend) {
|
if (process.env.NODE_ENV === 'development' || mockSend) {
|
||||||
closeRootMode();
|
closeRootMode();
|
||||||
return `验证码[${code}]已创建`;
|
return `验证码[${code}]已创建`;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
//发送短信
|
//发送短信
|
||||||
const result = await (0, sms_1.sendSms)(
|
const result = await (0, sms_1.sendSms)({
|
||||||
{
|
|
||||||
origin: 'tencent',
|
origin: 'tencent',
|
||||||
templateName: '登录',
|
templateName: '登录',
|
||||||
mobile,
|
mobile,
|
||||||
templateParam: { code, duration: duration.toString() },
|
templateParam: { code, duration: duration.toString() },
|
||||||
},
|
}, context);
|
||||||
context
|
|
||||||
);
|
|
||||||
closeRootMode();
|
closeRootMode();
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
return '验证码已发送';
|
return '验证码已发送';
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ export interface Schema extends EntityShape {
|
||||||
codes: Array<WechatQrCode>;
|
codes: Array<WechatQrCode>;
|
||||||
isRoot?: Boolean;
|
isRoot?: Boolean;
|
||||||
addresses?: Address[];
|
addresses?: Address[];
|
||||||
accounts: Account[];
|
accounts?: Account[];
|
||||||
}
|
}
|
||||||
type IdAction = 'verify' | 'accept' | 'reject';
|
type IdAction = 'verify' | 'accept' | 'reject';
|
||||||
type IdState = 'unverified' | 'verified' | 'verifying';
|
type IdState = 'unverified' | 'verified' | 'verifying';
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,2 @@
|
||||||
declare const _default: (import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "account", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>>)[];
|
declare const _default: (import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "account", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMpJump", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatPublicTag", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "sessionMessage", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "extraFile", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "parasite", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "article", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "articleMenu", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "application", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatLogin", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "notification", import("..").BackendRuntimeContext<import("../oak-app-domain").EntityDict>> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "wechatQrCode", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "userEntityGrant", import("..").BRC> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "user", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "address", import("..").RuntimeCxt> | import("oak-domain").Trigger<import("../oak-app-domain").EntityDict, "message", import("..").BRC>)[];
|
||||||
export default _default;
|
export default _default;
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,7 @@ async function completeToDo(entity, filter, action, context) {
|
||||||
targetEntity: entity,
|
targetEntity: entity,
|
||||||
targetFilter: filter,
|
targetFilter: filter,
|
||||||
action,
|
action,
|
||||||
|
iState: 'active',
|
||||||
}
|
}
|
||||||
}, {});
|
}, {});
|
||||||
(0, assert_1.default)(toDos.length > 0, `对${entity}相关的todo进行完成操作时,找不到对应的数据。filter是${JSON.stringify(filter)}`);
|
(0, assert_1.default)(toDos.length > 0, `对${entity}相关的todo进行完成操作时,找不到对应的数据。filter是${JSON.stringify(filter)}`);
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,7 @@ export async function completeToDo<ED extends EntityDict & BaseEntityDict, T ext
|
||||||
targetEntity: entity as string,
|
targetEntity: entity as string,
|
||||||
targetFilter: filter,
|
targetFilter: filter,
|
||||||
action,
|
action,
|
||||||
|
iState: 'active',
|
||||||
}
|
}
|
||||||
}, {});
|
}, {});
|
||||||
assert(toDos.length > 0, `对${entity as string}相关的todo进行完成操作时,找不到对应的数据。filter是${JSON.stringify(filter)}`);
|
assert(toDos.length > 0, `对${entity as string}相关的todo进行完成操作时,找不到对应的数据。filter是${JSON.stringify(filter)}`);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue