fix: 下载配置接口加null检查,前端去掉responseType:text让axios自动解析
This commit is contained in:
@@ -80,6 +80,9 @@ public class ConfigController {
|
|||||||
log.error("Failed to read config: siteId={}, version={}", siteId, version, e);
|
log.error("Failed to read config: siteId={}, version={}", siteId, version, e);
|
||||||
return ResponseEntity.status(500).body("Failed to read config");
|
return ResponseEntity.status(500).body("Failed to read config");
|
||||||
}
|
}
|
||||||
|
if (content == null) {
|
||||||
|
return ResponseEntity.notFound().build();
|
||||||
|
}
|
||||||
|
|
||||||
return ResponseEntity.ok()
|
return ResponseEntity.ok()
|
||||||
.eTag(config.getConfigHash())
|
.eTag(config.getConfigHash())
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export default {
|
|||||||
configs: {
|
configs: {
|
||||||
list: () => api.get('/configs'),
|
list: () => api.get('/configs'),
|
||||||
pending: () => api.get('/configs/pending'),
|
pending: () => api.get('/configs/pending'),
|
||||||
download: (siteId, version) => api.get(`/configs/${siteId}/${version}`, { responseType: 'text' }),
|
download: (siteId, version) => api.get(`/configs/${siteId}/${version}`),
|
||||||
approve: (id, comment) => api.post(`/admin/reviews/${id}/approve`, null, { params: { comment } }),
|
approve: (id, comment) => api.post(`/admin/reviews/${id}/approve`, null, { params: { comment } }),
|
||||||
reject: (id, comment) => api.post(`/admin/reviews/${id}/reject`, null, { params: { comment } })
|
reject: (id, comment) => api.post(`/admin/reviews/${id}/reject`, null, { params: { comment } })
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user