课程购买逻辑判断

This commit is contained in:
zhujj 2019-01-25 18:10:09 +08:00
parent a0183414a9
commit 87f76ce893
3 changed files with 7 additions and 12 deletions

View File

@ -26,6 +26,7 @@ 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.servlet.ModelAndView;
import javax.servlet.http.Cookie;
import java.util.List;
@ -56,12 +57,6 @@ public class CmsUserController {
return prefix + "/user/login";
}
@RequestMapping("/user/out")
public String out(ModelMap map) {
ShiroUtils.logout();
return "redirect:"+prefix+"/index";
}
@RequestMapping("/user/reg.html")
public String reg(ModelMap map) {
map.put( "user", ShiroUtils.getSysUser() );

View File

@ -186,8 +186,8 @@
<input type="button" onclick="goStudy()" class="hb-ui-btn" value="加入学习">
<em>有效期:
<span id="shixian" th:if="${trainCourse.price==0}" th:text="'永久'"></span>
<span id="shixian" th:if="${trainCourse.price>0}" th:text="${courseDays}"></span>
(天)</em>
<span id="shixian" th:if="${trainCourse.price>0}" th:text="${courseDays}+'(天)'"></span>
</em>
</div>
<div class="remark" th:text="${trainCourse.description}">
@ -210,8 +210,8 @@
<div class="layui-tab-item layui-show">
<ul >
<li th:if="trainCourseSections" th:each="sections,obj:${trainCourseSections}" >
<a th:if="${courseAuth}" th:id="'section'+${obj.index+1}" th:href="@{'/web/course/courseSections.html/'+${sections.id}}">
<span th:text="${sections.name}"> </span>
<a th:if="${trainCourse.price==0 || courseAuth}" th:id="'section'+${obj.index+1}" th:href="@{'/web/course/courseSections.html/'+${sections.id}}">
<span th:text="${sections.name}+'2'"> </span>
</a>
<a th:if="!${courseAuth}" onclick="shop()">
<span th:text="${sections.name}"> </span>
@ -247,7 +247,7 @@
var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
});
function goStudy() {
$("#section1").click();
document.getElementById("section1").click();
}
function shop() {
var userId="[[${user?.userId}]]";

View File

@ -192,7 +192,7 @@
<dd><a th:href="@{/web/user/home.html}"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;">&#xe68e;</i>我的主页</a></dd>
<dd><a th:href="@{/web/user/errorquestion.html}"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;">&#xe63c;</i>我的错题本</a></dd>
<dd><a th:href="@{/web/user/collect.html}"><i class="layui-icon" style="margin-left: 2px; font-size: 22px;">&#xe600;</i>我的收藏</a></dd>
<dd><a th:href="@{/web/user/out}" style="text-align: center;">退出</a></dd>
<dd><a th:href="@{/logout}" style="text-align: center;">退出</a></dd>
</dl>
</li>
<script>