vuepress-plugin-coze
Version:
为Vuepress静态站点提供在线发布,编辑说说功能,支持图片上传,点赞,评论,用户登录,注册等功能 Provide online publishing, editing and talking functions for Vuepress static sites, support image upload, like, comment, user login, registration and other functions
48 lines (41 loc) • 1.32 kB
JavaScript
import { defineClientAppEnhance } from '@vuepress/client';
import CozeMood from './components/CozeMood.vue'
import RegisterUser from './components/RegisterUser.vue'
import CozeLogin from "./components/CozeLogin.vue";
import CozePhoto from "./components/CozePhoto.vue";
import AuroraCozeMood from "./components/AuroraCozeMood.vue";
import './style/coze-plugin.css'
import { init } from "leancloud-storage";
let appId = ''
let appKey = ''
let masterKey = ''
let onlyAdministrator = true;
let avatar = 'https://ooszy.cco.vin/img/blog-note/avatar-aurora.png'
try {
appId = __APP_ID__;
appKey = __APP_KEY__;
masterKey = __Master_Key__;
avatar = __AVATAR_PATH__;
onlyAdministrator = __ONLY_ADMINISTRATOR
}catch (e) {
console.warn("你必须在插件中传入appId,appKey,masterKey配置项")
}
export default defineClientAppEnhance(({ app, router }) => {
app.component("CozeMood",CozeMood)
app.component("RegisterUser",RegisterUser)
app.component("CozeLogin",CozeLogin)
app.component("CozePhoto",CozePhoto)
app.component("AuroraCozeMood",AuroraCozeMood)
router.addRoute({
path: '/login',
component: CozePhoto
})
try {
init({
appId: appId,
appKey: appKey
});
}catch (e) {
console.warn(e)
}
});