MCPcopy
hub / github.com/HisMax/RedInk / loadConfig

Function loadConfig

frontend/src/composables/useProviderForm.ts:145–163  ·  view source on GitHub ↗

* 加载配置

()

Source from the content-addressed store, hash-verified

143 * 加载配置
144 */
145 async function loadConfig() {
146 loading.value = true
147 try {
148 const result = await getConfig()
149 if (result.success && result.config) {
150 textConfig.value = {
151 active_provider: result.config.text_generation.active_provider,
152 providers: result.config.text_generation.providers
153 }
154 imageConfig.value = result.config.image_generation
155 } else {
156 setError(result.error || result.error_message || '加载配置失败', '加载配置失败')
157 }
158 } catch (e) {
159 setError(e, '加载配置失败')
160 } finally {
161 loading.value = false
162 }
163 }
164
165 /**
166 * 自动保存配置

Callers 1

autoSaveConfigFunction · 0.85

Calls 2

getConfigFunction · 0.90
setErrorFunction · 0.85

Tested by

no test coverage detected