Skip to content

Commit 7c3c833

Browse files
committed
fix: vue3 template downoload optional page
1 parent c01854d commit 7c3c833

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tdesign-starter-cli",
3-
"version": "0.3.2",
3+
"version": "0.3.3",
44
"description": "CLI tool for TDesign Starter project",
55
"main": "./src/main.ts",
66
"lib": "./bin/index.js",

src/core/CoreGitDownloader.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ export class CoreGitDownloader {
1919
console.log(chalk.green('👉 开始构建,请稍侯...'));
2020
console.log();
2121
const spinner = ora('正在构建模板...').start();
22-
const { downloadUrl, url } = templates[`${options.type || 'vue2'}`];
23-
22+
const { downloadUrl, fePermissionDownloadUrl, url } = templates[`${options.type || 'vue2'}`];
23+
const executeDownloadUrl = Array.isArray(finalOptions.selectTypes) && options.type === 'vue3' ? (fePermissionDownloadUrl as string) : downloadUrl;
2424
// 清除测试目录
2525
await this.clearTestFolder();
2626

2727
// 执行下载
28-
await this.executeDownload(spinner, downloadUrl, url, options);
28+
await this.executeDownload(spinner, executeDownloadUrl, url, options);
2929

3030
// 写入后依据用户选择内容,清除部份内容
3131
let optionsFilter!: IOptionsFilter;

src/core/CoreSelector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export class CoreSelector {
109109
*
110110
* @memberOf CoreSelector
111111
*/
112-
public parseConfigSourceReact(downloadConfigSource: string): any {
112+
public parseConfigSourceReact(downloadConfigSource: string): any {
113113
// 存,存时空值判断
114114
if (downloadConfigSource) {
115115
coreTemplateReactConfig.setConfig(downloadConfigSource);

src/core/CoreTemplate.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export interface ITemplateContent {
33
url: string;
44
description: string;
55
downloadUrl: string;
6+
fePermissionDownloadUrl?: string; // 下载前端权限模型的 适用于部分模板下载场景
67
routerData: string;
78
}
89

@@ -20,6 +21,8 @@ export const templates: Record<SupportedTemplate, ITemplateContent> = {
2021
url: 'https://github.com/Tencent/tdesign-vue-next-starter.git',
2122
description: 'TDesign Vue3 Starter',
2223
downloadUrl: 'direct:https://service-5ds77c8c-1257786608.hk.apigw.tencentcs.com/release/tdesign-vue-next-starter?download=true',
24+
fePermissionDownloadUrl:
25+
'direct:https://service-5ds77c8c-1257786608.hk.apigw.tencentcs.com/release/tdesign-vue-next-starter/fe-permission?download=true',
2326
routerData: 'https://service-5ds77c8c-1257786608.hk.apigw.tencentcs.com/release/vue-next-starter-router?download=true'
2427
},
2528
react: {

0 commit comments

Comments
 (0)