Commit c29d7140 authored by 陈立彬's avatar 陈立彬

fix

parent d48260ed
......@@ -1153,6 +1153,7 @@ public class AppExamineService {
// 获取数据库考试信息
Integer recordId;
int answeredNum = 0;
ExamineRecordResponseModel examineRecord = examineService.examineRecordDetail(businessNo);
if(Objects.isNull(examineRecord)) {
// 第一次答题,保存考试信息
......@@ -1170,6 +1171,7 @@ public class AppExamineService {
recordId = saveModel.getId();
} else {
recordId = examineRecord.getId();
answeredNum = examineRecord.getAnsweredNum();
}
// 获取有无答题记录
......@@ -1179,7 +1181,7 @@ public class AppExamineService {
// 更新答题数量
ExamineRecordSaveModel saveModel = new ExamineRecordSaveModel();
saveModel.setId(recordId);
saveModel.setAnsweredNum(examineRecord.getAnsweredNum() + 1);
saveModel.setAnsweredNum( answeredNum + 1);
examineService.saveExamineRecord(saveModel);
// 保存单题答题信息
......
......@@ -13,17 +13,23 @@ import cn.breeze.elleai.application.service.AppCommonService;
import cn.breeze.elleai.config.QueryParam;
import cn.breeze.elleai.exception.InternalException;
import cn.breeze.elleai.util.PrivateFileService;
import cn.hutool.core.exceptions.ExceptionUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.google.common.collect.Lists;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
......@@ -39,6 +45,12 @@ public class CommonController {
private final PrivateFileService fileService;
@Value("${sso.user.mock:true}")
private String enableMock;
@Value("${sso.domain:}")
private String ssoBaseUrl;
@Operation(summary = "专有名词详情")
@GetMapping("/proper_noun/detail/{id}")
......@@ -144,4 +156,22 @@ public class CommonController {
}
return ApiResponse.ok(fileList);
}
@Operation(summary = "单点登录")
@GetMapping("/sso")
public void userSSOLogin(@RequestParam("jwt") String token, HttpServletResponse response) {
if (StrUtil.isNotBlank(token)) {
log.info("单点登录:{}", token);
try {
Cookie jwt = new Cookie("jwt", token);
jwt.setPath("/");
jwt.setHttpOnly(true);
response.addCookie(jwt);
response.sendRedirect(ssoBaseUrl + "/elle-ai/1.0.0/index.html");
} catch (IOException e) {
log.error("单点登录异常{}", ExceptionUtil.getMessage(e));
}
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment