application 加上sessions
This commit is contained in:
parent
a19c1c32d0
commit
06814d731e
|
|
@ -16,7 +16,7 @@
|
|||
"@wangeditor/editor-for-react": "^1.0.4",
|
||||
"classnames": "^2.3.1",
|
||||
"copy-to-clipboard": "^3.3.3",
|
||||
"dayjs": "^1.11.5",
|
||||
"dayjs": "^1.11.9",
|
||||
"node-fetch": "^2.6.7",
|
||||
"oak-common-aspect": "file:../oak-common-aspect",
|
||||
"oak-domain": "file:../oak-domain",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { generateNewId, generateNewIdAsync } from "oak-domain/lib/utils/uuid";
|
||||
import { generateNewIdAsync } from "oak-domain/lib/utils/uuid";
|
||||
import { BackendRuntimeContext } from "../context/BackendRuntimeContext";
|
||||
import { EntityDict } from "../oak-app-domain";
|
||||
|
||||
|
|
@ -6,7 +6,11 @@ import {
|
|||
WebEnv,
|
||||
WechatMpEnv,
|
||||
} from 'oak-domain/lib/types/Environment';
|
||||
import { OakRowInconsistencyException, OakExternalException, SelectOpResult } from 'oak-domain/lib/types';
|
||||
import {
|
||||
OakRowInconsistencyException,
|
||||
OakUserException,
|
||||
} from 'oak-domain/lib/types';
|
||||
|
||||
export async function confirmUserEntityGrant<
|
||||
ED extends EntityDict,
|
||||
Cxt extends BackendRuntimeContext<ED>
|
||||
|
|
@ -44,7 +48,7 @@ export async function confirmUserEntityGrant<
|
|||
const { number, confirmed } = userEntityGrant;
|
||||
if (confirmed! >= number!) {
|
||||
closeRootMode()
|
||||
throw new OakExternalException(`超出分享上限人数${number}人`);
|
||||
throw new OakUserException(`超出分享上限人数${number}人`);
|
||||
}
|
||||
Object.assign(userEntityGrant, {
|
||||
confirmed: confirmed! + 1,
|
||||
|
|
@ -90,10 +94,10 @@ export async function confirmUserEntityGrant<
|
|||
await context.operate(
|
||||
'userRelation',
|
||||
{
|
||||
id: generateNewId(),
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'create',
|
||||
data: {
|
||||
id: generateNewId(),
|
||||
id: await generateNewIdAsync(),
|
||||
userId,
|
||||
relationId,
|
||||
entity,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import { String, Int, Datetime, Image, Boolean, Text } from 'oak-domain/lib/types/DataType';
|
||||
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
||||
import { Schema as System } from './System';
|
||||
import { Schema as Session } from './Session';
|
||||
|
||||
import { Style } from '../types/Style';
|
||||
import { EntityDesc } from 'oak-domain/lib/types/EntityDesc';
|
||||
|
||||
|
|
@ -55,6 +57,7 @@ export type WechatPublicConfig = {
|
|||
originalId: string; //原始id
|
||||
};
|
||||
passport?: Passport[];
|
||||
sessions?: Session[];
|
||||
};
|
||||
|
||||
export interface Schema extends EntityShape {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import URL from 'url';
|
||||
|
||||
export default OakComponent({
|
||||
isList: false,
|
||||
|
|
@ -22,12 +21,11 @@ export default OakComponent({
|
|||
const { features, t } = this;
|
||||
const token = features.token.getToken(true);
|
||||
const url = window.location.href;
|
||||
const urlParse = URL.parse(url, true);
|
||||
const urlParse = new URL(url);
|
||||
//格式 xx?code=xx&state=/xx/xx?d=xx
|
||||
const query = urlParse?.query;
|
||||
const code = query?.code as string;
|
||||
const state = query?.state as string;
|
||||
const wechatLoginId = query?.wechatLoginId as string;
|
||||
const code = urlParse?.searchParams?.get('code') as string;
|
||||
const state = urlParse?.searchParams?.get('state') as string;
|
||||
const wechatLoginId = urlParse?.searchParams?.get('wechatLoginId') as string;
|
||||
if (!code) {
|
||||
this.setState({
|
||||
error: t('missingCodeParameter'),
|
||||
|
|
|
|||
|
|
@ -1,12 +1,6 @@
|
|||
import { generateNewId, generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
||||
import { Trigger, CreateTrigger, UpdateTrigger, SelectTrigger } from 'oak-domain/lib/types/Trigger';
|
||||
// import { CreateOperationData as CreateParasiteData } from '../general-app-domain/Parasite/Schema';
|
||||
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
||||
import { Trigger } from 'oak-domain/lib/types/Trigger';
|
||||
import { EntityDict } from '../oak-app-domain/EntityDict';
|
||||
|
||||
import { OakRowInconsistencyException, OakExternalException, SelectOpResult } from 'oak-domain/lib/types';
|
||||
import { assert } from 'oak-domain/lib/utils/assert';
|
||||
import { firstLetterUpperCase } from 'oak-domain/lib/utils/string';
|
||||
import { RuntimeCxt } from '../types/RuntimeCxt';
|
||||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
|
||||
const triggers: Trigger<EntityDict, 'parasite', BackendRuntimeContext<EntityDict>>[] = [
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
import { generateNewId, generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
||||
import { Trigger, CreateTrigger, UpdateTrigger, SelectTrigger } from 'oak-domain/lib/types/Trigger';
|
||||
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
||||
import { Trigger, CreateTrigger, UpdateTrigger } from 'oak-domain/lib/types/Trigger';
|
||||
import { CreateOperationData as CreateUserEntityGrantData } from '../oak-app-domain/UserEntityGrant/Schema';
|
||||
import { EntityDict } from '../oak-app-domain/EntityDict';
|
||||
|
||||
import { OakRowInconsistencyException, OakExternalException, SelectOpResult } from 'oak-domain/lib/types';
|
||||
import { OakRowInconsistencyException, OakUserException } from 'oak-domain/lib/types';
|
||||
import { assert } from 'oak-domain/lib/utils/assert';
|
||||
import { firstLetterUpperCase } from 'oak-domain/lib/utils/string';
|
||||
import { BRC } from '../types/RuntimeCxt';
|
||||
|
||||
const triggers: Trigger<EntityDict, 'userEntityGrant', BRC>[] = [
|
||||
|
|
@ -90,7 +89,7 @@ const triggers: Trigger<EntityDict, 'userEntityGrant', BRC>[] = [
|
|||
|
||||
const { number, confirmed } = result[0];
|
||||
if (confirmed! >= number!) {
|
||||
throw new OakExternalException(`超出分享上限人数${number}人`);
|
||||
throw new OakUserException(`超出分享上限人数${number}人`);
|
||||
}
|
||||
Object.assign(data, {
|
||||
confirmed: confirmed! + 1,
|
||||
|
|
@ -169,10 +168,10 @@ const triggers: Trigger<EntityDict, 'userEntityGrant', BRC>[] = [
|
|||
await context.operate(
|
||||
'userRelation',
|
||||
{
|
||||
id: generateNewId(),
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'create',
|
||||
data: {
|
||||
id: generateNewId(),
|
||||
id: await generateNewIdAsync(),
|
||||
userId,
|
||||
relationId,
|
||||
entity,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
import { generateNewId, generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
||||
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
||||
import { Trigger, CreateTrigger, UpdateTrigger, SelectTrigger } from 'oak-domain/lib/types/Trigger';
|
||||
import { CreateOperationData as CreateWechatLoginData } from '../oak-app-domain/WechatLogin/Schema';
|
||||
import { EntityDict } from '../oak-app-domain/EntityDict';
|
||||
|
||||
import { OakRowInconsistencyException, OakExternalException, SelectOpResult } from 'oak-domain/lib/types';
|
||||
import { assert } from 'oak-domain/lib/utils/assert';
|
||||
import { firstLetterUpperCase } from 'oak-domain/lib/utils/string';
|
||||
import { RuntimeCxt } from '../types/RuntimeCxt';
|
||||
|
||||
const triggers: Trigger<EntityDict, 'wechatLogin', RuntimeCxt>[] = [
|
||||
|
|
|
|||
Loading…
Reference in New Issue