名称Branding变更
This commit is contained in:
1 parent
c74c1e3914
commit
8b5103d542
41 files changed
+282
-93
No files matched your search
@@ -0,0 +1,36 @@
|
||||
import { readFileSync } from 'node:fs'
|
||||
|
||||
export interface AppBranding {
|
||||
brandName: string
|
||||
institutionName: string
|
||||
productName: string
|
||||
shortName: string
|
||||
tagline: string
|
||||
description: string
|
||||
}
|
||||
|
||||
interface AppSettings {
|
||||
Branding?: Partial<Record<keyof AppBranding | Capitalize<keyof AppBranding>, unknown>>
|
||||
}
|
||||
|
||||
const appsettings = JSON.parse(
|
||||
readFileSync(new URL('../src/Jiaowu.Api/appsettings.json', import.meta.url), 'utf8'),
|
||||
) as AppSettings
|
||||
|
||||
function required(field: keyof AppBranding): string {
|
||||
const pascalCase = `${field.charAt(0).toUpperCase()}${field.slice(1)}` as Capitalize<keyof AppBranding>
|
||||
const value = appsettings.Branding?.[pascalCase] ?? appsettings.Branding?.[field]
|
||||
if (typeof value !== 'string' || !value.trim()) {
|
||||
throw new Error(`appsettings.json 中缺少 Branding:${pascalCase}。`)
|
||||
}
|
||||
return value.trim()
|
||||
}
|
||||
|
||||
export const branding: Readonly<AppBranding> = Object.freeze({
|
||||
brandName: required('brandName'),
|
||||
institutionName: required('institutionName'),
|
||||
productName: required('productName'),
|
||||
shortName: required('shortName'),
|
||||
tagline: required('tagline'),
|
||||
description: required('description'),
|
||||
})
|
||||
@@ -1,8 +1,9 @@
|
||||
import type { CapacitorConfig } from '@capacitor/cli'
|
||||
import { branding } from './branding.config.ts'
|
||||
|
||||
const config: CapacitorConfig = {
|
||||
appId: 'edu.mingxu.jiaowu',
|
||||
appName: '明序教务',
|
||||
appName: branding.shortName,
|
||||
webDir: 'dist',
|
||||
bundledWebRuntime: false,
|
||||
android: {
|
||||
|
||||
+2
-2
@@ -6,8 +6,8 @@
|
||||
<link rel="apple-touch-icon" href="/favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover, maximum-scale=1.0, user-scalable=no" />
|
||||
<meta name="theme-color" content="#152550" />
|
||||
<meta name="description" content="明序大学教务管理系统" />
|
||||
<title>明序教务管理系统</title>
|
||||
<meta name="description" content="__APP_DESCRIPTION__" />
|
||||
<title>__APP_PRODUCT_NAME__</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
Loaded 3 of 41 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user