mirror of https://github.com/halo-dev/halo
Refactor migrate api.
parent
fff323ee2c
commit
bf1bea2e97
|
@ -151,6 +151,7 @@ public class HaloConfiguration {
|
|||
"/api/admin/refresh/*",
|
||||
"/api/admin/installations",
|
||||
"/api/admin/recoveries/migrations/*",
|
||||
"/api/admin/migrations/*",
|
||||
"/api/admin/is_installed",
|
||||
"/api/admin/password/code",
|
||||
"/api/admin/password/reset"
|
||||
|
|
|
@ -179,7 +179,7 @@ public class InstallController {
|
|||
@Nullable
|
||||
private Category createDefaultCategoryIfAbsent() {
|
||||
long categoryCount = categoryService.count();
|
||||
if (categoryCount == 0) {
|
||||
if (categoryCount > 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import run.halo.app.service.MigrateService;
|
|||
* @date 2019-10-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/admin/migrates")
|
||||
@RequestMapping("/api/admin/migrations")
|
||||
public class MigrateController {
|
||||
|
||||
private final MigrateService migrateService;
|
||||
|
|
|
@ -42,6 +42,7 @@ public class MigrateHandlers {
|
|||
for (MigrateHandler migrateHandler : migrateHandlers) {
|
||||
if (migrateHandler.supportType(migrateType)) {
|
||||
migrateHandler.migrate(file);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue