Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
24c324ea36
|
|
@ -31,10 +31,7 @@ import org.slf4j.LoggerFactory;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import sun.awt.image.IntegerComponentRaster;
|
||||
|
||||
|
|
@ -49,6 +46,7 @@ import java.util.List;
|
|||
*/
|
||||
@Controller
|
||||
@RequestMapping("/web")
|
||||
@SessionAttributes("user")
|
||||
public class CmsUserController {
|
||||
private static final Logger log = LoggerFactory.getLogger( CmsUserController.class );
|
||||
|
||||
|
|
@ -110,6 +108,7 @@ public class CmsUserController {
|
|||
@RequestMapping("/user/index.html")
|
||||
public String webUserIndex(ModelMap map) {
|
||||
map.put( "user", ShiroUtils.getSysUser() );
|
||||
map.addAttribute("user", ShiroUtils.getSysUser());
|
||||
return prefix + "/user/set";
|
||||
}
|
||||
@RequestMapping("/user/home.html")
|
||||
|
|
@ -168,8 +167,11 @@ public class CmsUserController {
|
|||
@ResponseBody
|
||||
public AjaxResult addCollectionquestion(String questionId) {
|
||||
SysUser sysUser = ShiroUtils.getSysUser();
|
||||
examUserCollectionQuestionService.insertSelectiveBySelf(Integer.parseInt(questionId),sysUser);
|
||||
AjaxResult success = AjaxResult.success("插入成功");
|
||||
int i = examUserCollectionQuestionService.insertSelectiveBySelf(Integer.parseInt(questionId), sysUser);
|
||||
AjaxResult success = AjaxResult.success("收藏成功");
|
||||
if(i==0){
|
||||
success = AjaxResult.success("已收藏,无法重复收藏");
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -173,19 +173,19 @@
|
|||
<ul class="layui-nav fly-nav-user">
|
||||
|
||||
<!-- 未登入的状态 -->
|
||||
<li th:if="${user}==null" class="layui-nav-item">
|
||||
<li th:if="${session.user}==null" class="layui-nav-item">
|
||||
<a class="iconfont icon-touxiang layui-hide-xs" th:href="@{/web/user/login.html}"></a>
|
||||
</li>
|
||||
<li th:if="${user}==null" class="layui-nav-item">
|
||||
<li th:if="${session.user}==null" class="layui-nav-item">
|
||||
<a th:href="@{/web/user/login.html}">登入</a>
|
||||
</li>
|
||||
<li th:if="${user}==null" class="layui-nav-item">
|
||||
<li th:if="${session.user}==null" class="layui-nav-item">
|
||||
<a th:href="@{/web/user/reg.html}">注册</a>
|
||||
</li>
|
||||
<!-- 登入后的状态 -->
|
||||
<li th:if="${user}!=null" class="layui-nav-item">
|
||||
<li th:if="${session.user}!=null" class="layui-nav-item">
|
||||
<a class="fly-nav-avatar" href="javascript:;">
|
||||
<cite class="layui-hide-xs" th:text="${user.userName}"></cite>
|
||||
<cite class="layui-hide-xs" th:text="${session.user.userName}"></cite>
|
||||
<i class="iconfont icon-renzheng layui-hide-xs" title="认证信息:layui 作者"></i>
|
||||
<i class="layui-badge fly-badge-vip layui-hide-xs">VIP</i>
|
||||
<img src="https://tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg">
|
||||
|
|
|
|||
|
|
@ -105,6 +105,8 @@ document.write(unescape("%3Cspan id='cnzz_stat_icon_30088308'%3E%3C/span%3E%3Csc
|
|||
success: function (result) {
|
||||
if (result.code != web_status.SUCCESS) {
|
||||
layer.msg(result.msg, {icon: 2});
|
||||
}else{
|
||||
layer.msg(result.msg, {icon: 1});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -52,6 +52,10 @@ public class ExamUserCollectionQuestionServiceImpl extends AbstractBaseServiceIm
|
|||
ExamUserCollectionQuestion examUserCollectionQuestion = new ExamUserCollectionQuestion();
|
||||
examUserCollectionQuestion.setExamQuestionId( questionId );
|
||||
examUserCollectionQuestion.setVipUserId( sysUser.getUserId().intValue() );
|
||||
List<ExamUserCollectionQuestion> db = examUserCollectionQuestionMapper.select(examUserCollectionQuestion);
|
||||
if(db.size()>0){
|
||||
return 0;
|
||||
}
|
||||
examUserCollectionQuestion.setCreateBy( sysUser.getLoginName() );
|
||||
examUserCollectionQuestion.setCreateDate( new Date() );
|
||||
examUserCollectionQuestion.setDelFlag( "0" );
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select id, title, answer, type, label, category_id, create_by, create_date, update_by, update_date, remarks, del_flag from exam_question
|
||||
<where>
|
||||
<if test="id != null and id != '' "> and id = #{id}</if>
|
||||
<if test="title != null and title != '' "> and title = #{title}</if>
|
||||
<if test="title != null and title != '' "> and title like CONCAT('%',#{title},'%')</if>
|
||||
<if test="answer != null and answer != '' "> and answer = #{answer}</if>
|
||||
<if test="type != null and type != '' "> and type = #{type}</if>
|
||||
<if test="label != null and label != '' "> and label = #{label}</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue