diff --git a/lib/build.js b/lib/build.js index 50f0ec7..2de748a 100644 --- a/lib/build.js +++ b/lib/build.js @@ -68,6 +68,7 @@ async function build(cmd) { } } else if (target === 'web') { + const port = cmd.port; const webFileMap = { production: 'build-web.js', staging: 'build-staging-web.js', @@ -81,6 +82,7 @@ async function build(cmd) { `COMPILE_ANALYZE=${!!cmd.analyze}`, `GENERATE_SOURCEMAP=${!!cmd.sourcemap}`, `PROD=${!!cmd.prod}`, + `PORT=${port || 3000}`, !!cmd.memoryLimit && `MEMORY_LIMIT=${cmd.memoryLimit}`, `node`, cmd.memoryLimit && `--max_old_space_size=${cmd.memoryLimit}`, diff --git a/lib/index.js b/lib/index.js index da45667..6016be0 100755 --- a/lib/index.js +++ b/lib/index.js @@ -66,6 +66,7 @@ commander_1.default .option('-m, --mode ', 'mode') .option('-d, --subDir ', 'subDirName') .option('-c, --check ', 'level') + .option('-p, --port ', 'port') .description('build project of start on demand') .action(build_1.default); commander_1.default diff --git a/scripts/make-app-domain.js b/scripts/make-app-domain.js index 7f21997..aa274a9 100644 --- a/scripts/make-app-domain.js +++ b/scripts/make-app-domain.js @@ -6,20 +6,18 @@ const { buildSchema, analyzeEntities, } = require(`${process.cwd()}/node_modules/oak-domain/lib/compiler/schemalBuilder`); +const { analyzeDepedency } = require(`${process.cwd()}/node_modules/oak-domain/lib/compiler/dependencyBuilder`); // todo,这里还是很奇怪,要把src/entites的依赖给去掉 analyzeEntities(`${process.cwd()}/node_modules/oak-domain/src/entities`, 'oak-domain/lib/entities'); -// 从config中读出相应依赖 -const depConfigTsFile = join(process.cwd(), 'src', 'configuration', 'dependency.ts'); -if (existsSync(depConfigTsFile)) { - const result = ts.transpileModule(readFileSync(depConfigTsFile, 'utf-8'), { compilerOptions: { module: ts.ModuleKind.CommonJS } }); - const dependencies = eval(result.outputText); - dependencies.forEach( - (ele) => { - analyzeEntities(`${process.cwd()}/node_modules/${ele}/src/entities`, `${ele}/lib/entities`); - } - ); -} +// 分析项目依赖,并从底向上构建所有的entity +const depGraph = analyzeDepedency(process.cwd()); +const dependencies = depGraph.ascOrder; +dependencies.forEach( + (ele) => { + analyzeEntities(`${process.cwd()}/node_modules/${ele}/src/entities`, `${ele}/lib/entities`); + } +); analyzeEntities(join(process.cwd(), 'src', 'entities')); removeSync(join(process.cwd(), 'src', 'oak-app-domain')); diff --git a/src/build.ts b/src/build.ts index c964082..577e52f 100644 --- a/src/build.ts +++ b/src/build.ts @@ -91,6 +91,7 @@ export default async function build(cmd: any) { Error(`${error(`执行失败`)}`); } } else if (target === 'web') { + const port = cmd.port; const webFileMap = { production: 'build-web.js', staging: 'build-staging-web.js', @@ -106,6 +107,7 @@ export default async function build(cmd: any) { `COMPILE_ANALYZE=${!!cmd.analyze}`, `GENERATE_SOURCEMAP=${!!cmd.sourcemap}`, `PROD=${!!cmd.prod}`, + `PORT=${port || 3000}`, !!cmd.memoryLimit && `MEMORY_LIMIT=${cmd.memoryLimit}`, `node`, cmd.memoryLimit && `--max_old_space_size=${cmd.memoryLimit}`, diff --git a/src/index.ts b/src/index.ts index 19026a8..2ab3033 100644 --- a/src/index.ts +++ b/src/index.ts @@ -75,6 +75,7 @@ program .option('-m, --mode ', 'mode') .option('-d, --subDir ', 'subDirName') .option('-c, --check ', 'level') + .option('-p, --port ', 'port') .description('build project of start on demand') .action(build); program diff --git a/template/.gitignore b/template/.gitignore index 5d43ec2..2a27028 100644 --- a/template/.gitignore +++ b/template/.gitignore @@ -87,7 +87,7 @@ build .pnp.* package-lock.json -oak-app-domain +src/oak-app-domain */public/locales # 如果不自动生成allRouters,这里要注释掉 web/src/**/allRouters.ts \ No newline at end of file diff --git a/template/src/config/data.ts b/template/src/config/data.ts deleted file mode 100644 index 13e6d1a..0000000 --- a/template/src/config/data.ts +++ /dev/null @@ -1,177 +0,0 @@ - -import { CreateOperationData as Application } from '@oak-app-domain/Application/Schema'; -import { CreateOperationData as System } from '@oak-app-domain/System/Schema'; -import { CreateOperationData as Platform } from '@oak-app-domain/Platform/Schema'; -import { CreateOperationData as Domain } from '@oak-app-domain/Domain/Schema'; - -export const DEV_WECHATMP_APPLICATION_ID = 'MY_DEV_WECHATMP_APPLICATION_ID'; -export const DEV_WEB_APPLICATION_ID = 'MY_DEV_WEB_APPLICATION_ID'; -export const DEV_PUBLIC_APPLICATION_ID = 'MY_DEV_PUBLIC_APPLICATION_ID'; -export const DEV_WECHATPUPLIC_APPLICATION_ID = 'MY_DEV_WECHATPUPLIC_APPLICATION_ID'; -export const DEV_DOMAIN_ID = 'MY_DEV_DOMAIN_ID'; -export const DEV_SYSTEM_ID = 'MY_DEV_SYSTEM_ID'; - -const SUPER_SYSTEM_ID = 'SUPER_SYSTEM_ID'; -const SUPER_WEB_APPLICATION_ID = 'SUPER_WEB_APPLICATION_ID'; -const SUPER_DOMAIN_ID = 'SUPER_DOMAIN_ID'; - -/** - * 配置系统相关的初始化数据 - */ -export const application: Application[] = [ - { - id: DEV_WECHATMP_APPLICATION_ID, - name: 'wechatMp', - type: 'wechatMp', - systemId: DEV_SYSTEM_ID, - config: { - type: 'wechatMp', - appId: '', - appSecret: '', - }, - description: '小程序应用,指向dev_system', - }, - { - id: DEV_WEB_APPLICATION_ID, - name: '测试web', - type: 'web', - systemId: DEV_SYSTEM_ID, - config: { - type: 'web', - passport: ['email', 'mobile', 'wechat'], - }, - description: 'web应用,指向dev_system', - }, - { - id: DEV_PUBLIC_APPLICATION_ID, - name: '测试public', - type: 'wechatPublic', - systemId: DEV_SYSTEM_ID, - config: { - type: 'wechatPublic', - isService: true, - appId: 'wx850874243dbcb34a', - appSecret: '6fae672615730c0c1ea58e83621ad7c9', - }, - description: 'public应用,指向dev_system', - }, - { - /** * - * 线上第一个web应用,请根据应用情况配置 - * */ - id: SUPER_WEB_APPLICATION_ID, - name: '线上', - type: 'web', - systemId: SUPER_SYSTEM_ID, - config: { - type: 'web', - passport: ['mobile', 'wechat'], - }, - description: '线上网站', - }, -]; - -export const system: System[] = [ - { - // 测试用系统,可将自己申请相应的服务帐号填在这里,用于开发过程 - id: DEV_SYSTEM_ID, - name: '测试系统', - description: '测试系统', - config: { - Map: { - amap: { - webApiKey: '', - }, - }, - Cos: { - qiniu: { - accessKey: '', - buckets: [ - { - zone: 'z0', - name: '', - domain: '', - protocol: 'http', - }, - ], - defaultBucket: '', - }, - }, - Live: { - qiniu: { - accessKey: '', - liveHost: '', // 七牛直播云接口 - publishDomain: '', // rtmp - playDomain: '', // rtmp - hub: '', - publishKey: '', - playKey: '', - playBackDomain: '', - }, - }, - Account: { - qiniu: [ - { - accessKey: '', - secretKey: '', - }, - ], - }, - App: {}, - }, - super: true, - folder: 'test', - style: { - color: { - primary: 'red', - }, - }, - }, - { - /** - * 线上真实系统,请勿将敏感帐号填在这里,上线后在系统中配置 - * */ - id: SUPER_SYSTEM_ID, - name: '线上系统', - description: '线上系统', - config: { - App: {}, - }, - super: true, - folder: 'test', - style: { - color: { - primary: 'red', - }, - }, - }, -]; - -export const domain: Domain[] = [ - { - id: DEV_DOMAIN_ID, - protocol: 'http', - url: 'localhost', - port: 3001, - systemId: DEV_SYSTEM_ID, - }, - { - /** - * 线上真实域名,此信息必须在应用启动前初始化,否则系统无法访问 - * */ - id: SUPER_DOMAIN_ID, - protocol: 'https', - url: 'test.com', - port: 443, - apiPath: '/rest/aspect', - systemId: SUPER_SYSTEM_ID, - }, -]; - - - -export const data = { - application, - system, - domain, -}; \ No newline at end of file diff --git a/template/src/context/BackendRuntimeContext.ts b/template/src/context/BackendRuntimeContext.ts index ba8af12..e52e6bf 100644 --- a/template/src/context/BackendRuntimeContext.ts +++ b/template/src/context/BackendRuntimeContext.ts @@ -2,7 +2,7 @@ import { EntityDict } from '@project/oak-app-domain'; import { RuntimeContext } from './RuntimeContext'; import { BackendRuntimeContext as DependentBackendRuntimeContext } from './DependentContext'; -export class BackendRuntimeContext extends DependentFrontendRuntimeContext implements RuntimeContext { +export class BackendRuntimeContext extends DependentBackendRuntimeContext implements RuntimeContext { async toString() { const data = await this.getSerializedData(); return JSON.stringify(data); diff --git a/template/src/data/index.ts b/template/src/data/index.ts index 2701404..510e8ec 100644 --- a/template/src/data/index.ts +++ b/template/src/data/index.ts @@ -1,19 +1,13 @@ -import { application, system, domain } from '../config/data'; import { relations } from '@project/oak-app-domain/Relation'; import actionAuth from './actionAuth'; import relationAuth from './relationAuth'; import path from './path'; import i18n from './i18n'; -const data = { - application, - system, - domain, +export default { relation: relations, actionAuth, relationAuth, path, i18n, }; - -export default data; diff --git a/template/typings/index.d.ts b/template/typings/index.d.ts index a0275b8..a471ae4 100644 --- a/template/typings/index.d.ts +++ b/template/typings/index.d.ts @@ -1,6 +1,5 @@ -/// +/// declare global { - const XC: number; } \ No newline at end of file diff --git a/template/web/public/index.html b/template/web/public/index.html index 37817b2..4a44aa1 100644 --- a/template/web/public/index.html +++ b/template/web/public/index.html @@ -81,7 +81,7 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> - oak template project + diff --git a/template/web/src/App.tsx b/template/web/src/App.tsx index 0ed5052..db9d8af 100644 --- a/template/web/src/App.tsx +++ b/template/web/src/App.tsx @@ -4,15 +4,14 @@ import './App.less'; import AppContainer from './AppContainer'; import AppRouter from './AppRouter'; import AppError from './AppError'; -import { Folder } from './routers'; -function App(props: { folder: Folder; error?: any }) { +function App(props: { error?: any }) { if (props.error) { return ; } return ( - + ); } diff --git a/template/web/src/AppRouter.tsx b/template/web/src/AppRouter.tsx index 9d38dc5..d58fdd1 100644 --- a/template/web/src/AppRouter.tsx +++ b/template/web/src/AppRouter.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Routes, Route, Outlet, useLocation } from 'react-router-dom'; import { IRouter, IBrowserRouterProps, IMeta } from './types/router'; -import routers, { Folder } from './routers'; +import routers from './app/routers'; import Loading from './components/Loading'; import useFeatures from '@project/hooks/useFeatures'; @@ -92,8 +92,8 @@ const Guard = React.memo( } ); -const AppRouter = React.memo((props: { folder: Folder }) => ( - {renderRoutes(routers[props.folder])} +const AppRouter = React.memo(() => ( + {renderRoutes(routers)} )); export default AppRouter; diff --git a/template/web/src/app/components/consoleHeader/index.ts b/template/web/src/app/components/consoleHeader/index.ts new file mode 100644 index 0000000..2e6b8c4 --- /dev/null +++ b/template/web/src/app/components/consoleHeader/index.ts @@ -0,0 +1,51 @@ +export default OakComponent({ + isList: false, + formData({ features }) { + const loggedIn = !!features.token.getUserId(true); + const user = loggedIn && features.token.getUserInfo()!; + + const { extraFile$entity } = user || {}; + const [extraFile] = extraFile$entity || []; + const avatar = extraFile && features.extraFile.getUrl(extraFile); + const mode = features.console.getMode(); + let modeTitle = '' as string | undefined; + if (mode === 'supplier') { + const supplierId = features.console.getSupplierId(); + const [supplier] = features.cache.get('supplier', { + data: { + id: 1, + name: 1, + }, + filter: { + id: supplierId, + } + }); + modeTitle = supplier?.name; + } + else if (mode === 'systemProvider') { + const spId = features.console.getSystemProviderId(); + const [systemProvider] = features.cache.get('systemProvider', { + data: { + id: 1, + name: 1, + }, + filter: { + id: spId, + } + }); + modeTitle = systemProvider?.name; + } + + return { + loggedIn, + avatar, + modeTitle, + }; + }, + features: ['token', 'console'], + methods: { + logout() { + return this.features.token.logout(); + } + }, +}) \ No newline at end of file diff --git a/template/web/src/app/components/consoleHeader/locales/zh_CN.json b/template/web/src/app/components/consoleHeader/locales/zh_CN.json new file mode 100644 index 0000000..edd2f93 --- /dev/null +++ b/template/web/src/app/components/consoleHeader/locales/zh_CN.json @@ -0,0 +1 @@ +{"name":"Oak模板项目", "close": "关闭"} \ No newline at end of file diff --git a/template/web/src/app/components/consoleHeader/web.pc.module.less b/template/web/src/app/components/consoleHeader/web.pc.module.less new file mode 100644 index 0000000..c454b12 --- /dev/null +++ b/template/web/src/app/components/consoleHeader/web.pc.module.less @@ -0,0 +1,18 @@ +.header { + height: 64px; + padding: 4px; + width: 100%; + background-color: white; + display: flex; + justify-content: space-between; + align-items: center; + + .home { + font-size: 22px; + font-weight: bold; + } + + .right{ + margin-right: 16px; + } +} diff --git a/template/web/src/app/components/consoleHeader/web.pc.tsx b/template/web/src/app/components/consoleHeader/web.pc.tsx new file mode 100644 index 0000000..8e208e0 --- /dev/null +++ b/template/web/src/app/components/consoleHeader/web.pc.tsx @@ -0,0 +1,60 @@ +import React, { useState } from 'react'; +import { EntityDict } from '@project/oak-app-domain'; +import { WebComponentProps } from 'oak-frontend-base'; +import { useLocation } from 'react-router-dom'; +import { Row, Modal, Button } from 'antd'; +import { DownOutlined, UserOutlined } from '@ant-design/icons'; +import Styles from './web.pc.module.less'; + +export default function Render(props: WebComponentProps< + EntityDict, + 'user', + false, + { + loggedIn: boolean; + avatar?: string; + modeTitle?: string; + }, + { + } +>) { + const { modeTitle, avatar } = props.data; + const { t, navigateTo } = props.methods; + const location = useLocation(); + const [open, setOpen] = useState(false); + + return ( + + +
+ +
+
+ ); +} \ No newline at end of file diff --git a/template/web/src/app/components/consoleHeader/web.tsx b/template/web/src/app/components/consoleHeader/web.tsx new file mode 100644 index 0000000..405715c --- /dev/null +++ b/template/web/src/app/components/consoleHeader/web.tsx @@ -0,0 +1,5 @@ +import React from 'react'; + +export default function Render() { + return null; +} \ No newline at end of file diff --git a/template/web/src/app/namespaces/console/index.tsx b/template/web/src/app/namespaces/console/index.tsx new file mode 100644 index 0000000..5a824d8 --- /dev/null +++ b/template/web/src/app/namespaces/console/index.tsx @@ -0,0 +1,108 @@ + +import React, { useEffect, useState } from 'react'; +import { Routes, Route, Outlet, useLocation } from 'react-router-dom'; +import Header from '../../components/consoleHeader'; +import Styles from './web.pc.module.less'; +import useFeatures from '@project/hooks/useFeatures'; +import Menu from '@project/components/console/menu'; +import { useWidth } from 'oak-frontend-base/es/platforms/web'; + +function Console(props: { namespace: string }) { + const { namespace } = props; + const features = useFeatures(); + const [currentMenuPath, setCmp] = useState(''); + const [title, setTitle] = useState(''); + + const width = useWidth(); + const location = useLocation(); + const { pathname } = location; + const path = pathname.slice(namespace.length); + const showBack = currentMenuPath && currentMenuPath !== path; + const isRoot = features.token.isRoot(); + // const mode = features.console.getMode(true); + const [mode, setMode] = useState(features.console.getMode(true)); + const getTitleFromLocale = () => { + const location = window.location; + const { pathname } = location; + const path = pathname.slice(namespace.length); + const i18nNs = `taicang-p-console-${path.startsWith('/') ? path.slice(1).replaceAll(/\//g, '-') : path.replaceAll(/\//g, '-')}`; + const pageTitle = features.locales.t('pageTitle', { + '#oakNamespace': i18nNs, + }); + return pageTitle === 'pageTitle' ? '' : pageTitle; + } + + useEffect(() => { + features.navigator.setNamespace(namespace); + features.console.initialize(); + const location = window.location; + const { pathname } = location; + const path2 = pathname.slice(namespace.length); + setCmp(path2); + const tt = getTitleFromLocale(); + setTitle(tt); + const unsubscribe = features.locales.subscribe( + () => { + const tt = getTitleFromLocale(); + setTitle(tt); + } + ); + const unModeSubscribe = features.console.subscribe( + () => { + const newMode = features.console.getMode(); + setMode(newMode); + } + ) + return () => { + unsubscribe(); + unModeSubscribe(); + features.console.destroy(); + }; + }, []); + + useEffect(() => { + const tt = getTitleFromLocale(); + setTitle(tt); + }, [path]); + + // const showOpenStoreBtn = !isRoot && !mode && pathname === '/console'; + const [showOpenStore, setShowOpenStore] = useState(true); + useEffect(() => { + if (mode || isRoot) { + setShowOpenStore(false); + } else { + setShowOpenStore(true); + } + }, [mode, isRoot]) + return ( +
+
+
+
+
+ setCmp(path)} + /> +
+ {/* */} + {showOpenStore ? ( +
+ 请您先, + { + features.navigator.navigateTo({ + url: '/spContractApplyment/upsert' + }, {}, true) + }}> + 开通店铺 + +
+ ) : } + {/*
*/} +
+
+
+ ); +} + +export default Console; \ No newline at end of file diff --git a/template/web/src/app/namespaces/console/web.pc.module.less b/template/web/src/app/namespaces/console/web.pc.module.less new file mode 100644 index 0000000..cded5b8 --- /dev/null +++ b/template/web/src/app/namespaces/console/web.pc.module.less @@ -0,0 +1,40 @@ +.container { + width: 100%; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: stretch; + background-color: var(--oak-bg-color-page); + + .header { + margin-bottom: 2px; + position: sticky; + z-index: 1000; + top: 0px; + } + + .body { + flex: 1; + display: flex; + flex-direction: row; + + // align-items: flex-start; + .content { + // align-self: stretch; + margin-left: 1px; + flex: 1; + } + } +} + +.nullRelContainer { + display: flex; + flex: 1; + align-items: center; + justify-content: center; +} + +.openStore { + cursor: pointer; + color: var(--oak-color-primary-light); +} \ No newline at end of file diff --git a/template/web/src/app/test/namespaces/frontend/index.json b/template/web/src/app/namespaces/frontend/index.json similarity index 100% rename from template/web/src/app/test/namespaces/frontend/index.json rename to template/web/src/app/namespaces/frontend/index.json diff --git a/template/web/src/app/test/namespaces/frontend/index.tsx b/template/web/src/app/namespaces/frontend/index.tsx similarity index 100% rename from template/web/src/app/test/namespaces/frontend/index.tsx rename to template/web/src/app/namespaces/frontend/index.tsx diff --git a/template/web/src/app/test/router/allRoutersTemplate.ts b/template/web/src/app/routers/allRoutersTemplate.ts similarity index 78% rename from template/web/src/app/test/router/allRoutersTemplate.ts rename to template/web/src/app/routers/allRoutersTemplate.ts index 6db0ad0..2a314cd 100644 --- a/template/web/src/app/test/router/allRoutersTemplate.ts +++ b/template/web/src/app/routers/allRoutersTemplate.ts @@ -1,5 +1,5 @@ "use oak router builder"; // 这行备注说明是用oak的router builder来生成allRouters import React from 'react'; -import { IRouter } from '../../../types/router'; +import { IRouter } from '../../types/router'; let allRouters: IRouter[] = []; export default allRouters; diff --git a/template/web/src/app/test/router/index.ts b/template/web/src/app/routers/index.ts similarity index 100% rename from template/web/src/app/test/router/index.ts rename to template/web/src/app/routers/index.ts diff --git a/template/web/src/app/test/namespaces/console/index.tsx b/template/web/src/app/test/namespaces/console/index.tsx deleted file mode 100644 index ff45739..0000000 --- a/template/web/src/app/test/namespaces/console/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ - -import React from 'react'; -import { useNavigate, useParams, useSearchParams, useLocation } from 'react-router-dom'; -import { Routes, Route, Outlet } from 'react-router-dom'; - - -function Console() { - return ( - - ); -} - -export default Console; \ No newline at end of file diff --git a/template/web/src/index.tsx b/template/web/src/index.tsx index b4f5b6d..489d8ea 100644 --- a/template/web/src/index.tsx +++ b/template/web/src/index.tsx @@ -45,10 +45,6 @@ const init = async () => { } catch (err) { error = err; } - - const application = features.application.getApplication(); - const folder = application?.system?.folder; - // 抓到异常处理 1、token过期 2、网络断了 3、接口请求失败 root.render( @@ -64,7 +60,7 @@ const init = async () => { legacyLogicalPropertiesTransformer, ]} > - + diff --git a/template/web/src/oak.config.json b/template/web/src/oak.config.json new file mode 100644 index 0000000..bb417b6 --- /dev/null +++ b/template/web/src/oak.config.json @@ -0,0 +1,4 @@ +{ + "theme": { + } +} \ No newline at end of file diff --git a/template/web/src/routers.ts b/template/web/src/routers.ts deleted file mode 100644 index 01082e4..0000000 --- a/template/web/src/routers.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { IRouter } from './types/router'; - -export type Folder = 'test'; -export type Routers = Record; - -import testAllRouters from './app/test/router'; - -export const routers: Routers = { - test: testAllRouters, -}; - -export default routers; diff --git a/templateFiles/SystemProvider.ts b/templateFiles/SystemProvider.ts new file mode 100644 index 0000000..035dd8b --- /dev/null +++ b/templateFiles/SystemProvider.ts @@ -0,0 +1,36 @@ +import { + String, + Text, + Price +} from 'oak-domain/lib/types/DataType'; +import { EntityShape } from 'oak-domain/lib/types/Entity'; +import { Schema as System } from 'oak-general-business/lib/entities/System'; +import { Schema as ArticleMenu } from 'oak-general-business/lib/entities/ArticleMenu'; +import { EntityDesc } from 'oak-domain/lib/types'; + +export interface Schema extends EntityShape { + name: String<32>; + system: System; + systems?: System[]; + articleMenus?: ArticleMenu[]; +}; + +export type Relation = 'owner' | 'manager'; + +const entityDesc: EntityDesc = { + locales: { + zh_CN: { + name: '系统供应商', + attr: { + name: '名称', + system: '系统', + systems: '系统', + articleMenus: '文章分类', + }, + r: { + owner: '所有者', + manager: '管理员', + }, + }, + } +} \ No newline at end of file diff --git a/templateFiles/allRouters.ts b/templateFiles/allRouters.ts index 6db0ad0..2a314cd 100644 --- a/templateFiles/allRouters.ts +++ b/templateFiles/allRouters.ts @@ -1,5 +1,5 @@ "use oak router builder"; // 这行备注说明是用oak的router builder来生成allRouters import React from 'react'; -import { IRouter } from '../../../types/router'; +import { IRouter } from '../../types/router'; let allRouters: IRouter[] = []; export default allRouters; diff --git a/template/typings/polyfill.d.ts b/templateFiles/polyfill.d.ts similarity index 78% rename from template/typings/polyfill.d.ts rename to templateFiles/polyfill.d.ts index 14c0fb0..bd6a328 100644 --- a/template/typings/polyfill.d.ts +++ b/templateFiles/polyfill.d.ts @@ -1,7 +1,4 @@ -import { GenerateIdOption } from '@project/utils/polyfill'; -import { - MakeOakComponent, -} from 'oak-general-business'; +import { MakeOakComponent } from 'oak-frontend-base'; import { EntityDict } from '@oak-app-domain'; import { AspectDict } from '@project/aspects/AspectDict'; import { FeatureDict } from '@project/features'; @@ -16,7 +13,6 @@ declare global { AspectDict, FeatureDict >; - const Aliplayer: any; const features: FeatureDict; } export {};