Browse Source

Merge remote-tracking branch 'origin/master'

yfh 1 day ago
parent
commit
7691805bd4

+ 1 - 1
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -1822,7 +1822,7 @@ public class FsUserCourseVideoServiceImpl implements IFsUserCourseVideoService
         redPacketLog.setWatchLogId(log.getLogId() !=null ? log.getLogId() : null);
         redPacketLog.setPeriodId(param.getPeriodId());
         redPacketLogMapper.insertFsCourseRedPacketLog(redPacketLog);
-        return R.ok("奖励发放成功").put("rewardType",config.getRewardType());
+        return R.ok("积分奖励发放成功").put("rewardType",config.getRewardType());
     }
 
     @Override

+ 3 - 0
fs-service/src/main/java/com/fs/course/vo/UserWatchLogListVo.java

@@ -25,6 +25,9 @@ public class UserWatchLogListVo {
     private String projectName;
     private String courseName;
     private String videoName;
+    //所属企微
     private String qwUserName;
+    //所属企微主体
+    private String corpName;
 
 }

+ 6 - 6
fs-service/src/main/resources/application-common.yml

@@ -14,12 +14,12 @@ fs:
   addressEnabled: false
   # 验证码类型 math 数组计算 char 字符验证
   captchaType: math
-  jwt:
-    # 加密秘钥
-    secret: f4e2e52034348f86b67cde581c0f9eb5
-    # token有效时长,7天,单位秒
-    expire: 31536000
-    header: AppToken
+#  jwt:
+#    # 加密秘钥
+#    secret: f4e2e52034348f86b67cde581c0f9eb5
+#    # token有效时长,7天,单位秒
+#    expire: 31536000
+#    header: AppToken
 # 开发环境配置
 server:
   servlet:

+ 6 - 0
fs-service/src/main/resources/application-config-druid-hdt.yml

@@ -65,6 +65,12 @@ watch:
 fs :
   commonApi: http://192.168.0.70:8010
   h5CommonApi: http://119.29.195.254:8010
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9eb6
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 nuonuo:
   key: 10924508
   secret: A2EB20764D304D16

+ 6 - 0
fs-service/src/main/resources/application-config-druid-hyt.yml

@@ -57,6 +57,12 @@ watch:
 fs :
   commonApi: http://192.168.0.18:7771
   h5CommonApi: http://192.168.0.18:7771
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9e16
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 nuonuo:
   key: 10924509
   secret: A2EB20764D304D16

+ 6 - 0
fs-service/src/main/resources/application-config-druid-jnmy.yml

@@ -60,6 +60,12 @@ watch:
 fs :
   commonApi: http://192.168.0.18:7771
   h5CommonApi: http://192.168.0.18:7771
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9eb8
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 nuonuo:
   key: 10924508
   secret: A2EB20764D304D16

+ 6 - 0
fs-service/src/main/resources/application-config-druid-jnsyj.yml

@@ -65,6 +65,12 @@ watch:
 fs :
   commonApi: http://172.16.0.29:8010
   h5CommonApi: http://119.29.195.254:8010
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9e19
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 nuonuo:
   key: 10924508
   secret: A2EB20764D304D16

+ 6 - 0
fs-service/src/main/resources/application-config-druid-nmgyt.yml

@@ -65,6 +65,12 @@ watch:
 fs :
   commonApi: http://172.16.0.9:8010
   h5CommonApi: http://192.168.0.18:7771
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9e17
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 nuonuo:
   key: 10924508
   secret: A2EB20764D304D16

+ 6 - 0
fs-service/src/main/resources/application-config-myhk.yml

@@ -65,6 +65,12 @@ watch:
 
 fs :
   commonApi: http://172.27.0.7:8010
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9e10
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 nuonuo:
   key: 10924508
   secret: A2EB20764D304D16

+ 6 - 0
fs-service/src/main/resources/application-config-zkzh.yml

@@ -134,6 +134,12 @@ watch:
 
 fs:
   commonApi: http://172.21.76.167:8010
