mirror of https://github.com/halo-dev/halo
删除无用配置
parent
7fad38ebec
commit
5c1b521b11
|
@ -24,6 +24,7 @@ import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -90,7 +91,7 @@ public class LocalFileHandler implements FileHandler {
|
||||||
Assert.notNull(file, "Multipart file must not be null");
|
Assert.notNull(file, "Multipart file must not be null");
|
||||||
|
|
||||||
// Get current time
|
// Get current time
|
||||||
Calendar current = Calendar.getInstance(optionService.getLocale());
|
Calendar current = Calendar.getInstance(Locale.CHINESE);
|
||||||
// Get month and day of month
|
// Get month and day of month
|
||||||
int year = current.get(Calendar.YEAR);
|
int year = current.get(Calendar.YEAR);
|
||||||
int month = current.get(Calendar.MONTH) + 1;
|
int month = current.get(Calendar.MONTH) + 1;
|
||||||
|
|
|
@ -268,13 +268,4 @@ public interface OptionService extends CrudService<Option, Integer> {
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
Zone getQnYunZone();
|
Zone getQnYunZone();
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets locale.
|
|
||||||
*
|
|
||||||
* @return locale user set or default locale
|
|
||||||
*/
|
|
||||||
@NonNull
|
|
||||||
Locale getLocale();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,16 +269,4 @@ public class OptionServiceImpl extends AbstractCrudService<Option, Integer> impl
|
||||||
|
|
||||||
}).orElseGet(Zone::autoZone);
|
}).orElseGet(Zone::autoZone);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Locale getLocale() {
|
|
||||||
return getByProperty(BlogProperties.BLOG_LOCALE).map(localeStr -> {
|
|
||||||
try {
|
|
||||||
return Locale.forLanguageTag(localeStr);
|
|
||||||
} catch (Exception e) {
|
|
||||||
return Locale.getDefault();
|
|
||||||
}
|
|
||||||
}).orElseGet(Locale::getDefault);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -164,7 +164,6 @@ public class InstallController {
|
||||||
// Init default properties
|
// Init default properties
|
||||||
Map<PropertyEnum, String> properties = new HashMap<>(11);
|
Map<PropertyEnum, String> properties = new HashMap<>(11);
|
||||||
properties.put(PrimaryProperties.IS_INSTALLED, Boolean.TRUE.toString());
|
properties.put(PrimaryProperties.IS_INSTALLED, Boolean.TRUE.toString());
|
||||||
properties.put(BlogProperties.BLOG_LOCALE, installParam.getLocale());
|
|
||||||
properties.put(BlogProperties.BLOG_TITLE, installParam.getTitle());
|
properties.put(BlogProperties.BLOG_TITLE, installParam.getTitle());
|
||||||
properties.put(BlogProperties.BLOG_URL, installParam.getUrl());
|
properties.put(BlogProperties.BLOG_URL, installParam.getUrl());
|
||||||
properties.put(PrimaryProperties.THEME, DEFAULT_THEME_NAME);
|
properties.put(PrimaryProperties.THEME, DEFAULT_THEME_NAME);
|
||||||
|
|
Loading…
Reference in New Issue