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

feat:添加插件市场分类

上级 e37e20c5
......@@ -7,31 +7,23 @@ export default {
),
getPlugins: path =>
axios.get(
`https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/tree?ref=dev&path=${path}`
`https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/tree?ref=master&path=${path}`
),
getMenu: () =>
axios.get(
"https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/tree?path=plugins&ref=dev"
"https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/tree?path=plugins&ref=master"
),
getLogo: plugin =>
`https://gitlab.com/layyback/quicker-market/-/raw/master/plugins/${plugin.name}/${plugin.logo}`,
`https://gitlab.com/layyback/quicker-market/-/raw/master/${plugin.path}/${plugin.logo}`,
getReadme: plugin =>
axios.get(
`https://gitlab.com/layyback/quicker-market/-/raw/master/plugins/${plugin.name}/${plugin.detail}`
`https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/files/${plugin.path}%2F${plugin.detail}/raw?ref=master`
),
getDownloadUrl: plugin =>
`https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/archive.zip?path=plugins%2F${plugin.name}`,
getPluginDetail: pluginName =>
getPluginDetail: pluginPath =>
axios.get(
`https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/files/plugins%2F${pluginName}%2Fplugin.json/raw?ref=master`
`https://gitlab.com/api/v4/projects/layyback%2Fquicker-market/repository/files/${pluginPath}%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`
// )
};
......@@ -161,13 +161,16 @@ export default {
api.getPlugins(path).then(async ({ data: res }) => {
this.pluginList = [];
res.forEach(async plugin => {
const pluginItem = await this.getPluginDetail(plugin.name);
const pluginItem = await this.getPluginDetail(
encodeURIComponent(plugin.path)
);
this.pluginList.push(pluginItem);
});
});
},
async getPluginDetail(name) {
const { data: plugin } = await api.getPluginDetail(name);
async getPluginDetail(path) {
const { data: plugin } = await api.getPluginDetail(path);
plugin.path = path
if (plugin.detail && isMdFile(plugin.detail)) {
const { readme } = await api.getReadme(plugin);
plugin.readme = readme;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册