提交 efa0778d 编写于 作者: 璃白.'s avatar 璃白. 🌻

feat:修改插件下载接口

上级 d024ae72
......@@ -5,17 +5,20 @@ export default {
axios.get(
"https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker/releases"
),
// getPlugins: () => axios.get("/")
getPlugins: () =>
axios.get(
"https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker-market/repository/tree?path=plugins"
"https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/tree?path=plugins"
),
getPluginDetail: pluginName =>
axios.get(
`https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker-market/repository/files/plugins%2F${pluginName}%2Fplugin.json/raw?ref=master`
),
getZipPathOfPlugin: () =>
axios.get(
`https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker-market/repository/archive.zip`
`https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/files/plugins%2F${pluginName}%2Fplugin.json/raw?ref=master`
)
// getPlugins: () =>
// axios.get(
// "https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker-market/repository/tree?path=plugins"
// ),
// getPluginDetail: pluginName =>
// axios.get(
// `https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker-market/repository/files/plugins%2F${pluginName}%2Fplugin.json/raw?ref=master`
// )
};
......@@ -72,7 +72,7 @@ async function downloadZip(downloadRepoUrl, name) {
}
async function downloadZipFromGitCode(downloadRepoUrl, name) {
try {
const plugin_path = appPath;
const plugin_path = `${appPath}/quicker-plugins`;
// 基础模版所在目录,如果是初始化,则是模板名称,否则是项目名称
const temp_dest = `${plugin_path}/${name}`;
// 下载模板
......
......@@ -99,97 +99,11 @@ export default {
pluginList: [],
loading: {},
bannerList: [],
downloadPath: "",
show: false,
currentSelect: {}
};
},
async created() {
// const [result, bannerRes] = await Promise.all([
// api.plugin.query(),
// api.banner.query(),
// ]);
// this.pluginList = result.result;
// this.pluginList = [
// {
// pluginName: "日报",
// name: "日报",
// author: "璃白",
// detail: "# md",
// description: "gitcode团队日报",
// logo: "https://infinityicon.infinitynewtab.com/user-share-icon/6e49210c084629259f22609980c48ecf.png?imageMogr2/thumbnail/240x/format/webp/blur/1x0/quality/100|imageslim",
// downloadUrl:
// "https://quicker-1253693946.cos.ap-beijing.myqcloud.com/plugins/report.zip"
// },
// {
// pluginName: "微信",
// name: "微信",
// author: "璃白",
// detail: "# weixin",
// description: "微信网页版",
// logo: "https://infinityicon.infinitynewtab.com/user-share-icon/2fc65bd66987ba1596324d55c01bddd7.png?imageMogr2/thumbnail/240x/format/webp/blur/1x0/quality/100|imageslim",
// downloadUrl:
// "https://quicker-1253693946.cos.ap-beijing.myqcloud.com/plugins/weixin.zip"
// },
// {
// pluginName: "博客",
// name: "博客",
// author: "璃白",
// detail: "# blog",
// description: "CSDN博客离线版",
// logo: "https://gitcode.net/codechina/operation-work/uploads/48886bea190eb24ef4cf0499e589554c/1_cpongo9_1634797583.gif",
// downloadUrl:
// "https://quicker-1253693946.cos.ap-beijing.myqcloud.com/plugins/blog.zip"
// },
// {
// pluginName: "提问",
// name: "提问",
// author: "璃白",
// detail: "# ask",
// description: "CSDN问答",
// logo: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic.51yuansu.com%2Fpic2%2Fcover%2F00%2F40%2F87%2F581336a807c58_610.jpg&refer=http%3A%2F%2Fpic.51yuansu.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1642296911&t=4197c2560e18ac6b625d5d4b4cc3ece8",
// downloadUrl:
// "https://quicker-1253693946.cos.ap-beijing.myqcloud.com/plugins/ask.zip"
// },
// {
// pluginName: "计算器",
// name: "计算器",
// author: "璃白",
// detail: "# 计算器",
// description: "计算器网页版",
// logo: "http://mms1.baidu.com/it/u=1258866987,457977032&fm=253&app=138&f=JPEG&fmt=auto&q=75?w=500&h=500",
// downloadUrl:
// "https://quicker-1253693946.cos.ap-beijing.myqcloud.com/plugins/calc.zip"
// },
// {
// pluginName: "md编辑器",
// name: "md编辑器",
// author: "璃白",
// detail: "# md",
// description:
// "由 gitcode 技术团队开发的一款Markdown编辑器,支持使用markodwn语法来编写文档,同时支持图片上传等功能。",
// logo: "https://gitcode.net/uploads/-/system/project/avatar/43664/2111050605131483.png",
// downloadUrl:
// "https://quicker-1253693946.cos.ap-beijing.myqcloud.com/plugins/md.zip"
// },
// {
// pluginName: "qrcode",
// name: "qrcode",
// description: "二维码识别",
// logo: "https://gitcode.net/codechina/operation-work/uploads/03cd9d3883254d315ba0aeca5643c65c/logo.png",
// downloadUrl:
// "https://quicker-1253693946.cos.ap-beijing.myqcloud.com/plugins/qrcode.zip"
// },
// {
// pluginName: "toolsfun",
// name: "toolsfun",
// description: "toolfun工具箱",
// logo: "http://mms1.baidu.com/it/u=4045568405,1871612257&fm=253&app=138&f=JPG&fmt=auto&q=75?w=500&h=500",
// downloadUrl:
// "https://quicker-1253693946.cos.ap-beijing.myqcloud.com/plugins/toolsfun.zip"
// }
// ];
this.getPlugins();
// this.bannerList = bannerRes.result;
},
......@@ -209,9 +123,11 @@ export default {
} = await api.getPluginDetail(plugin.name);
plugin.pluginName = pluginName;
plugin.description = description;
plugin.logo = `https://gitcode.net/weixin_43881430/quicker-market/-/raw/master/plugins/${plugin.name}/${logo}`;
plugin.downloadUrl =
"https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker-market/repository/archive.zip";
plugin.logo = `https://gitlab.com/layyback/quicker-market/-/raw/master/plugins/${plugin.name}/${logo}`;
// plugin.logo = `https://gitcode.net/weixin_43881430/quicker-market/-/raw/master/plugins/${plugin.name}/${logo}`;
plugin.downloadUrl = `https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/archive.zip?path=plugins%2F${plugin.name}`;
// plugin.downloadUrl =
// "https://gitcode.net/api/v4/projects/weixin_43881430%2Fquicker-market/repository/archive.zip";
console.log(plugin);
return plugin;
......@@ -226,9 +142,6 @@ export default {
}
this.$set(this.loading, index, false);
},
async getZipPathOfPlugin() {
this.downloadPath = await api.getZipPathOfPlugin();
},
showButton(item) {
return !this.devPlugins.filter(
plugin => plugin.name === item.name && plugin.type === "prod"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册