a
This commit is contained in:
parent
18eeac233a
commit
c9120294c9
|
|
@ -359,7 +359,7 @@ const GlobalConfig = ({ currentUser }) => {
|
|||
try {
|
||||
// 管理员全局配置:使用全局策略账号的配置,不依赖当前 account
|
||||
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)
|
||||
setConfigs(data)
|
||||
} else {
|
||||
|
|
@ -607,7 +607,7 @@ const GlobalConfig = ({ currentUser }) => {
|
|||
// 管理员全局配置:应用到全局策略账号
|
||||
let response
|
||||
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)
|
||||
} else {
|
||||
response = await api.updateConfigsBatch(configItems)
|
||||
|
|
@ -653,7 +653,7 @@ const GlobalConfig = ({ currentUser }) => {
|
|||
// 管理员全局配置:使用全局策略账号的配置
|
||||
let data
|
||||
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)
|
||||
} else {
|
||||
data = await api.getConfigs()
|
||||
|
|
@ -860,7 +860,7 @@ const GlobalConfig = ({ currentUser }) => {
|
|||
|
||||
// 简单计算:全局策略账号ID(在 render 时计算)
|
||||
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
|
||||
// 管理员全局配置页面:不依赖当前 account,直接管理全局策略账号
|
||||
const isGlobalStrategyAccount = isAdmin
|
||||
|
|
@ -1165,7 +1165,10 @@ const GlobalConfig = ({ currentUser }) => {
|
|||
try {
|
||||
setSaving(true)
|
||||
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([{
|
||||
key,
|
||||
value,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user