|
|
|
@ -3,14 +3,6 @@ import { request, unwrapApiBody, type ApiResponse } from '../utils/http/factory' |
|
|
|
export type GlobalConfig = { |
|
|
|
siteName: string |
|
|
|
allowRegister: boolean |
|
|
|
showDiscoverInHeaderForGuest: boolean |
|
|
|
commentEmailNotifyEnabled: boolean |
|
|
|
commentMailFromEmail: string |
|
|
|
commentSmtpHost: string |
|
|
|
commentSmtpPort: number |
|
|
|
commentSmtpSecure: boolean |
|
|
|
commentSmtpUser: string |
|
|
|
commentSmtpPass: string |
|
|
|
} |
|
|
|
|
|
|
|
type GlobalConfigResult = { |
|
|
|
@ -20,14 +12,6 @@ type GlobalConfigResult = { |
|
|
|
const DEFAULT_GLOBAL_CONFIG: GlobalConfig = { |
|
|
|
siteName: 'Person Panel', |
|
|
|
allowRegister: true, |
|
|
|
showDiscoverInHeaderForGuest: true, |
|
|
|
commentEmailNotifyEnabled: false, |
|
|
|
commentMailFromEmail: '', |
|
|
|
commentSmtpHost: '', |
|
|
|
commentSmtpPort: 465, |
|
|
|
commentSmtpSecure: true, |
|
|
|
commentSmtpUser: '', |
|
|
|
commentSmtpPass: '', |
|
|
|
} |
|
|
|
|
|
|
|
export function useGlobalConfig() { |
|
|
|
@ -55,7 +39,6 @@ export function useGlobalConfig() { |
|
|
|
return n && n.length > 0 ? n : DEFAULT_GLOBAL_CONFIG.siteName |
|
|
|
}), |
|
|
|
allowRegister: computed(() => config.value.allowRegister), |
|
|
|
showDiscoverInHeaderForGuest: computed(() => config.value.showDiscoverInHeaderForGuest), |
|
|
|
pending, |
|
|
|
error, |
|
|
|
refresh, |
|
|
|
|