uni-halo/store/blogger.js
小莫唐尼 9d3ebac076 新增:更新halo.config.js 配置参数;
更新:更新项目UI框架;
修复:修复友链列表丢失白色背景色BUG;
2022-12-09 18:10:47 +08:00

43 lines
891 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 功能:博客作者信息
* 作者:小莫唐尼
* 邮箱studio@925i.cn
* 时间2022年07月21日 18:41:44
* 版本v0.1.0
* 修改记录:
* 修改内容:
* 修改人员:
* 修改时间:
*/
import Blogger from '@/api/blogger.js'
import HaloConfig from '@/config/halo.config.js';
export default {
state: {
blogger: {},
},
getters: {
getBlogger(state) {
return state.blogger
},
},
mutations: {
setBlogger(state, data) {
state.blogger = data;
},
},
actions: {
fnGetBlogger(context) {
if (HaloConfig.author.use) {
context.commit("setBlogger", HaloConfig.author);
} else {
Blogger.getBloggerInfo().then((res) => {
context.commit("setBlogger", res.data);
}).catch((err) => {
// 如果失败,则加载默认配置信息
context.commit("setBlogger", HaloConfig.author);
});
}
},
},
};