Pārlūkot izejas kodu

投票-bug修复

Hu Jie 7 gadi atpakaļ
vecāks
revīzija
95d994e90e

+ 2 - 2
src/main/java/com/uas/platform/b2c/common/vote/controller/VoteController.java

@@ -63,7 +63,7 @@ public class VoteController {
      * @return
      * @return
      */
      */
     @RequestMapping(value = "/vote", method = RequestMethod.POST)
     @RequestMapping(value = "/vote", method = RequestMethod.POST)
-    public ResultMap vote(Long enUU) {
-        return voteService.vote(enUU);
+    public ResultMap vote(Long enUU, Long userUU) {
+        return voteService.vote(enUU, userUU);
     }
     }
 }
 }

+ 5 - 2
src/main/java/com/uas/platform/b2c/common/vote/service/Impl/VoteServiceImpl.java

@@ -118,7 +118,10 @@ public class VoteServiceImpl implements VoteService {
     }
     }
 
 
     @Override
     @Override
-    public ResultMap vote(Long enUU) {
+    public ResultMap vote(Long enUU, Long userUU) {
+        if (!userUU.equals(SystemSession.getUser().getUserUU())) {
+            return new ResultMap(CodeType.ERROR, "登录异常");
+        }
         Map<String, Object> map = new HashMap<>(4);
         Map<String, Object> map = new HashMap<>(4);
         map.put("userUU", SystemSession.getUser().getUserUU());
         map.put("userUU", SystemSession.getUser().getUserUU());
         map.put("enUU", enUU);
         map.put("enUU", enUU);
@@ -130,7 +133,7 @@ public class VoteServiceImpl implements VoteService {
         } catch (Exception e) {
         } catch (Exception e) {
             LOGGER.error("用户投票出错:" + SystemSession.getUser().getUserUU() +
             LOGGER.error("用户投票出错:" + SystemSession.getUser().getUserUU() +
                     " 投票企业uu:" + enUU + "错误信息" + e.getMessage());
                     " 投票企业uu:" + enUU + "错误信息" + e.getMessage());
-        }
+                }
         return result;
         return result;
     }
     }
 }
 }

+ 1 - 1
src/main/java/com/uas/platform/b2c/common/vote/service/VoteService.java

@@ -32,6 +32,6 @@ public interface VoteService {
      * 用户投票
      * 用户投票
      * @return
      * @return
      */
      */
-    ResultMap vote(Long enUU);
+    ResultMap vote(Long enUU, Long userUU);
 
 
 }
 }

+ 2 - 1
src/main/webapp/WEB-INF/spring/webmvc.xml

@@ -124,7 +124,8 @@
 			<mvc:exclude-mapping path="/vendor/introduction/vendor/**" />
 			<mvc:exclude-mapping path="/vendor/introduction/vendor/**" />
 			<mvc:exclude-mapping path="/vendor/introduction/product/**" />
 			<mvc:exclude-mapping path="/vendor/introduction/product/**" />
 			<mvc:exclude-mapping path="/wx/**"/>
 			<mvc:exclude-mapping path="/wx/**"/>
-			<mvc:exclude-mapping path="/vote/**"/>
+			<mvc:exclude-mapping path="/vote/one"/>
+			<mvc:exclude-mapping path="/vote/all"/>
 			<bean class="com.uas.platform.b2c.core.filter.SSOInterceptor"></bean>
 			<bean class="com.uas.platform.b2c.core.filter.SSOInterceptor"></bean>
 		</mvc:interceptor>
 		</mvc:interceptor>
 		<!-- 对所有的请求拦截,将Session中的User信息设置进SystemSession -->
 		<!-- 对所有的请求拦截,将Session中的User信息设置进SystemSession -->