优化版权显示逻辑,允许激活用户更改自定义版权

This commit is contained in:
RockYang
2024-07-15 18:44:14 +08:00
parent 0df700ec18
commit f22c6bf658
14 changed files with 83 additions and 52 deletions

View File

@@ -1,22 +1,43 @@
<template>
<div class="foot-container">
<div class="footer">
Powered by {{ author }} @
<el-link type="primary" :href="gitURL" target="_blank" style="--el-link-text-color:#ffffff">
{{ title }} -
{{ version }}
</el-link>
<div v-if="license.de_copy">{{copyRight}}</div>
<div v-else>
<span>{{copyRight}}</span>
<el-link type="primary" :href="gitURL" target="_blank" style="--el-link-text-color:#ffffff">
{{ title }} -
{{ version }}
</el-link>
</div>
</div>
</div>
</template>
<script setup>
import {ref} from "vue";
import {httpGet} from "@/utils/http";
import {showMessageError} from "@/utils/dialog";
const title = ref(process.env.VUE_APP_TITLE)
const title = ref("")
const version = ref(process.env.VUE_APP_VERSION)
const gitURL = ref(process.env.VUE_APP_GIT_URL)
const author = ref('极客学长')
const copyRight = ref('')
const license = ref({})
// 获取系统配置
httpGet("/api/config/get?key=system").then(res => {
title.value = res.data.title??process.env.VUE_APP_TITLE
copyRight.value = res.data.copyright??'极客学长 © 2023 - '+new Date().getFullYear()+' All rights reserved.'
}).catch(e => {
showMessageError("获取系统配置失败:" + e.message)
})
httpGet("/api/config/license").then(res => {
license.value = res.data
}).catch(e => {
showMessageError("获取 License 失败:" + e.message)
})
</script>
<style scoped lang="stylus">

View File

@@ -251,7 +251,7 @@ const enableMobile = ref(false)
const enableEmail = ref(false)
const enableUser = ref(false)
const enableRegister = ref(false)
const activeName = ref("mobile")
const activeName = ref("")
const wxImg = ref("/images/wx.png")
// eslint-disable-next-line no-undef
const emits = defineEmits(['hide', 'success']);
@@ -261,12 +261,15 @@ httpGet("/api/config/get?key=system").then(res => {
const registerWays = res.data['register_ways']
if (arrayContains(registerWays, "mobile")) {
enableMobile.value = true
activeName.value = activeName.value === "" ? "mobile" : activeName.value
}
if (arrayContains(registerWays, "email")) {
enableEmail.value = true
activeName.value = activeName.value === "" ? "email" : activeName.value
}
if (arrayContains(registerWays, "username")) {
enableUser.value = true
activeName.value = activeName.value === "" ? "username" : activeName.value
}
// 是否启用注册
enableRegister.value = res.data['enabled_register']