()
| 185 | }; |
| 186 | |
| 187 | const loadModels = async () => { |
| 188 | setModelsLoading(true); |
| 189 | |
| 190 | try { |
| 191 | let res = await API.get(`/api/user/models`); |
| 192 | const { success, message, data } = res.data; |
| 193 | |
| 194 | if (success) { |
| 195 | if (data != null) { |
| 196 | setModels(data); |
| 197 | } |
| 198 | } else { |
| 199 | showError(message); |
| 200 | } |
| 201 | } catch (error) { |
| 202 | showError(t('加载模型列表失败')); |
| 203 | } finally { |
| 204 | setModelsLoading(false); |
| 205 | } |
| 206 | }; |
| 207 | |
| 208 | const handleSystemTokenClick = async (e) => { |
| 209 | e.target.select(); |
no test coverage detected