Browse Source

Merge remote-tracking branch 'origin/master'

yubin 4 ngày trước cách đây
mục cha
commit
772f6745a7

+ 7 - 1
mall-service/src/main/java/com/txz/mall/controller/appcontroller/JPushController.java

@@ -37,7 +37,13 @@ public class JPushController {
      */
     @PostMapping("bindUser")
     private Result bindUser(@RequestBody @Validated JPushBindRO ro, HttpServletRequest request) {
-        Long userId = authService.getTokenUserId(request);
+        Long userId;
+        try {
+            userId = authService.getTokenUserId(request);
+        } catch (Exception e) {
+            // 未登录会抛异常,场景登录未登录均可
+            userId = null;
+        }
         UserJPush device;
         // 多端推送场景注掉这儿
         if (ObjectUtil.isNotEmpty(userId)) {