• 大小: 2.31M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-06
  • 语言: 其他
  • 标签: 其他  

资源简介

dashufacescan.rar

资源截图

代码片段和文件信息

package controller;

import java.io.IOException;
import java.net.URLEncoder;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.tz.IOPdemo.sysmanage.utils.GetToken;
import com.tz.IOPdemo.sysmanage.utils.HttpUtil;

import net.sf.json.JSONArray;
import net.sf.json.JSONobject;
import utils.DbUtil;

/*
 * 登录请求处理类
 */
@WebServlet(“/login“)//指定前端页面要访问的路径
public class LoginController extends HttpServlet{

private static String access_token;
static String apikey = “rpETmGyQ70ahjfIlWxjBYPtq“;
static String ecretKey = “T4uprWNx8tK2EmbpwLi1TLynG7nHzTAo“;
private static final String MACTCHURL = “https://aip.baidubce.com/rest/2.0/face/v2/match“;
static { //只在类执行时加载一次
access_token = GetToken.getToken(apikeyecretKey);
}

@Override
protected void doPost(HttpServletRequest req HttpServletResponse resp) throws ServletException IOException {
boolean flag = false;
//接收参数
String base64 = req.getParameter(“base64“);
System.out.println(base64);
//取出本地数据
String sql=“select base64 from user where id =?“;
String base64ById = DbUtil.getbase64ById(sql 1);
//进行参数对比
            //加密
String parm=URLEncoder.encode(“images“ “UTF-8“)+“=“+URLEncoder.encode(base64+““+base64ById“utf-8“);
try {
String result = HttpUtil.post(MACTCHURL access_token parm);
JSONobject jsonobject = JSONobject.fromobject(result);
JSONArray jsonArray = jsonobject.getJSONArray(“result“);
JSONobject jsonobject2 = jsonArray.getJSONobject(0);
double double1 = jsonobject2.getDouble(“score“);
System.out.println(double1);
System.out.println(result);
if(double1>90){
flag=true;
}
} catch (Exception e) {
e.printStackTrace();
}finally{
if(flag){
resp.getWriter().print(“true“);
}else{
resp.getWriter().print(“false“);
}
}

}
//获取前端页面传递过来的参数  三个步骤  extends  声明   实现方法

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1731  2017-10-18 12:44  dashufacescan\.classpath

     文件       1046  2017-10-20 11:44  dashufacescan\.project

     文件        567  2017-10-16 22:46  dashufacescan\.settings\.jsdtscope

     文件         96  2017-11-14 09:46  dashufacescan\.settings\org.eclipse.core.resources.prefs

     文件        364  2017-10-16 22:46  dashufacescan\.settings\org.eclipse.jdt.core.prefs

     文件        491  2017-10-20 11:44  dashufacescan\.settings\org.eclipse.wst.common.component

     文件        305  2017-10-16 22:46  dashufacescan\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2017-10-16 22:46  dashufacescan\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2017-10-16 22:46  dashufacescan\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       3503  2017-10-19 09:32  dashufacescan\build\classes\controller\LoginController.class

     文件         91  2017-10-18 20:47  dashufacescan\build\classes\db.properties

     文件       8918  2017-10-19 00:14  dashufacescan\build\classes\utils\DbUtil.class

     文件        320  2017-10-19 00:14  dashufacescan\build\classes\utils\RowMapper.class

     文件       2215  2017-11-14 09:50  dashufacescan\src\controller\LoginController.java

     文件         96  2017-11-14 09:50  dashufacescan\src\db.properties

     文件       8750  2017-11-14 09:51  dashufacescan\src\utils\DbUtil.java

     文件        181  2017-11-14 09:50  dashufacescan\src\utils\RowMapper.java

     文件      11656  2017-11-07 15:45  dashufacescan\WebContent\img\annandashu.jpg

     文件     411501  2017-10-17 19:36  dashufacescan\WebContent\img\bg.jpg

     文件       5157  2017-10-19 00:23  dashufacescan\WebContent\img\scan.png

     文件       3233  2017-11-07 15:46  dashufacescan\WebContent\index.jsp

     文件      86709  2017-10-17 23:08  dashufacescan\WebContent\js\jquery-3.1.1.min.js

     文件         39  2017-10-16 22:46  dashufacescan\WebContent\meta-INF\MANIFEST.MF

     文件     231320  2017-10-16 23:22  dashufacescan\WebContent\WEB-INF\lib\commons-beanutils-1.8.0.jar

     文件     571259  2017-10-16 23:22  dashufacescan\WebContent\WEB-INF\lib\commons-collections-3.2.jar

     文件     261809  2017-10-16 23:22  dashufacescan\WebContent\WEB-INF\lib\commons-lang-2.4.jar

     文件      61829  2017-10-16 23:22  dashufacescan\WebContent\WEB-INF\lib\commons-logging-1.2.jar

     文件      86487  2017-10-16 23:22  dashufacescan\WebContent\WEB-INF\lib\ezmorph-1.0.6.jar

     文件      41785  2017-10-16 23:22  dashufacescan\WebContent\WEB-INF\lib\face_sdk-1.3.4.jar

     文件      37901  2017-10-16 23:22  dashufacescan\WebContent\WEB-INF\lib\imagecensor_sdk-2.0.0.jar

............此处省略23个文件信息

评论

共有 条评论