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