主题切换支持

主题切换支持
  黑色经典
  薄荷清新
  激情紫荆
This commit is contained in:
shimingxy
2020-05-10 13:48:13 +08:00
parent 1f4290af4e
commit aa58a6d820
84 changed files with 37860 additions and 3581 deletions

View File

@@ -1,11 +1,15 @@
package org.maxkey.web.contorller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.maxkey.constants.ConstantsOperateMessage;
import org.maxkey.crypto.ReciprocalUtils;
import org.maxkey.crypto.password.PasswordReciprocal;
import org.maxkey.dao.service.UserInfoService;
import org.maxkey.domain.UserInfo;
import org.maxkey.util.StringUtils;
import org.maxkey.web.WebConstants;
import org.maxkey.web.WebContext;
import org.maxkey.web.message.Message;
import org.maxkey.web.message.MessageType;
@@ -149,11 +153,14 @@ public class SafeController {
@ResponseBody
@RequestMapping(value="/setting")
public Message setting(
HttpServletRequest request,
HttpServletResponse response,
@RequestParam("authnType") String authnType,
@RequestParam("mobile") String mobile,
@RequestParam("mobileVerify") String mobileVerify,
@RequestParam("email") String email,
@RequestParam("emailVerify") String emailVerify) {
@RequestParam("emailVerify") String emailVerify,
@RequestParam("theme") String theme) {
UserInfo userInfo =WebContext.getUserInfo();
userInfo.setAuthnType(Integer.parseInt(authnType));
userInfoService.changeAuthnType(userInfo);
@@ -162,8 +169,13 @@ public class SafeController {
userInfoService.changeMobile(userInfo);
userInfo.setEmail(email);
userInfo.setTheme(theme);
WebContext.setCookie(response, WebConstants.THEME_COOKIE_NAME, theme, 0);
userInfoService.changeEmail(userInfo);
return new Message(WebContext.getI18nValue(ConstantsOperateMessage.UPDATE_SUCCESS),MessageType.success);
}