Skip to content

Commit 7f70ea3

Browse files
committed
fix:conf theme
1 parent 917ad45 commit 7f70ea3

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/views/dashboard/config.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22
<div class="m-dashboard m-dashboard-config">
33
<h2 class="u-title"><i class="el-icon-setting"></i> 全局设置</h2>
44
<el-form class="m-config-form" label-position="left" label-width="160px">
5+
<el-form-item label="主题颜色">
6+
<template #label>
7+
<span>主题颜色</span>
8+
<el-tooltip class="item" effect="dark" content="仅App有效" placement="top"
9+
><i class="el-icon-info"></i
10+
></el-tooltip>
11+
</template>
12+
<el-radio-group v-model="conf.theme" size="small">
13+
<el-radio-button value="light">浅色</el-radio-button>
14+
<el-radio-button value="dark">深色</el-radio-button>
15+
</el-radio-group>
16+
</el-form-item>
517
<el-form-item label="编辑器模式">
618
<el-radio-group v-model="conf.editor_mode" size="small">
719
<el-radio-button value="tinymce">可视化</el-radio-button>
@@ -168,6 +180,7 @@ export default {
168180
data: function () {
169181
return {
170182
conf: {
183+
theme: "light",
171184
cmt_email: 0,
172185
cmt_order: "DESC",
173186
editor_mode: "tinymce",
@@ -206,7 +219,10 @@ export default {
206219
methods: {
207220
loadData: function () {
208221
getUserConf().then((res) => {
209-
this.conf = res?.data?.data;
222+
this.conf = {
223+
...(res?.data?.data || {}),
224+
theme: res?.data?.data?.theme || "light",
225+
};
210226
211227
this.oldLang = this.conf.default_lang;
212228
});

0 commit comments

Comments
 (0)