Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
20c12b458d
|
@ -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);
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue