feat(admin): 更新runtime
This commit is contained in:
@@ -35,7 +35,7 @@ export enum PageStatus {
|
||||
export const StaticPath = {
|
||||
ASSETS: path.resolve(__dirname, '../../assets'),
|
||||
TEMPLATE: path.resolve(__dirname, '../template'),
|
||||
RUNTIME: path.resolve(__dirname, '../../runtime'),
|
||||
STATIC: path.resolve(__dirname, '../../static'),
|
||||
PUBLISH: path.resolve(__dirname, '../../assets/publish'),
|
||||
};
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ router.get('/', async (ctx) => {
|
||||
await send(ctx, `${StaticPath.ASSETS}/index.html`, options);
|
||||
});
|
||||
|
||||
router.get('/runtime/*', async (ctx) => {
|
||||
const file = `${StaticPath.RUNTIME}/${ctx.params[0]}`;
|
||||
router.get('/static/*', async (ctx) => {
|
||||
const file = `${StaticPath.STATIC}/${ctx.params[0]}`;
|
||||
if (pathExistsSync(file)) {
|
||||
await send(ctx, file, options);
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ const publishHtml = (pageConfig: DivideConfigTrans) => {
|
||||
try {
|
||||
// 复制html模板
|
||||
const distHtml = `${StaticPath.PUBLISH}/${pageName}.html`;
|
||||
const tmpHtml = `${StaticPath.RUNTIME}/page.html`;
|
||||
const tmpHtml = `${StaticPath.STATIC}/vue3/runtime/page/index.html`;
|
||||
copySync(tmpHtml, distHtml);
|
||||
// 注入活动配置文件
|
||||
const configScript = `<script type='module' src='./uiconfig_${pageName}.js'></script>\n\t${UiRuntimeJS}`;
|
||||
|
||||
Reference in New Issue
Block a user