diff --git a/api/v2/all.api.js b/api/v2/all.api.js index 2720416..8707f54 100644 --- a/api/v2/all.api.js +++ b/api/v2/all.api.js @@ -1,246 +1,295 @@ /** * 所有的接口 */ -import {getPersonalToken} from '@/utils/token.js' +import { + getPersonalToken +} from '@/utils/token.js' import HttpHandler from '@/common/http/request.js' import qs from 'qs' -import {getAppConfigs} from '@/config/index.js' +import { + getAppConfigs +} from '@/config/index.js' export default { - /** - * 获取文章列表 - * @param {Object} params 参数 - */ - getPostList: (params) => { - return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/posts`, params) - }, - - /** - * 根据名称获取文章 - * @param {String} name 分类名称 - */ - getPostByName: (name) => { - return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/posts/${name}`, {}, { - header: { - 'Wechat-Session-Id': uni.getStorageSync('openid'), - } - }) - }, - - /** - * 搜索文章 - * @param {Object} params 数据 - */ - getPostListByKeyword: (params) => { - // return HttpHandler.Get(`/apis/api.halo.run/v1alpha1/indices/post`, params) - return HttpHandler.Post(`/apis/api.halo.run/v1alpha1/indices/-/search`, params) - }, - - /** - * 查询分类列表 - * @param {Object} params 查询参数 - */ - getCategoryList: (params) => { - const param = qs.stringify(params, { - allowDots: true, - encodeValuesOnly: true, - skipNulls: true, - encode: false, - arrayFormat: 'repeat' - }) - return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/categories?${param}`, {}) - }, - /** - * 查询分类下的文章 - * @param {String} name 分类名称 - * @param {Object} params 查询参数 - */ - getCategoryPostList: (name, params) => { - return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/categories/${name}/posts`, params) - }, - - - /** - * 获取评论列表接口(列表数据) - * @param {Object} params 查询参数 - */ - getPostCommentList: (params) => { - return HttpHandler.Get(`/apis/api.halo.run/v1alpha1/comments`, params) - }, - - /** - * 获取回复列表 - * @param {String} commentName 名称 - * @param {Object} params 查询参数 - */ - getPostCommentReplyList: (commentName, params) => { - return HttpHandler.Get(`/apis/api.halo.run/v1alpha1/comments/${commentName}/reply`, params) - }, - - // 提交评论 - addPostComment: (data) => { - return HttpHandler.Post(`/apis/api.halo.run/v1alpha1/comments`, data) - }, - // 提交回复 - addPostCommentReply: (commentName, data) => { - return HttpHandler.Post(`/apis/api.halo.run/v1alpha1/comments/${commentName}/reply`, data) - }, - - /** - * 获取标签列表 - * @param {Object} params 查询参数 - */ - getTagList: (params) => { - return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/tags`, params) - }, - - /** - * 根据标签获取文章列表 - * @param {String} tagName 参数 - * @param {Object} params 查询参数 - */ - getPostByTagName: (tagName, params) => { - return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/tags/${tagName}/posts`, params) - }, - - /** - * 获取瞬间列表 - */ - getMomentList: (params) => { - return HttpHandler.Get(`/apis/moment.halo.run/v1alpha1/moments`, params, { - custom: { - personalToken: getPersonalToken() - } - }) - }, - /** - * 获取瞬间详情 - * @param {String} name 瞬间id + * 获取文章列表 + * @param {Object} params 参数 */ - getMomentByName: (name) => { - return HttpHandler.Get(`/apis/moment.halo.run/v1alpha1/moments/${name}`, {}, { - custom: { - personalToken: getPersonalToken() - } - }) + getPostList: (params) => { + return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/posts`, params) }, - /** - * 查询站点统计信息 - */ - getBlogStatistics: () => { - return HttpHandler.Get(`/apis/api.halo.run/v1alpha1/stats/-`, {}) - }, + /** + * 根据名称获取文章 + * @param {String} name 分类名称 + */ + getPostByName: (name) => { + return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/posts/${name}`, {}, { + header: { + 'Wechat-Session-Id': uni.getStorageSync('openid'), + } + }) + }, + + /** + * 搜索文章 + * @param {Object} params 数据 + */ + getPostListByKeyword: (params) => { + // return HttpHandler.Get(`/apis/api.halo.run/v1alpha1/indices/post`, params) + return HttpHandler.Post(`/apis/api.halo.run/v1alpha1/indices/-/search`, params) + }, + + /** + * 查询分类列表 + * @param {Object} params 查询参数 + */ + getCategoryList: (params) => { + const param = qs.stringify(params, { + allowDots: true, + encodeValuesOnly: true, + skipNulls: true, + encode: false, + arrayFormat: 'repeat' + }) + return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/categories?${param}`, {}) + }, + /** + * 查询分类下的文章 + * @param {String} name 分类名称 + * @param {Object} params 查询参数 + */ + getCategoryPostList: (name, params) => { + return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/categories/${name}/posts`, params) + }, - /** - * 获取相册分组 - */ - getPhotoGroupList: (params) => { - return HttpHandler.Get(`/apis/core.halo.run/v1alpha1/photogroups`, params, { - custom: { - personalToken: getPersonalToken() - } - }) - }, + /** + * 获取评论列表接口(列表数据) + * @param {Object} params 查询参数 + */ + getPostCommentList: (params) => { + return HttpHandler.Get(`/apis/api.halo.run/v1alpha1/comments`, params) + }, + + /** + * 获取回复列表 + * @param {String} commentName 名称 + * @param {Object} params 查询参数 + */ + getPostCommentReplyList: (commentName, params) => { + return HttpHandler.Get(`/apis/api.halo.run/v1alpha1/comments/${commentName}/reply`, params) + }, + + // 提交评论 + addPostComment: (data) => { + return HttpHandler.Post(`/apis/api.halo.run/v1alpha1/comments`, data) + }, + // 提交回复 + addPostCommentReply: (commentName, data) => { + return HttpHandler.Post(`/apis/api.halo.run/v1alpha1/comments/${commentName}/reply`, data) + }, + + /** + * 获取标签列表 + * @param {Object} params 查询参数 + */ + getTagList: (params) => { + return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/tags`, params) + }, + + /** + * 根据标签获取文章列表 + * @param {String} tagName 参数 + * @param {Object} params 查询参数 + */ + getPostByTagName: (tagName, params) => { + return HttpHandler.Get(`/apis/api.content.halo.run/v1alpha1/tags/${tagName}/posts`, params) + }, + + /** + * 获取瞬间列表 + */ + getMomentList: (params) => { + return HttpHandler.Get(`/apis/moment.halo.run/v1alpha1/moments`, params, { + custom: { + personalToken: getPersonalToken() + } + }) + }, + + /** + * 获取瞬间详情 + * @param {String} name 瞬间id + */ + getMomentByName: (name) => { + return HttpHandler.Get(`/apis/moment.halo.run/v1alpha1/moments/${name}`, {}, { + custom: { + personalToken: getPersonalToken() + } + }) + }, + + /** + * 查询站点统计信息 + */ + getBlogStatistics: () => { + return HttpHandler.Get(`/apis/api.halo.run/v1alpha1/stats/-`, {}) + }, - /** - * 根据分组获取相册 - */ - getPhotoListByGroupName: (params) => { - return HttpHandler.Get(`/apis/console.api.photo.halo.run/v1alpha1/photos`, params, { - custom: { - personalToken: getPersonalToken() - } - }) - }, + /** + * 获取相册分组 + */ + getPhotoGroupList: (params) => { + return HttpHandler.Get(`/apis/core.halo.run/v1alpha1/photogroups`, params, { + custom: { + personalToken: getPersonalToken() + } + }) + }, - /** - * 获取友链分组 - */ - getFriendLinkGroupList: (params) => { - return HttpHandler.Get(`/apis/core.halo.run/v1alpha1/linkgroups`, params, { - custom: { - personalToken: getPersonalToken() - } - }) - }, - /** - * 获取友链 - */ - getFriendLinkList: (params) => { - return HttpHandler.Get(`/apis/api.plugin.halo.run/v1alpha1/plugins/PluginLinks/links`, params) - }, + /** + * 根据分组获取相册 + */ + getPhotoListByGroupName: (params) => { + return HttpHandler.Get(`/apis/console.api.photo.halo.run/v1alpha1/photos`, params, { + custom: { + personalToken: getPersonalToken() + } + }) + }, - /** - * 限制阅读校验 - * @param restrictType - * @param code - * @param keyId - * @returns {HttpPromise} - */ - requestRestrictReadCheck: (restrictType, code, keyId) => { - const params = { - code: code, - templateType: 'post', - restrictType: restrictType, - keyId: keyId - } - return HttpHandler.Post(`/apis/tools.muyin.site/v1alpha1/restrict-read/check`, params, { - header: { - 'Authorization': getAppConfigs().pluginConfig.toolsPlugin?.Authorization, - 'Wechat-Session-Id': uni.getStorageSync('openid'), - } - }) - }, + /** + * 获取友链分组 + */ + getFriendLinkGroupList: (params) => { + return HttpHandler.Get(`/apis/core.halo.run/v1alpha1/linkgroups`, params, { + custom: { + personalToken: getPersonalToken() + } + }) + }, - /** - * 获取文章验证码 - */ - createVerificationCode: () => { - return HttpHandler.Get(`/apis/tools.muyin.site/v1alpha1/restrict-read/create`, null, { - header: { - 'Authorization': getAppConfigs().pluginConfig.toolsPlugin?.Authorization, - 'Wechat-Session-Id': uni.getStorageSync('openid'), - } - }) - }, + /** + * 获取友链 + */ + getFriendLinkList: (params) => { + return HttpHandler.Get(`/apis/api.plugin.halo.run/v1alpha1/plugins/PluginLinks/links`, params) + }, - /** - * 提交友情链接 - */ - submitLink(form) { - return HttpHandler.Post(`/apis/linksSubmit.muyin.site/v1alpha1/submit`, form, { - header: { - 'Authorization': getAppConfigs().pluginConfig.linksSubmitPlugin?.Authorization, - 'Wechat-Session-Id': uni.getStorageSync('openid'), - } - }) - }, - /** - * 获取二维码信息 - */ - getQRCodeInfo: (key) => { - return HttpHandler.Get(`/apis/api.uni.uhalo.pro/v1alpha1/plugins/plugin-uni-halo/getQRCodeInfo/${key}`, - null, {}) - }, - /** - * 获取二维码图片 - */ - getQRCodeImg: (postId) => { - return HttpHandler.Get(`/apis/api.uni.uhalo.pro/v1alpha1/plugins/plugin-uni-halo/getQRCodeImg/${postId}`, - null, {}) - }, - /** - * 点赞 - * @param {*} data ={group, plural, name} - */ - submitUpvote(data) { - return HttpHandler.Post(`/apis/api.halo.run/v1alpha1/trackers/upvote`, data, {}) - } + /** + * 限制阅读校验 + * @param restrictType + * @param code + * @param keyId + * @returns {HttpPromise} + */ + requestRestrictReadCheck: (restrictType, code, keyId) => { + const params = { + code: code, + templateType: 'post', + restrictType: restrictType, + keyId: keyId + } + return HttpHandler.Post(`/apis/tools.muyin.site/v1alpha1/restrict-read/check`, params, { + header: { + 'Authorization': getAppConfigs().pluginConfig.toolsPlugin?.Authorization, + 'Wechat-Session-Id': uni.getStorageSync('openid'), + } + }) + }, -} + /** + * 获取文章验证码 + */ + createVerificationCode: () => { + return HttpHandler.Get(`/apis/tools.muyin.site/v1alpha1/restrict-read/create`, null, { + header: { + 'Authorization': getAppConfigs().pluginConfig.toolsPlugin?.Authorization, + 'Wechat-Session-Id': uni.getStorageSync('openid'), + } + }) + }, + + /** + * 提交友情链接 + */ + submitLink(form) { + return HttpHandler.Post(`/apis/linksSubmit.muyin.site/v1alpha1/submit`, form, { + header: { + 'Authorization': getAppConfigs().pluginConfig.linksSubmitPlugin?.Authorization, + 'Wechat-Session-Id': uni.getStorageSync('openid'), + } + }) + }, + /** + * 获取二维码信息 + */ + getQRCodeInfo: (key) => { + return HttpHandler.Get(`/apis/api.uni.uhalo.pro/v1alpha1/plugins/plugin-uni-halo/getQRCodeInfo/${key}`, + null, {}) + }, + /** + * 获取二维码图片 + */ + getQRCodeImg: (postId) => { + return HttpHandler.Get(`/apis/api.uni.uhalo.pro/v1alpha1/plugins/plugin-uni-halo/getQRCodeImg/${postId}`, + null, {}) + }, + /** + * 点赞 + * @param {*} data ={group, plural, name} + */ + submitUpvote(data) { + return HttpHandler.Post(`/apis/api.halo.run/v1alpha1/trackers/upvote`, data, {}) + }, + + //----------- 投票 ----------------- + /** + * 获取投票列表 + */ + getVoteList: (params) => { + return HttpHandler.Get(`/apis/console.api.vote.kunkunyu.com/v1alpha1/votes`, params, { + custom: { + personalToken: getPersonalToken() + } + }) + }, + /** + * 获取投票详情 + * @param {String} name id + */ + getVoteDetail: (name) => { + return HttpHandler.Get(`/apis/api.vote.kunkunyu.com/v1alpha1/votes/${name}/detail`, {}) + }, + /** + * 获取投票用户列表 + * @param {String} name id + */ + getVoteUserList: (name) => { + return HttpHandler.Get(`/apis/api.vote.kunkunyu.com/v1alpha1/votes/${name}/user-list`, {}) + }, + /** + * 提交投票 + * @param {String} name id + * @param {Object} { voteData:["选项ID"] } 提交的数据 + * @param {Boolean} canAnonymously 是否匿名 默认匿名 + */ + submitVote: (name, data, canAnonymously = true) => { + return HttpHandler.Post(`/apis/api.vote.kunkunyu.com/v1alpha1/votes/${name}/submit`, data, { + custom: { + personalToken: canAnonymously ? undefined : getPersonalToken() + } + }) + }, + /** + * 检查是否安装启用插件 + * @param {String} name 插件id + */ + checkPluginAvailable: (name) => { + return HttpHandler.Get(`/apis/api.plugin.halo.run/v1alpha1/plugins/${name}/available`, {}) + }, +} \ No newline at end of file diff --git a/common/mixins/pluginAvailable.js b/common/mixins/pluginAvailable.js new file mode 100644 index 0000000..c95437b --- /dev/null +++ b/common/mixins/pluginAvailable.js @@ -0,0 +1,47 @@ +/** + * 功能:插件检查 + */ +import { + NeedPluginIds, + NeedPlugins, + checkNeedPluginAvailable +} from "@/utils/plugin.js" +import PluginUnavailable from '@/components/plugin-unavailable/plugin-unavailable.vue' + + +const HaloPluginAvailableMixin = { + components: { + PluginUnavailable + }, + data() { + return { + NeedPluginIds, + NeedPlugins, + uniHaloPluginAvailableError: "", + uniHaloPluginAvailable: true, + uniHaloPluginId: "", // 当前需要的插件 + uniHaloPluginInfo: "" // 当前插件信息 + }; + }, + methods: { + /** 设置插件ID */ + setPluginId(pluginId) { + this.uniHaloPluginId = pluginId + this.uniHaloPluginInfo = NeedPlugins.get(pluginId) + }, + /** 检查插件状态 */ + async checkPluginAvailable(pluginId) { + pluginId = pluginId ?? this.uniHaloPluginId + if (!pluginId) return false; + const available = await checkNeedPluginAvailable(pluginId) + this.uniHaloPluginAvailable = available + return available + }, + /** 设置错误信息 */ + setPluginError(text) { + this.uniHaloPluginAvailableError = text + } + }, +} + +export default HaloPluginAvailableMixin; \ No newline at end of file diff --git a/common/styles/app.base.scss b/common/styles/app.base.scss index d5567bf..6e8b384 100644 --- a/common/styles/app.base.scss +++ b/common/styles/app.base.scss @@ -172,3 +172,170 @@ } /* 文本省略样式 结束 */ + + +// 定义尺寸变量(单位:rpx) +$spacing-sizes: ( + 0: 0, + 2: 4rpx, + 4: 8rpx, + 8: 16rpx, + 12: 24rpx, + 24: 48rpx, + 48: 96rpx +); + +// 内边距类 +@each $name, $size in $spacing-sizes { + // 全方向内边距:p-{size} + .p-#{$name} { + padding: $size !important; + } + + // 水平方向内边距:px-{size} + .px-#{$name} { + padding-left: $size !important; + padding-right: $size !important; + } + + // 垂直方向内边距:py-{size} + .py-#{$name} { + padding-top: $size !important; + padding-bottom: $size !important; + } + + // 上内边距:pt-{size} + .pt-#{$name} { + padding-top: $size !important; + } + + // 右内边距:pr-{size} + .pr-#{$name} { + padding-right: $size !important; + } + + // 下内边距:pb-{size} + .pb-#{$name} { + padding-bottom: $size !important; + } + + // 左内边距:pl-{size} + .pl-#{$name} { + padding-left: $size !important; + } +} + +//外边距工具类 +@each $name, $size in $spacing-sizes { + // 全方向外边距:m-{size} + .m-#{$name} { + margin: $size !important; + } + + // 水平方向外边距:mx-{size} + .mx-#{$name} { + margin-left: $size !important; + margin-right: $size !important; + } + + // 垂直方向外边距:my-{size} + .my-#{$name} { + margin-top: $size !important; + margin-bottom: $size !important; + } + + // 上外边距:mt-{size} + .mt-#{$name} { + margin-top: $size !important; + } + + // 右外边距:mr-{size} + .mr-#{$name} { + margin-right: $size !important; + } + + // 下外边距:mb-{size} + .mb-#{$name} { + margin-bottom: $size !important; + } + + // 左外边距:ml-{size} + .ml-#{$name} { + margin-left: $size !important; + } +} + +// gap 类 +@each $name, $size in $spacing-sizes { + // 全方向gap:gap-{size} + .gap-#{$name} { + gap: $size !important; + } + + // 水平方向gap:gap-x-{size} + .gap-x-#{$name} { + column-gap: $size !important; + } + + // 垂直方向gap:gap-y-{size} + .gap-y-#{$name} { + row-gap: $size !important; + } +} + + +.w-full { + width: 100%; +} + +.h-full { + height: 100%; +} + +.flex { + display: flex; +} + +.flex-col { + flex-direction: column; +} + +.flex-1 { + flex: 1; +} + +.flex-shrink-0 { + flex-shrink: 0; +} + +.items-center { + align-items: center; +} + +.items-start { + align-items: flex-start; +} + +.items-end { + align-items: flex-end; +} + +.justify-between { + justify-content: space-between; +} + +.justify-around { + justify-content: space-around; +} + +.justify-end { + justify-content: flex-end; +} + +.justify-start { + justify-content: flex-start; +} + +.justify-center { + justify-content: center; +} diff --git a/pages/tabbar/gallery/gallery.vue b/pages/tabbar/gallery/gallery.vue index 60345da..6135abb 100644 --- a/pages/tabbar/gallery/gallery.vue +++ b/pages/tabbar/gallery/gallery.vue @@ -1,366 +1,388 @@ + .touch-listen-content { + width: 100%; + display: flex; + flex-wrap: wrap; + box-sizing: border-box; + padding: 24rpx 24rpx 0; + gap: 12rpx 0; + } + + .loading-wrap { + box-sizing: border-box; + padding: 24rpx; + } + + .load-text { + width: 100%; + text-align: center; + } + + .flot-buttons { + position: fixed; + bottom: 100rpx; + right: 32rpx; + flex-direction: column; + display: flex; + gap: 6rpx; + z-index: 999; + } + \ No newline at end of file diff --git a/pages/tabbar/moments/moments.vue b/pages/tabbar/moments/moments.vue index 938c08e..eb209d1 100644 --- a/pages/tabbar/moments/moments.vue +++ b/pages/tabbar/moments/moments.vue @@ -1,79 +1,84 @@ @@ -92,7 +97,11 @@ import { generateUUID } from '@/utils/uuid.js'; + + import pluginAvailable from "@/common/mixins/pluginAvailable.js" + export default { + mixins: [pluginAvailable], components: { tmSkeleton, tmFlotbutton, @@ -141,10 +150,16 @@ return this.haloConfigs.appConfig.startConfig; } }, - onLoad() { + async onLoad() { + // 检查插件 + this.setPluginId(this.NeedPluginIds.PluginMoments) + this.setPluginError("阿偶,检测到当前插件没有安装或者启用,无法使用瞬间功能哦,请联系管理员") + if (!await this.checkPluginAvailable()) return + this.fnGetData(); }, onPullDownRefresh() { + if (!this.uniHaloPluginAvailable) return; this.isLoadMore = false; this.queryParams.page = 0; this.videoContexts = {}; @@ -152,6 +167,7 @@ this.fnGetData(); }, onReachBottom(e) { + if (!this.uniHaloPluginAvailable) return; if (this.calcAuditModeEnabled) { uni.showToast({ icon: 'none', @@ -322,7 +338,9 @@ + .preview-site { + width: 100%; + height: 300rpx; + } + \ No newline at end of file diff --git a/utils/plugin.js b/utils/plugin.js new file mode 100644 index 0000000..fa66bac --- /dev/null +++ b/utils/plugin.js @@ -0,0 +1,94 @@ +import utils from '@/utils/index.js' +import v2Apis from "@/api/v2/all.api.js" + +export const NeedPluginIds = Object.freeze({ + PluginUniHalo: "plugin-uni-halo", + PluginPhotos: "PluginPhotos", + PluginLinks: "PluginLinks", + PluginMoments: "PluginMoments", + PluginSearchWidget: "PluginSearchWidget", + PluginCommentWidget: "PluginCommentWidget", + PluginVote: "vote", +}) + +export const NeedPlugins = new Map([ + [ + NeedPluginIds.PluginUniHalo, { + id: "plugin-uni-halo", + name: "UniHalo配置", + desc: "uni-halo 核心插件,未安装和启用的情况下,将无法使用 uni-halo,请检查是否已安装和启用。", + logo: utils.checkUrl("/plugins/plugin-uni-halo/assets/logo.png"), + url: "https://www.halo.run/store/apps/app-ryemX" + } + ], + [ + NeedPluginIds.PluginPhotos, { + id: "PluginPhotos", + name: "图库管理", + desc: "图库功能模块所需要的插件,用于展示", + logo: utils.checkUrl("/plugins/PluginPhotos/assets/logo.svg"), + url: "https://www.halo.run/store/apps/app-BmQJW" + } + ], + [ + NeedPluginIds.PluginLinks, { + id: "PluginLinks", + name: "链接管理", + desc: "链接管理模块,用于网站友情链接功能模块。", + logo: utils.checkUrl("/plugins/PluginLinks/assets/logo.svg"), + url: "https://www.halo.run/store/apps/app-hfbQg" + } + ], + [ + NeedPluginIds.PluginMoments, { + id: "PluginMoments", + name: "瞬间", + desc: "提供一个轻量级的内容图文、视频、音频等内容展示。", + logo: utils.checkUrl("/plugins/PluginMoments/assets/logo.svg"), + url: "https://www.halo.run/store/apps/app-SnwWD" + } + ], + [ + NeedPluginIds.PluginSearchWidget, { + id: "PluginSearchWidget", + name: "搜索组件", + desc: "为应用提供统一的搜索组件。", + logo: utils.checkUrl("/plugins/PluginSearchWidget/assets/logo.svg"), + url: "https://www.halo.run/store/apps/app-DlacW" + } + ], + [ + NeedPluginIds.PluginCommentWidget, { + id: "PluginCommentWidget", + name: "评论组件", + desc: "为用户前台提供完整的评论解决方案", + logo: utils.checkUrl("/plugins/PluginCommentWidget/assets/logo.svg"), + url: "https://www.halo.run/store/apps/app-YXyaD" + } + ], + [ + NeedPluginIds.PluginVote, { + id: "vote", + name: "投票管理", + desc: "投票模块所需要的插件,用于展示投票和提交投票", + logo: utils.checkUrl("/plugins/vote/assets/logo.png"), + url: "https://www.halo.run/store/apps/app-veyvzyhv" + } + ] +]) + +/** + * 检查插件是否启用、安装 + * @param {String} pluginId 插件id + * @return {Boolean} true = 安装、启用 false= 未安装启用 + */ +export const checkNeedPluginAvailable = (pluginId) => { + return new Promise(async (resolve) => { + try { + const available = await v2Apis.checkPluginAvailable(pluginId) + resolve(available) + } catch (err) { + resolve(false) + } + }) +} \ No newline at end of file