mirror of https://github.com/halo-dev/halo
v1.0
parent
4191cdf16e
commit
4af8bd11d0
|
@ -46,6 +46,12 @@ public class Comment {
|
|||
@Column(name = "ip_address", columnDefinition = "varchar(127) default ''")
|
||||
private String ipAddress;
|
||||
|
||||
/**
|
||||
* 评论者网址
|
||||
*/
|
||||
@Column(name = "author_url",columnDefinition = "varchar(512) default ''")
|
||||
private String authorUrl;
|
||||
|
||||
/**
|
||||
* Gavatar md5
|
||||
*/
|
||||
|
@ -55,7 +61,7 @@ public class Comment {
|
|||
/**
|
||||
* 评论内容
|
||||
*/
|
||||
@Column(name = "content", columnDefinition = "varchar(1024) not null")
|
||||
@Column(name = "content", columnDefinition = "varchar(1023) not null")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package cc.ryanc.halo.web.controller.admin;
|
||||
|
||||
import cc.ryanc.halo.service.CommentService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
|
@ -12,4 +14,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
@Controller
|
||||
@RequestMapping(value = "/admin/comments")
|
||||
public class CommentController {
|
||||
|
||||
private final CommentService commentService;
|
||||
|
||||
public CommentController(CommentService commentService) {
|
||||
this.commentService = commentService;
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public String comments(){
|
||||
return "admin/admin_comment";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package cc.ryanc.halo.web.controller.admin;
|
||||
|
||||
import cc.ryanc.halo.service.MenuService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
|
@ -12,4 +14,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
@Controller
|
||||
@RequestMapping(value = "/admin/menus")
|
||||
public class MenuController {
|
||||
|
||||
private final MenuService menuService;
|
||||
|
||||
public MenuController(MenuService menuService) {
|
||||
this.menuService = menuService;
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public String menus(){
|
||||
return "admin/admin_menu";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package cc.ryanc.halo.web.controller.admin;
|
||||
|
||||
import cc.ryanc.halo.service.OptionService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
|
@ -12,4 +14,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
@Controller
|
||||
@RequestMapping(value = "/admin/options")
|
||||
public class OptionController {
|
||||
|
||||
private final OptionService optionService;
|
||||
|
||||
public OptionController(OptionService optionService) {
|
||||
this.optionService = optionService;
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public String options(){
|
||||
return "admin/admin_option";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package cc.ryanc.halo.web.controller.admin;
|
||||
|
||||
import cc.ryanc.halo.service.PostService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
|
@ -12,4 +14,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
@Controller
|
||||
@RequestMapping(value = "/admin/pages")
|
||||
public class PageController {
|
||||
|
||||
private final PostService postService;
|
||||
|
||||
public PageController(PostService postService) {
|
||||
this.postService = postService;
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public String pages(){
|
||||
return "admin/admin_page";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package cc.ryanc.halo.web.controller.admin;
|
||||
|
||||
import cc.ryanc.halo.service.TagService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
|
@ -12,4 +14,15 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
@Controller
|
||||
@RequestMapping(value = "/admin/tags")
|
||||
public class TagController {
|
||||
|
||||
private final TagService tagService;
|
||||
|
||||
public TagController(TagService tagService) {
|
||||
this.tagService = tagService;
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public String tags(){
|
||||
return "admin/admin_tag";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.List;
|
||||
|
||||
import static cc.ryanc.halo.model.support.HaloConst.THEMES;
|
||||
|
@ -81,9 +80,9 @@ public class ThemeController extends BaseController {
|
|||
BaseFrontController.THEME = themeName;
|
||||
configuration.setSharedVariable("themeName", themeName);
|
||||
log.info("Changed theme to {}", themeName);
|
||||
return new JsonResult(ResultCodeEnum.SUCCESS.getCode(), localeMessageUtil.getMessage("code.admin.theme.change-success", new Object[]{themeName}));
|
||||
return new JsonResult(1, localeMessage("code.admin.theme.change-success", new Object[]{themeName}));
|
||||
} catch (Exception e) {
|
||||
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.theme.change-failed"));
|
||||
return new JsonResult(0, localeMessage("code.admin.theme.change-failed"));
|
||||
} finally {
|
||||
refreshCache();
|
||||
}
|
||||
|
@ -102,23 +101,23 @@ public class ThemeController extends BaseController {
|
|||
HttpServletRequest request) {
|
||||
try {
|
||||
if (!file.isEmpty()) {
|
||||
final File themePath = new File(ThemeUtils.getUsersThemesPath().getAbsolutePath(), new StrBuilder("templates/themes/").append(file.getOriginalFilename()).toString());
|
||||
final File themePath = new File(ThemeUtils.getUsersThemesPath().getAbsolutePath(), file.getOriginalFilename());
|
||||
file.transferTo(themePath);
|
||||
log.info("Upload topic success, path is " + themePath.getAbsolutePath());
|
||||
ZipUtil.unzip(themePath, new File(basePath.getAbsolutePath(), "templates/themes/"));
|
||||
ZipUtil.unzip(themePath, ThemeUtils.getUsersThemesPath());
|
||||
FileUtil.del(themePath);
|
||||
logsService.save(LogsRecord.UPLOAD_THEME, file.getOriginalFilename(), request);
|
||||
log.info("Upload topic success, path is " + themePath.getAbsolutePath());
|
||||
// logsService.save(LogsRecord.UPLOAD_THEME, file.getOriginalFilename(), request);
|
||||
} else {
|
||||
log.error("Upload theme failed, no file selected");
|
||||
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.theme.upload-no-file"));
|
||||
return new JsonResult(0, localeMessage("code.admin.theme.upload-no-file"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Upload theme failed: {}", e.getMessage());
|
||||
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.theme.upload-failed"));
|
||||
}finally {
|
||||
return new JsonResult(0, localeMessage("code.admin.theme.upload-failed"));
|
||||
} finally {
|
||||
refreshCache();
|
||||
}
|
||||
return new JsonResult(ResultCodeEnum.SUCCESS.getCode(), localeMessageUtil.getMessage("code.admin.theme.upload-success"));
|
||||
return new JsonResult(1, localeMessage("code.admin.theme.upload-success"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -162,20 +161,20 @@ public class ThemeController extends BaseController {
|
|||
public JsonResult cloneFromRemote(@RequestParam(value = "remoteAddr") String remoteAddr,
|
||||
@RequestParam(value = "themeName") String themeName) {
|
||||
if (StrUtil.isBlank(remoteAddr) || StrUtil.isBlank(themeName)) {
|
||||
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.common.info-no-complete"));
|
||||
return new JsonResult(0, localeMessage("code.admin.common.info-no-complete"));
|
||||
}
|
||||
try {
|
||||
final String cmdResult = RuntimeUtil.execForStr("git clone " + remoteAddr + " " + ThemeUtils.getUsersThemesPath().getAbsolutePath() + "/" + themeName);
|
||||
if (NOT_FOUND_GIT.equals(cmdResult)) {
|
||||
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.theme.no-git"));
|
||||
if ("".equals(cmdResult)) {
|
||||
return new JsonResult(0, localeMessage("code.admin.theme.no-git"));
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
} catch (Exception e) {
|
||||
log.error("Cloning theme failed: {}", e.getMessage());
|
||||
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.theme.clone-theme-failed") + e.getMessage());
|
||||
}finally {
|
||||
return new JsonResult(0, localeMessage("code.admin.theme.clone-theme-failed"));
|
||||
} finally {
|
||||
refreshCache();
|
||||
}
|
||||
return new JsonResult(ResultCodeEnum.SUCCESS.getCode(), localeMessageUtil.getMessage("code.admin.common.install-success"));
|
||||
return new JsonResult(1, localeMessage("code.admin.common.install-success"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -189,16 +188,16 @@ public class ThemeController extends BaseController {
|
|||
public JsonResult pullFromRemote(@RequestParam(value = "themeName") String themeName) {
|
||||
try {
|
||||
final String cmdResult = RuntimeUtil.execForStr("cd " + ThemeUtils.getUsersThemesPath().getAbsolutePath() + "/" + themeName + " && git pull");
|
||||
if (NOT_FOUND_GIT.equals(cmdResult)) {
|
||||
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.theme.no-git"));
|
||||
if ("".equals(cmdResult)) {
|
||||
return new JsonResult(0, localeMessage("code.admin.theme.no-git"));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("Update theme failed: {}", e.getMessage());
|
||||
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.theme.update-theme-failed") + e.getMessage());
|
||||
return new JsonResult(0, localeMessage("code.admin.theme.update-theme-failed"));
|
||||
} finally {
|
||||
refreshCache();
|
||||
}
|
||||
return new JsonResult(ResultCodeEnum.SUCCESS.getCode(), localeMessageUtil.getMessage("code.admin.common.update-success"));
|
||||
return new JsonResult(1, localeMessage("code.admin.common.update-success"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -213,7 +212,7 @@ public class ThemeController extends BaseController {
|
|||
@RequestParam("theme") String theme,
|
||||
@RequestParam("hasUpdate") String hasUpdate) {
|
||||
model.addAttribute("themeDir", theme);
|
||||
if (StrUtil.equals(hasUpdate, TrueFalseEnum.TRUE.getDesc())) {
|
||||
if (StrUtil.equals(hasUpdate, "true")) {
|
||||
model.addAttribute("hasUpdate", true);
|
||||
} else {
|
||||
model.addAttribute("hasUpdate", false);
|
||||
|
@ -270,20 +269,20 @@ public class ThemeController extends BaseController {
|
|||
public JsonResult saveTpl(@RequestParam("tplName") String tplName,
|
||||
@RequestParam("tplContent") String tplContent) {
|
||||
if (StrUtil.isBlank(tplContent)) {
|
||||
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.theme.edit.no-content"));
|
||||
return new JsonResult(0, localeMessage("code.admin.theme.edit.no-content"));
|
||||
}
|
||||
try {
|
||||
final StrBuilder themePath = new StrBuilder(ThemeUtils.getUsersThemesPath().getAbsolutePath());
|
||||
themePath.append(BaseFrontController.THEME);
|
||||
themePath.append("/");
|
||||
themePath.append(tplName);
|
||||
final File tplPath = new File(themePath);
|
||||
final File tplPath = new File(themePath.toString());
|
||||
final FileWriter fileWriter = new FileWriter(tplPath);
|
||||
fileWriter.write(tplContent);
|
||||
} catch (Exception e) {
|
||||
log.error("Template save failed: {}", e.getMessage());
|
||||
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.common.save-failed"));
|
||||
return new JsonResult(0, localeMessage("code.admin.common.save-failed"));
|
||||
}
|
||||
return new JsonResult(ResultCodeEnum.SUCCESS.getCode(), localeMessageUtil.getMessage("code.admin.common.save-success"));
|
||||
return new JsonResult(1, localeMessage("code.admin.common.save-success"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,11 +17,11 @@ import static cc.ryanc.halo.model.support.HaloConst.THEMES;
|
|||
*/
|
||||
public abstract class BaseController {
|
||||
|
||||
private final Configuration configuration;
|
||||
public final Configuration configuration;
|
||||
|
||||
private final OptionService optionService;
|
||||
public final OptionService optionService;
|
||||
|
||||
private final LocaleMessageUtil localeMessageUtil;
|
||||
public final LocaleMessageUtil localeMessageUtil;
|
||||
|
||||
public BaseController(Configuration configuration,
|
||||
OptionService optionService,
|
||||
|
@ -45,4 +45,25 @@ public abstract class BaseController {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get message with code
|
||||
*
|
||||
* @param code code
|
||||
* @return String
|
||||
*/
|
||||
public String localeMessage(String code) {
|
||||
return localeMessageUtil.getMessage(code);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get message with code and params
|
||||
*
|
||||
* @param code code
|
||||
* @param args args
|
||||
* @return String
|
||||
*/
|
||||
public String localeMessage(String code, Object[] args) {
|
||||
return localeMessageUtil.getMessage(code, args);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,194 @@
|
|||
package cc.ryanc.halo.web.controller.core;
|
||||
|
||||
import cc.ryanc.halo.model.entity.*;
|
||||
import cc.ryanc.halo.model.enums.CommentStatus;
|
||||
import cc.ryanc.halo.model.support.JsonResult;
|
||||
import cc.ryanc.halo.service.*;
|
||||
import cc.ryanc.halo.utils.MarkdownUtils;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import freemarker.template.Configuration;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cc.ryanc.halo.model.support.HaloConst.OPTIONS;
|
||||
|
||||
/**
|
||||
* @author : RYAN0UP
|
||||
* @date : 2019-03-17
|
||||
*/
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequestMapping("/install")
|
||||
public class InstallController {
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final CategoryService categoryService;
|
||||
|
||||
private final PostService postService;
|
||||
|
||||
private final CommentService commentService;
|
||||
|
||||
private final OptionService optionService;
|
||||
|
||||
private final MenuService menuService;
|
||||
|
||||
private final Configuration configuration;
|
||||
|
||||
public InstallController(UserService userService,
|
||||
CategoryService categoryService,
|
||||
PostService postService,
|
||||
CommentService commentService,
|
||||
OptionService optionService,
|
||||
MenuService menuService,
|
||||
Configuration configuration) {
|
||||
this.userService = userService;
|
||||
this.categoryService = categoryService;
|
||||
this.postService = postService;
|
||||
this.commentService = commentService;
|
||||
this.optionService = optionService;
|
||||
this.menuService = menuService;
|
||||
this.configuration = configuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render install page
|
||||
*
|
||||
* @param model model
|
||||
* @return template path: common/install.ftl
|
||||
*/
|
||||
@GetMapping
|
||||
public String install(Model model) {
|
||||
try {
|
||||
if (StrUtil.equals("true", OPTIONS.get("is_install"))) {
|
||||
model.addAttribute("isInstall", true);
|
||||
} else {
|
||||
model.addAttribute("isInstall", false);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
return "common/install";
|
||||
}
|
||||
|
||||
/**
|
||||
* Do install
|
||||
*
|
||||
* @param blogLocale language
|
||||
* @param userName username
|
||||
* @param userDisplayName nickname
|
||||
* @param userEmail user email
|
||||
* @param userPwd user password
|
||||
* @param request request
|
||||
* @return JsonResult
|
||||
*/
|
||||
@PostMapping(value = "/do")
|
||||
@ResponseBody
|
||||
public JsonResult doInstall(@RequestParam("blogLocale") String blogLocale,
|
||||
@RequestParam("blogTitle") String blogTitle,
|
||||
@RequestParam("blogUrl") String blogUrl,
|
||||
@RequestParam("userName") String userName,
|
||||
@RequestParam("userDisplayName") String userDisplayName,
|
||||
@RequestParam("userEmail") String userEmail,
|
||||
@RequestParam("userPwd") String userPwd,
|
||||
HttpServletRequest request) {
|
||||
try {
|
||||
if (StrUtil.equals("true", OPTIONS.get("is_install"))) {
|
||||
return new JsonResult(0, "该博客已初始化,不能再次安装!");
|
||||
}
|
||||
//创建新的用户
|
||||
final User user = new User();
|
||||
user.setUsername(userName);
|
||||
if (StrUtil.isBlank(userDisplayName)) {
|
||||
userDisplayName = userName;
|
||||
}
|
||||
user.setNickname(userDisplayName);
|
||||
user.setEmail(userEmail);
|
||||
user.setPassword(SecureUtil.md5(userPwd));
|
||||
userService.create(user);
|
||||
|
||||
//默认分类
|
||||
final Category category = new Category();
|
||||
category.setName("未分类");
|
||||
category.setSnakeName("default");
|
||||
category.setDescription("未分类");
|
||||
categoryService.create(category);
|
||||
|
||||
//第一篇文章
|
||||
final Post post = new Post();
|
||||
final List<Category> categories = new ArrayList<>(1);
|
||||
categories.add(category);
|
||||
post.setTitle("Hello Halo!");
|
||||
post.setOriginalContent("# Hello Halo!\n" +
|
||||
"欢迎使用Halo进行创作,删除这篇文章后赶紧开始吧。");
|
||||
post.setFormatContent(MarkdownUtils.renderMarkdown(post.getOriginalContent()));
|
||||
post.setSummary("欢迎使用Halo进行创作,删除这篇文章后赶紧开始吧。");
|
||||
post.setStatus(0);
|
||||
post.setUrl("hello-halo");
|
||||
post.setDisallowComment(1);
|
||||
post.setThumbnail("/static/halo-frontend/images/thumbnail/thumbnail-" + RandomUtil.randomInt(1, 11) + ".jpg");
|
||||
postService.create(post);
|
||||
|
||||
//第一个评论
|
||||
final Comment comment = new Comment();
|
||||
comment.setAuthor("ruibaby");
|
||||
comment.setEmail("i@ryanc.cc");
|
||||
comment.setAuthorUrl("https://ryanc.cc");
|
||||
comment.setIpAddress("127.0.0.1");
|
||||
comment.setGavatarMd5(SecureUtil.md5("i@ryanc.cc"));
|
||||
comment.setContent("欢迎,欢迎!");
|
||||
comment.setStatus(CommentStatus.PUBLISHED);
|
||||
comment.setUserAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36");
|
||||
comment.setIsAdmin(false);
|
||||
commentService.create(comment);
|
||||
|
||||
final Map<String, String> options = new HashMap<>();
|
||||
// options.put(BlogPropertiesEnum.IS_INSTALL.getProp(), TrueFalseEnum.TRUE.getDesc());
|
||||
// options.put(BlogPropertiesEnum.BLOG_LOCALE.getProp(), blogLocale);
|
||||
// options.put(BlogPropertiesEnum.BLOG_TITLE.getProp(), blogTitle);
|
||||
// options.put(BlogPropertiesEnum.BLOG_URL.getProp(), blogUrl);
|
||||
// options.put(BlogPropertiesEnum.THEME.getProp(), "anatole");
|
||||
// options.put(BlogPropertiesEnum.BLOG_START.getProp(), DateUtil.format(DateUtil.date(), "yyyy-MM-dd"));
|
||||
// options.put(BlogPropertiesEnum.SMTP_EMAIL_ENABLE.getProp(), TrueFalseEnum.FALSE.getDesc());
|
||||
// options.put(BlogPropertiesEnum.NEW_COMMENT_NOTICE.getProp(), TrueFalseEnum.FALSE.getDesc());
|
||||
// options.put(BlogPropertiesEnum.COMMENT_PASS_NOTICE.getProp(), TrueFalseEnum.FALSE.getDesc());
|
||||
// options.put(BlogPropertiesEnum.COMMENT_REPLY_NOTICE.getProp(), TrueFalseEnum.FALSE.getDesc());
|
||||
// options.put(BlogPropertiesEnum.ATTACH_LOC.getProp(), AttachLocationEnum.SERVER.getDesc());
|
||||
optionService.saveOptions(options);
|
||||
|
||||
//更新日志
|
||||
// logsService.save(LogsRecord.INSTALL, "安装成功,欢迎使用Halo。", request);
|
||||
|
||||
final Menu menuIndex = new Menu();
|
||||
menuIndex.setName("首页");
|
||||
menuIndex.setUrl("/");
|
||||
menuIndex.setSort(1);
|
||||
menuService.create(menuIndex);
|
||||
|
||||
final Menu menuArchive = new Menu();
|
||||
menuArchive.setName("归档");
|
||||
menuArchive.setUrl("/archives");
|
||||
menuArchive.setSort(2);
|
||||
menuService.create(menuArchive);
|
||||
|
||||
OPTIONS.clear();
|
||||
OPTIONS = optionService.listOptions();
|
||||
configuration.setSharedVariable("options", OPTIONS);
|
||||
// configuration.setSharedVariable("user", userService.findUser());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return new JsonResult(0, e.getMessage());
|
||||
}
|
||||
return new JsonResult(1, "安装成功!");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue