线上先不显示微信账号绑定入口
This commit is contained in:
parent
37e2e7a8ff
commit
a50d4a1435
|
|
@ -188,12 +188,10 @@ createData, user) {
|
|||
(0, assert_1.assert)(schema.hasOwnProperty(entity), "".concat(entity, "\u5FC5\u987B\u662F\u6709\u6548\u7684\u5BF9\u8C61\u540D "));
|
||||
(0, assert_1.assert)(schema.token.attributes.entity.ref.includes(entity), "".concat(entity, "\u5FC5\u987B\u662Ftoken\u7684\u6709\u6548\u5173\u8054\u5BF9\u8C61"));
|
||||
(0, assert_1.assert)(schema[entity].attributes.hasOwnProperty('userId') && schema[entity].attributes.userId.ref === 'user', "".concat(entity, "\u5FC5\u987B\u6709\u6307\u5411user\u7684userId\u5C5E\u6027"));
|
||||
console.log('-------------currentToken-------------', currentToken);
|
||||
if (!currentToken) return [3 /*break*/, 20];
|
||||
(0, assert_1.assert)(currentToken.id);
|
||||
(0, assert_1.assert)(currentToken.userId);
|
||||
if (!user) return [3 /*break*/, 12];
|
||||
console.log('-------ifcurrentTokenifuser----------------');
|
||||
userState = user.userState;
|
||||
_a = userState;
|
||||
switch (_a) {
|
||||
|
|
@ -253,7 +251,6 @@ createData, user) {
|
|||
_23.label = 11;
|
||||
case 11: return [3 /*break*/, 19];
|
||||
case 12:
|
||||
console.log('-------ifcurrentToken-else----------------');
|
||||
// 没用户,指向当前用户
|
||||
(0, assert_1.assert)(createData && !entityId);
|
||||
if (!createData) return [3 /*break*/, 15];
|
||||
|
|
@ -291,7 +288,6 @@ createData, user) {
|
|||
case 18: return [2 /*return*/, currentToken.id];
|
||||
case 19: return [3 /*break*/, 50];
|
||||
case 20:
|
||||
console.log('------------elseToken------------');
|
||||
if (!entityId) return [3 /*break*/, 22];
|
||||
application = context.getApplication();
|
||||
return [4 /*yield*/, context.select('token', {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export declare type WechatMpConfig = {
|
|||
mode: 'clear' | 'compatible' | 'safe';
|
||||
dataFormat: 'json' | 'xml';
|
||||
};
|
||||
passport: Passport[];
|
||||
passport?: Passport[];
|
||||
};
|
||||
export declare type WebConfig = {
|
||||
type: 'web';
|
||||
|
|
@ -27,7 +27,7 @@ export declare type WebConfig = {
|
|||
domain?: string;
|
||||
enable?: boolean;
|
||||
};
|
||||
passport: Passport[];
|
||||
passport?: Passport[];
|
||||
};
|
||||
export declare type WechatPublicTemplateMsgsConfig = Record<string, string>;
|
||||
export declare type WechatPublicConfig = {
|
||||
|
|
@ -48,7 +48,7 @@ export declare type WechatPublicConfig = {
|
|||
appId: string;
|
||||
originalId: string;
|
||||
};
|
||||
passport: Passport[];
|
||||
passport?: Passport[];
|
||||
};
|
||||
export interface Schema extends EntityShape {
|
||||
name: String<32>;
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ export declare type WechatMpConfig = {
|
|||
mode: 'clear' | 'compatible' | 'safe';
|
||||
dataFormat: 'json' | 'xml';
|
||||
};
|
||||
passport: Passport[];
|
||||
passport?: Passport[];
|
||||
};
|
||||
export declare type WebConfig = {
|
||||
type: 'web';
|
||||
|
|
@ -37,7 +37,7 @@ export declare type WebConfig = {
|
|||
domain?: string;
|
||||
enable?: boolean;
|
||||
};
|
||||
passport: Passport[];
|
||||
passport?: Passport[];
|
||||
};
|
||||
export declare type WechatPublicTemplateMsgsConfig = Record<string, string>;
|
||||
export declare type WechatPublicConfig = {
|
||||
|
|
@ -58,7 +58,7 @@ export declare type WechatPublicConfig = {
|
|||
appId: string;
|
||||
originalId: string;
|
||||
};
|
||||
passport: Passport[];
|
||||
passport?: Passport[];
|
||||
};
|
||||
export declare type OpSchema = EntityShape & {
|
||||
name: String<32>;
|
||||
|
|
|
|||
|
|
@ -60,9 +60,9 @@ function Render(props) {
|
|||
return;
|
||||
}
|
||||
setOpen(true);
|
||||
} }, { children: mobile ? t('manage') : t('bind') }))] }) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u5FAE\u4FE1\u5E10\u53F7" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: wechatUser ? ((0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Typography, { children: wechatUser.nickname }), (0, jsx_runtime_1.jsx)(bindingList_1.default, { oakPath: oakFullpath ? "".concat(oakFullpath, ".wechatUser$user") : undefined })] })) : ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ size: "small", onClick: function () {
|
||||
} }, { children: mobile ? t('manage') : t('bind') }))] }) }) })), process.env.NODE_ENV === 'development' && ((0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ label: "\u5FAE\u4FE1\u5E10\u53F7" }, { children: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: wechatUser ? ((0, jsx_runtime_1.jsxs)(antd_1.Space, { children: [(0, jsx_runtime_1.jsx)(antd_1.Typography, { children: wechatUser.nickname }), (0, jsx_runtime_1.jsx)(bindingList_1.default, { oakPath: oakFullpath ? "".concat(oakFullpath, ".wechatUser$user") : undefined })] })) : ((0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ size: "small", onClick: function () {
|
||||
setOpen2(true);
|
||||
} }, { children: "\u7ED1\u5B9A" }))) }) })), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: {
|
||||
} }, { children: "\u7ED1\u5B9A" }))) }) }))), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, tslib_1.__assign({ wrapperCol: {
|
||||
xs: { offset: 4 },
|
||||
md: { offset: 6 },
|
||||
} }, { children: (0, jsx_runtime_1.jsx)(antd_1.Space, { children: (0, jsx_runtime_1.jsx)(antd_1.Button, tslib_1.__assign({ disabled: oakExecuting || !oakDirty, type: "primary", onClick: function () {
|
||||
|
|
|
|||
|
|
@ -155,12 +155,10 @@ async function setUpTokenAndUser<ED extends EntityDict, Cxt extends BackendRunti
|
|||
assert(schema.hasOwnProperty(entity), `${entity}必须是有效的对象名 `);
|
||||
assert(schema.token.attributes.entity.ref!.includes(entity), `${entity}必须是token的有效关联对象`);
|
||||
assert(schema[entity as keyof ED].attributes.hasOwnProperty('userId') && (schema[entity as keyof ED].attributes as any).userId!.ref === 'user', `${entity}必须有指向user的userId属性`);
|
||||
console.log('-------------currentToken-------------',currentToken);
|
||||
if (currentToken) {
|
||||
assert(currentToken.id);
|
||||
assert(currentToken.userId);
|
||||
if (user) {
|
||||
console.log('-------ifcurrentTokenifuser----------------')
|
||||
// 有用户,和当前用户进行合并
|
||||
const { userState } = user;
|
||||
switch (userState) {
|
||||
|
|
@ -203,7 +201,6 @@ async function setUpTokenAndUser<ED extends EntityDict, Cxt extends BackendRunti
|
|||
}
|
||||
}
|
||||
else {
|
||||
console.log('-------ifcurrentToken-else----------------')
|
||||
// 没用户,指向当前用户
|
||||
assert(createData && !entityId);
|
||||
if (createData) {
|
||||
|
|
@ -232,7 +229,6 @@ async function setUpTokenAndUser<ED extends EntityDict, Cxt extends BackendRunti
|
|||
}
|
||||
}
|
||||
else {
|
||||
console.log('------------elseToken------------');
|
||||
if (entityId) {
|
||||
// 已经有相应对象,判定一下能否重用上一次的token
|
||||
const application = context.getApplication();
|
||||
|
|
|
|||
|
|
@ -207,27 +207,29 @@ export default function Render(
|
|||
</Space>
|
||||
</>
|
||||
</Form.Item>
|
||||
{/* <Form.Item label="微信帐号">
|
||||
<>
|
||||
{wechatUser ? (
|
||||
<Space>
|
||||
<Typography>{wechatUser.nickname}</Typography>
|
||||
<WechatUserList
|
||||
oakPath={oakFullpath ? `${oakFullpath}.wechatUser$user` : undefined}
|
||||
/>
|
||||
</Space>
|
||||
) : (
|
||||
<Button
|
||||
size="small"
|
||||
onClick={() => {
|
||||
setOpen2(true);
|
||||
}}
|
||||
>
|
||||
绑定
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
</Form.Item> */}
|
||||
{process.env.NODE_ENV === 'development' && (
|
||||
<Form.Item label="微信帐号">
|
||||
<>
|
||||
{wechatUser ? (
|
||||
<Space>
|
||||
<Typography>{wechatUser.nickname}</Typography>
|
||||
<WechatUserList
|
||||
oakPath={oakFullpath ? `${oakFullpath}.wechatUser$user` : undefined}
|
||||
/>
|
||||
</Space>
|
||||
) : (
|
||||
<Button
|
||||
size="small"
|
||||
onClick={() => {
|
||||
setOpen2(true);
|
||||
}}
|
||||
>
|
||||
绑定
|
||||
</Button>
|
||||
)}
|
||||
</>
|
||||
</Form.Item>
|
||||
)}
|
||||
<Form.Item
|
||||
wrapperCol={{
|
||||
xs: { offset: 4 },
|
||||
|
|
|
|||
Loading…
Reference in New Issue