This commit is contained in:
薇薇安 2026-01-22 20:54:00 +08:00
parent 18eeac233a
commit c9120294c9

View File

@ -359,7 +359,7 @@ const GlobalConfig = ({ currentUser }) => {
try { try {
// 使 account // 使 account
if (isAdmin && configMeta?.global_strategy_account_id) { if (isAdmin && configMeta?.global_strategy_account_id) {
const globalAccountId = parseInt(String(configMeta.global_strategy_account_id), 10) || 1 const globalAccountId = parseInt(String(configMeta?.global_strategy_account_id || '1'), 10) || 1
const data = await api.getGlobalConfigs(globalAccountId) const data = await api.getGlobalConfigs(globalAccountId)
setConfigs(data) setConfigs(data)
} else { } else {
@ -607,7 +607,7 @@ const GlobalConfig = ({ currentUser }) => {
// //
let response let response
if (isAdmin && configMeta?.global_strategy_account_id) { if (isAdmin && configMeta?.global_strategy_account_id) {
const globalAccountId = parseInt(String(configMeta.global_strategy_account_id), 10) || 1 const globalAccountId = parseInt(String(configMeta?.global_strategy_account_id || '1'), 10) || 1
response = await api.updateGlobalConfigsBatch(configItems, globalAccountId) response = await api.updateGlobalConfigsBatch(configItems, globalAccountId)
} else { } else {
response = await api.updateConfigsBatch(configItems) response = await api.updateConfigsBatch(configItems)
@ -653,7 +653,7 @@ const GlobalConfig = ({ currentUser }) => {
// 使 // 使
let data let data
if (isAdmin && configMeta?.global_strategy_account_id) { if (isAdmin && configMeta?.global_strategy_account_id) {
const globalAccountId = parseInt(String(configMeta.global_strategy_account_id), 10) || 1 const globalAccountId = parseInt(String(configMeta?.global_strategy_account_id || '1'), 10) || 1
data = await api.getGlobalConfigs(globalAccountId) data = await api.getGlobalConfigs(globalAccountId)
} else { } else {
data = await api.getConfigs() data = await api.getConfigs()
@ -860,7 +860,7 @@ const GlobalConfig = ({ currentUser }) => {
// ID render // ID render
const globalStrategyAccountId = configMeta?.global_strategy_account_id const globalStrategyAccountId = configMeta?.global_strategy_account_id
? parseInt(String(configMeta.global_strategy_account_id), 10) ? parseInt(String(configMeta?.global_strategy_account_id || '1'), 10)
: 1 : 1
// account // account
const isGlobalStrategyAccount = isAdmin const isGlobalStrategyAccount = isAdmin
@ -1165,7 +1165,10 @@ const GlobalConfig = ({ currentUser }) => {
try { try {
setSaving(true) setSaving(true)
setMessage('') setMessage('')
const globalAccountId = parseInt(String(configMeta.global_strategy_account_id), 10) || 1 // configMeta 使 1
const globalAccountId = configMeta?.global_strategy_account_id
? parseInt(String(configMeta?.global_strategy_account_id || '1'), 10) || 1
: 1
await api.updateGlobalConfigsBatch([{ await api.updateGlobalConfigsBatch([{
key, key,
value, value,