diff --git a/template/src/context/RuntimeContext.ts b/template/src/context/RuntimeContext.ts index 211c821..c08cf46 100644 --- a/template/src/context/RuntimeContext.ts +++ b/template/src/context/RuntimeContext.ts @@ -1,6 +1,5 @@ -import { RuntimeContext as GeneralRuntimeContext } from 'oak-general-business'; /** * 若业务逻辑需要更多的上下文之间的数据传递,可以放在这里 */ -export interface RuntimeContext extends GeneralRuntimeContext {} +export interface RuntimeContext {} diff --git a/template/src/types/Exception.ts b/template/src/types/Exception.ts index 7fc4342..2a65bf9 100644 --- a/template/src/types/Exception.ts +++ b/template/src/types/Exception.ts @@ -1,13 +1,19 @@ -import { OakException } from 'oak-domain/lib/types'; -import { EntityDict } from '@project/oak-app-domain'; -import { makeException as makeGeneralException } from 'oak-general-business'; +import { OakException, OakUserException } from 'oak-domain/lib/types'; +import { EntityDict } from '@oak-app-domain'; +import makeDepedentException from './DependentExceptions'; -export class ExampleException extends OakException {} +export class ExampleException extends OakException {}; + +export class ConsoleModeIllegalException extends OakException {}; + +export class ConsoleLoadingDataException extends OakException {}; + +export class ExistsNewBidException extends OakUserException {}; export function makeException(msg: string | object) { const data = typeof msg === 'string' ? JSON.parse(msg) : msg; - const exception = makeGeneralException(data); + const exception = makeDepedentException(data); if (exception) { return exception; } diff --git a/template/wechatMp/src/app.ts b/template/wechatMp/src/app.ts index 4153754..22e21e6 100644 --- a/template/wechatMp/src/app.ts +++ b/template/wechatMp/src/app.ts @@ -5,6 +5,7 @@ import { compareVersion } from 'oak-domain/lib/utils/version'; import { sdkVersion } from './configuration'; import { features } from './initialize'; +import initializeFeatures from '@project/initializeFeatures'; export interface IAppOption { globalData: { @@ -55,11 +56,9 @@ App({ showCancel: false, }); } - // 等application初始化完成后进行登录 - await features.application.initialize(); - if (!features.token.getTokenValue()) { - await features.token.loginWechatMp(); - } + features.navigator.setNamespace('/frontend'); + + await initializeFeatures(features); }, onHide() { @@ -74,4 +73,4 @@ App({ const { reason } = rejection; exceptionHandler(reason, features); }, -}); +}); \ No newline at end of file diff --git a/templateFiles/DependentExceptions.ts b/templateFiles/DependentExceptions.ts new file mode 100644 index 0000000..d143833 --- /dev/null +++ b/templateFiles/DependentExceptions.ts @@ -0,0 +1,14 @@ +import { EntityDict } from '@project/oak-app-domain'; +import { SelectOpResult } from 'oak-domain/lib/types/Entity'; +import { makeException as makeDomainException } from 'oak-domain/lib/types/Exception'; + +export default function makeException(data: { + name: string; + message?: string; + opRecords: SelectOpResult; + [A: string]: any; +}) { + const e = makeDomainException(data); + + return e; +}