bugfix: 修复 安装包下载

This commit is contained in:
muwoo
2021-06-30 15:20:30 +08:00
parent 0624be2d57
commit 96268de9d8
5 changed files with 16 additions and 63 deletions

View File

@@ -3,7 +3,6 @@ import { v4 as uuidv4 } from 'uuid';
import {
getWindowHeight,
searchKeyValues,
downloadFunc,
sysFile,
mergePlugins,
find,
@@ -221,8 +220,9 @@ const actions = {
});
},
async downloadPlugin({commit}, payload) {
await downloadZip(payload.gitUrl, payload.name);
const fileUrl = find(path.join(__static, `plugins/${payload.name}-master`));
const distUrl = await downloadZip(payload.downloadUrl, payload.name);
const fileUrl = find(distUrl);
// 复制文件
const config = JSON.parse(fs.readFileSync(`${fileUrl}/plugin.json`, 'utf-8'));
const pluginConfig = {