Merge remote-tracking branch 'origin/master'

This commit is contained in:
李京通 2025-06-05 17:19:39 +08:00
commit 20c12b458d
2 changed files with 8 additions and 3 deletions

View File

@ -150,12 +150,17 @@ public class SysLoginController {
cn.hutool.json.JSONObject matchesJSONObject = face_matches.getJSONObject(i);
Double similarity = matchesJSONObject.getDouble("similarity");
System.out.println("人脸相似度:" + similarity);
if (similarity >= 0.995){
if (similarity >= 0.98){
System.out.println("人脸识别通过");
String substring = imageFile.substring(imageFile.lastIndexOf("/") + 1, imageFile.lastIndexOf("."));
System.out.println("识别用户为" + substring);
AjaxResult ajax = AjaxResult.success();
String token = loginService.loginAppBySms(substring, substring);
String token = null;
try {
token = loginService.loginAppBySms(substring, substring);
} catch (Exception e) {
return AjaxResult.error("未检测到用户信息");
}
JSONObject resJson = new JSONObject();
resJson.put(Constants.TOKEN, token);
resJson.put("user", substring);

View File

@ -121,7 +121,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求
.authorizeRequests()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/register", "/captchaImage","/loginApp","/loginAppBySms","/base/sendMes").permitAll()
.antMatchers("/login", "/register", "/captchaImage","/loginApp","/loginAppBySms","/loginByFace","/base/sendMes").permitAll()
// 静态资源可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()