模版中新增路由设置项

This commit is contained in:
Wang Kejun 2023-10-23 17:51:23 +08:00
parent f8b8149e14
commit 2aa1bce9e3
5 changed files with 23 additions and 25 deletions

View File

@ -88,9 +88,14 @@ async function createWebBoilplate(dir, isDev, isUpdate) {
const appJsonPathWithWeb = (0, path_1.join)(dir, 'src', 'app.json');
// web项目oak.config.json路径
const oakConfigPathWithWeb = (0, path_1.join)(dir, 'src', config_1.USER_CONFIG_FILE_NAME);
// 创建小程序项目app.json
(0, file_handle_1.checkFileExistsAndCreate)(appJsonPathWithWeb, appJsonWithWeb, enum_1.checkFileExistsAndCreateType.FILE, isUpdate);
// 创建小程序项目oak.config.json
// 创建web项目app.json
// checkFileExistsAndCreate(
// appJsonPathWithWeb,
// appJsonWithWeb,
// checkFileExistsAndCreateType.FILE,
// isUpdate
// );
// 创建web项目oak.config.json
(0, file_handle_1.checkFileExistsAndCreate)(oakConfigPathWithWeb, oakConfigWithWeb, enum_1.checkFileExistsAndCreateType.FILE, isUpdate);
}
async function create(dirName, cmd) {

View File

@ -543,13 +543,7 @@ function oakConfigContentWithWeChatMp() {
exports.oakConfigContentWithWeChatMp = oakConfigContentWithWeChatMp;
function appJsonContentWithWeb(isDev) {
const pages = [
'@project/pages/store/list/index',
'@project/pages/store/upsert/index',
'@project/pages/store/detail/index',
'@project/pages/book/list/index',
'@project/pages/book/upsert/index',
'@project/pages/book/detail/index',
'@oak-general-business/pages/login/index',
'@project/pages/login/index',
];
return `{
"pages": ${JSON.stringify(pages, null, 4)}

View File

@ -156,14 +156,14 @@ async function createWebBoilplate(
// web项目oak.config.json路径
const oakConfigPathWithWeb = join(dir, 'src', USER_CONFIG_FILE_NAME);
// 创建小程序项目app.json
checkFileExistsAndCreate(
appJsonPathWithWeb,
appJsonWithWeb,
checkFileExistsAndCreateType.FILE,
isUpdate
);
// 创建小程序项目oak.config.json
// 创建web项目app.json
// checkFileExistsAndCreate(
// appJsonPathWithWeb,
// appJsonWithWeb,
// checkFileExistsAndCreateType.FILE,
// isUpdate
// );
// 创建web项目oak.config.json
checkFileExistsAndCreate(
oakConfigPathWithWeb,
oakConfigWithWeb,

View File

@ -555,13 +555,7 @@ export function oakConfigContentWithWeChatMp() {
export function appJsonContentWithWeb(isDev: boolean) {
const pages = [
'@project/pages/store/list/index',
'@project/pages/store/upsert/index',
'@project/pages/store/detail/index',
'@project/pages/book/list/index',
'@project/pages/book/upsert/index',
'@project/pages/book/detail/index',
'@oak-general-business/pages/login/index',
'@project/pages/login/index',
];
return `{
"pages": ${JSON.stringify(pages, null, 4)}

View File

@ -0,0 +1,5 @@
{
"path": "/",
"first": "/",
"notFound": "/result/404"
}