+  jwt:
+    # 加密秘钥
+    secret: f4e2e52034348f86b67cde581c0f9eb9
+    # token有效时长,7天,单位秒
+    expire: 31536000
+    header: AppToken
 nuonuo:
   key: 10924508
   secret: A2EB20764D304D16

+ 3 - 1
fs-service/src/main/resources/mapper/course/FsUserCompanyBindMapper.xml

@@ -135,7 +135,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         c.dict_label projectName,
         e.course_name,
         IF(g.company_user_id = #{userId}, g.qw_user_name, '其他') qwUserName,
-        f.title videoName
+        f.title videoName,
+        qc.corp_name
         from
         fs_user_company_bind a
         left join fs_user b on a.fs_user_id = b.user_id
@@ -143,6 +144,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         left join fs_user_course e on a.course_id = e.course_id
         left join fs_user_course_video f on a.video_id = f.video_id
         left join qw_user g on g.id = a.qw_user_id
+        left join qw_company qc on qc.id = a.qw_company_id
         <where>
             <if test="externalUserId != null">
                 and a.qw_external_contact_id = #{externalUserId}

+ 1 - 0
fs-user-app/src/main/java/com/fs/app/controller/course/CourseFsUserController.java

@@ -113,6 +113,7 @@ public class CourseFsUserController extends AppBaseController {
     @ApiOperation("答题")
     @PostMapping("/courseAnswer")
     @UserOperationLog(operationType = FsUserOperationEnum.ANSWER)
+    @RepeatSubmit
     public R courseAnswer(@RequestBody FsCourseQuestionAnswerUParam param){
         if (ObjectUtil.isEmpty(param.getUserId())){
             Long userId = Long.parseLong(getUserId());

+ 32 - 0
fs-user-app/src/main/java/com/fs/app/controller/course/CourseQwController.java

@@ -7,6 +7,7 @@ import com.fs.app.annotation.Login;
 import com.fs.app.controller.AppBaseController;
 import com.fs.common.annotation.RepeatSubmit;
 import com.fs.common.core.domain.R;
+import com.fs.common.utils.ServletUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.core.utils.OrderCodeUtils;
 import com.fs.course.config.CourseConfig;
@@ -24,6 +25,7 @@ import com.fs.system.service.ISysConfigService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.hc.openapi.tool.fastjson.JSON;
+import io.jsonwebtoken.Claims;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -36,7 +38,9 @@ import org.springframework.web.bind.annotation.*;
 import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 @Api("企微看课接口")
 @RestController
@@ -413,4 +417,32 @@ public class CourseQwController extends AppBaseController {
         return R.ok().put("data",course);
     }
 
+
+    @ApiOperation("检测是否登录")
+    @GetMapping("/checkLogin")
+    public R checkLogin(){
+        try {
+            HttpServletRequest request = ServletUtils.getRequest();
+            //获取用户凭证
+            String token = request.getHeader(jwtUtils.getHeader());
+            if(StringUtils.isBlank(token)){
+                token = request.getParameter(jwtUtils.getHeader());
+            }
+            //检查token是否存在
+            if (StringUtils.isBlank(token)) {
+                return R.error(4001, "登录凭证不能为空,重新授权");
+            }
+            Claims claims=jwtUtils.getClaimByToken(token);
+            if(claims==null || jwtUtils.isTokenExpired(claims.getExpiration())){
+                return R.error(4004,"回传token校验失败,重新授权");
+            }
+            return R.ok();
+
+        }catch (Exception e){
+            logger.error("检测登录状态异常: {}", e.getMessage(), e);
+            return R.error("系统异常,请稍后重试");
+        }
+
+    }
+
 }

+ 1 - 1
fs-user-app/src/main/java/com/fs/app/utils/JwtUtils.java

@@ -49,7 +49,7 @@ public class JwtUtils {
                     .parseClaimsJws(token)
                     .getBody();
         }catch (Exception e){
-            logger.debug("validate is token error ", e);
+            logger.error("验证令牌错误", e);
             return null;
         }
     }