Skip to content

Commit

Permalink
后台支持修改favicon、网页标题、公安部备案编号
Browse files Browse the repository at this point in the history
  • Loading branch information
YoungYo authored and linhaojun857 committed Aug 27, 2023
1 parent 20287c5 commit 0e2f607
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,13 @@ public class WebsiteConfigVO {
@ApiModelProperty(name = "alipayQRCode", value = "支付宝二维码", required = true, dataType = "String")
private String alipayQRCode;

@ApiModelProperty(name = "favicon", value = "favicon", required = true, dataType = "String")
private String favicon;

@ApiModelProperty(name = "websiteTitle", value = "网页标题", required = true, dataType = "String")
private String websiteTitle;

@ApiModelProperty(name = "gonganBeianNumber", value = "公安部备案编号", required = true, dataType = "String")
private String gonganBeianNumber;

}
23 changes: 22 additions & 1 deletion aurora-vue/aurora-admin/src/views/website/Website.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@
<i v-else class="el-icon-plus avatar-uploader-icon" />
</el-upload>
</el-form-item>
<el-form-item label="favicon">
<el-upload
class="avatar-uploader"
action="/api/admin/config/images"
:headers="headers"
:show-file-list="false"
:before-upload="beforeUpload"
:on-success="handleFaviconSuccess">
<img v-if="websiteConfigForm.favicon" :src="websiteConfigForm.favicon" class="avatar" />
<i v-else class="el-icon-plus avatar-uploader-icon" />
</el-upload>
</el-form-item>
<el-form-item label="网站名称">
<el-input v-model="websiteConfigForm.name" size="small" style="width: 400px" />
</el-form-item>
Expand All @@ -36,6 +48,9 @@
<el-form-item label="网站作者">
<el-input v-model="websiteConfigForm.author" size="small" style="width: 400px" />
</el-form-item>
<el-form-item label="网页标题">
<el-input v-model="websiteConfigForm.websiteTitle" size="small" style="width: 400px" />
</el-form-item>
<el-form-item label="作者介绍">
<el-input v-model="websiteConfigForm.authorIntro" size="small" style="width: 400px" />
</el-form-item>
Expand All @@ -61,9 +76,12 @@
type="textarea"
:rows="5" />
</el-form-item>
<el-form-item label="备案号">
<el-form-item label="工信部备案号">
<el-input v-model="websiteConfigForm.beianNumber" size="small" style="width: 400px" />
</el-form-item>
<el-form-item label="公安部备案号">
<el-input v-model="websiteConfigForm.gonganBeianNumber" size="small" style="width: 400px" />
</el-form-item>
<el-form-item label="qq登录">
<el-radio-group v-model="websiteConfigForm.qqLogin">
<el-radio :label="0">关闭</el-radio>
Expand Down Expand Up @@ -225,6 +243,9 @@ export default {
handleAuthorAvatarSuccess(response) {
this.websiteConfigForm.authorAvatar = response.data
},
handleFaviconSuccess(response) {
this.websiteConfigForm.favicon = response.favicon
},
handleLogoSuccess(response) {
this.websiteConfigForm.logo = response.data
},
Expand Down
3 changes: 2 additions & 1 deletion aurora-vue/aurora-blog/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ export default defineComponent({
head.appendChild(faviconLink);
}
}
console.log(computed(() => appStore.themeConfig.theme))
return {
title: computed(() => appStore.websiteConfig.websiteTitle) || metaStore.title,
title: computed(() => appStore.websiteConfig.websiteTitle || metaStore.title),
theme: computed(() => appStore.themeConfig.theme),
headerImage: computed(() => {
return {
Expand Down
6 changes: 4 additions & 2 deletions aurora-vue/aurora-blog/src/components/Avatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@
</template>

<script lang="ts">
import { defineComponent, toRefs } from 'vue'
import { defineComponent, toRefs, computed } from 'vue'
import { useAppStore } from '@/stores/app'
export default defineComponent({
name: 'Avatar',
props: ['url'],
setup(props) {
const appStore = useAppStore()
return {
url: toRefs(props).url,
default: 'https://static.linhaojun.top/aurora/config/52a81cd2772167b645569342e81ce312.jpg'
default: computed(() => appStore.websiteConfig.touristAvatar || 'https://static.linhaojun.top/aurora/config/52a81cd2772167b645569342e81ce312.jpg')
}
}
})
Expand Down

0 comments on commit 0e2f607

Please sign in to comment.