提交 71695df4 编写于 作者: U u014427391

加上Thymeleaf配置文件&修缮一下用户中心功能

上级 de8f68ea
......@@ -31,4 +31,6 @@
and password = #{password}
</select>
</mapper>
\ No newline at end of file
package com.muses.taoshop.manager.config;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistrar;
import org.springframework.format.FormatterRegistry;
import org.springframework.format.datetime.DateFormatter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
/**
* <pre>
* Thymeleaf模板引擎配置
* </pre>
*
* @author nicky
* @version 1.00.00
* <pre>
* 修改记录
* 修改后版本: 修改人: 修改日期: 2018.09.22 10:50 修改内容:
* </pre>
*/
@Configuration
public class ThymeleafConfig extends WebMvcConfigurerAdapter implements ApplicationContextAware{
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
}
@Override
public void addFormatters(final FormatterRegistry registry){
super.addFormatters(registry);
registry.addFormatter(dateFormatter());
}
@Bean
public DateFormatter dateFormatter(){
return new MyDateFormatter();
}
class MyDateFormatter extends DateFormatter {
@Override
public String print(Date date, Locale locale) {
//return super.print(date, locale);
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date);
}
}
}
......@@ -159,12 +159,12 @@ public class LoginController extends BaseController {
// replaceAll("menuName","name").replaceAll("hasSubMenu","checked");
// mv.addObject("menus",json);
mv.setViewName("admin/frame/index");
}else{
//会话失效,返回登录界面
mv.setViewName("login");
}
mv.setViewName("admin/frame/index");
return mv;
}
......
......@@ -6,15 +6,10 @@
<title>电商运营平台</title>
<link th:href="@{../static/css/style.css}" rel="stylesheet" />
<link th:href="@{../static/css/backend.css}" rel="stylesheet" />
<link th:href="@{../static/css/page/backend/order_manage.css}" rel="stylesheet" />
<link th:href="@{../static/css/page/backend/account_center.css}" rel="stylesheet" />
<link th:href="@{../plugins/datepicker/css/bootstrap.css}" rel="stylesheet" />
<link th:href="@{../plugins/datepicker/css/bootstrap-datepicker.css}" rel="stylesheet" />
<link th:href="@{../plugins/select2/css/select2.min.css}" rel="stylesheet" />
<script type="text/javascript" th:src="@{../static/js/jquery.js}"></script>
<script type="text/javascript" th:src="@{../static/js/common.js}"></script>
<script type="text/javascript" th:src="@{../plugins/datepicker/js/bootstrap-datepicker.js}"></script>
<script type="text/javascript" th:src="@{../plugins/datepicker/locales/bootstrap-datepicker.zh-CN.min.js}"></script>
<script type="text/javascript" th:src="@{../static/js/jquery.pagination.js}"></script>
<script type="text/javascript" th:src="@{../plugins/select2/js/select2.min.js}"></script>
</head>
</html>
\ No newline at end of file
......@@ -13,7 +13,8 @@
<div class="main-wrap-bk clearfix">
<!-- 左边菜单栏 -->
<div class="" th:replace="admin/frame/sider_bar_bk :: .sider-bar-bk"></div>
<div class="bd-content-wrap" th:replace="admin/orders/order_content_wrap :: .bd-content-wrap"></div>
<!-- 用户中心 -->
<div class="bd-content-wrap" th:replace="admin/user/user_content_wrap :: .bd-content-wrap"></div>
</div>
</div>
......
<div class="bd-content-wrap">
<div class="bd-content-wrap" xmlns:th="http://www.w3.org/1999/xhtml">
<div class="bd-content">
<div class="title-left-line">账户中心</div>
<div class="basic-info">
......@@ -7,7 +7,7 @@
<div class="form-kv clearfix">
<div class="form-kv-label">单位账号:</div>
<div class="form-content">
<span>kie*****@163.com</span>
<span th:text="${session.sessionUser.username}">kie*****@163.com</span>
</div>
</div>
<div class="form-kv clearfix">
......@@ -21,21 +21,15 @@
<div class="form-kv clearfix">
<div class="form-kv-label">单位管理员:</div>
<div class="form-content">
<span>管理员</span>
<span th:text="${session.sessionUser.mark}">管理员</span>
<i class="iconfont">&#xe652;</i>
<span class="status">已认证</span>
</div>
</div>
<div class="form-kv clearfix">
<div class="form-kv-label">联系电话:</div>
<div class="form-content">
<span>0755-****5678</span>
</div>
</div>
<div class="form-kv clearfix">
<div class="form-kv-label">手机号码:</div>
<div class="form-content">
<span>137****8564</span>
<span th:text="${session.sessionUser.phone}">137****8564</span>
<i class="iconfont">&#xe652;</i>
<span class="status">已认证</span>
</div>
......@@ -43,11 +37,17 @@
<div class="form-kv clearfix">
<div class="form-kv-label">邮箱地址:</div>
<div class="form-content">
<span>kie*****@163.com</span>
<span th:text="${session.sessionUser.email}">kie*****@163.com</span>
<i class="iconfont">&#xe652;</i>
<span class="status">已认证</span>
</div>
</div>
<div class="form-kv clearfix">
<div class="form-kv-label">上次登录:</div>
<div class="form-content">
<span th:text="${{session.sessionUser.lastLogin}}">2018-08-08</span>
</div>
</div>
</div>
</div>
<div class="safe-setting">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册