whychdw
2021-08-11 ad4dddef7496ccb69b663e34138cdda79abef910
前台提交
3个文件已添加
7个文件已修改
337 ■■■■ 已修改文件
nfdw_stand/WebRoot/classes/com/fgkj/actions/LoginAction.class 补丁 | 查看 | 原始文档 | blame | 历史
nfdw_stand/WebRoot/classes/com/fgkj/dao/impl/User_infImpl$20.class 补丁 | 查看 | 原始文档 | blame | 历史
nfdw_stand/WebRoot/classes/com/fgkj/dao/impl/User_infImpl.class 补丁 | 查看 | 原始文档 | blame | 历史
nfdw_stand/WebRoot/classes/com/fgkj/services/User_infService.class 补丁 | 查看 | 原始文档 | blame | 历史
nfdw_stand/WebRoot/classes/js/SoftUKey.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
nfdw_stand/WebRoot/classes/login.jsp 166 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
nfdw_stand/WebRoot/js/SoftUKey.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
nfdw_stand/WebRoot/login.jsp 167 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
nfdw_stand/WebRoot_photo/null.jpg 补丁 | 查看 | 原始文档 | blame | 历史
nfdw_stand/WebRoot_photo/superuser.jpg 补丁 | 查看 | 原始文档 | blame | 历史
nfdw_stand/WebRoot/classes/com/fgkj/actions/LoginAction.class
Binary files differ
nfdw_stand/WebRoot/classes/com/fgkj/dao/impl/User_infImpl$20.class
Binary files differ
nfdw_stand/WebRoot/classes/com/fgkj/dao/impl/User_infImpl.class
Binary files differ
nfdw_stand/WebRoot/classes/com/fgkj/services/User_infService.class
Binary files differ
nfdw_stand/WebRoot/classes/js/SoftUKey.js
@@ -212,7 +212,7 @@
                    // 设置路径
                    inPath=UK_Data.return_value;//获得返回的UK的路径
                    s_simnew1.GetChipID(inPath);//返回芯片唯一ID
                    s_simnew1.GetProduceDate(inPath);//返回芯片唯一ID
                    break;
                case 2:
                    if(UK_Data.LastError!=0){
nfdw_stand/WebRoot/classes/login.jsp
@@ -197,15 +197,33 @@
        </div>
    </Modal>
    <Modal
            v-model="face.show"
            title="人脸识别登录"
            width="480px"
            @on-visible-change="faceModalChange"
            footer-hide>
        v-model="face.show"
        title="人脸识别登录"
        width="480px"
        @on-visible-change="faceModalChange"
        footer-hide>
        <video ref="video" width="480" height="320" style="display:none"></video>
        <canvas ref="canvas" width="480" height="320"></canvas>
        <p style="text-align:center">{{face.detect}}</p>
    </Modal>
    <Modal
        v-model="status"
        title="图片上传"
        width="480px"
        footer-hide>
        <Upload
            multiple
            :max-size="10240"
            :format="['jpg','jpeg','png']"
            :before-upload="beforeAvatarUpload"
            type="drag"
            action="">
            <div style="padding: 20px 0">
                <Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
                <p style="color:red;">提示:图片大小不超过2MB,图像人脸角度端正,图像清晰;</p>
            </div>
        </Upload>
    </Modal>
</div>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="element-ui/vue.min.js"></script>
@@ -273,7 +291,10 @@
            },
            // ukey对应的用户的登录方式 1为用户名密码 2为人脸
            login_type: 1,
            softUKey: new SoftUKey(SoftKey3W)
            softUKey: new SoftUKey(SoftKey3W),
            status: false,
            UName: '',
            UId: '',
        },
        watch: {
            userfocus: function() {
@@ -322,11 +343,9 @@
                    url: 'LoginAction_getRandom',
                    data: null,
                    success: function(res) {
                        console.log(res);
                        let rs = JSON.parse(res.result);
                        if(rs.code == 1) {
                            let randomNumber = rs.data;
                            console.log(self.softUKey);
                            self.softUKey.getSign(randomNumber, self.checkUKeySign);
                        }else {
                            self.$message.error("服务器连接异常!");
@@ -352,6 +371,7 @@
                            self.checkUser();
                        }else {
                            self.msg = rs.msg;
                            self.checkUser();
                        }
                    },
                    error: function(error) {
@@ -380,7 +400,7 @@
                var UKey_ID = this.info.UKey_ID;
                password = hex_md5(password);
                // 请求后台
                ajax({
                $.ajax({
                    url: 'LoginAction_login',
                    data: "uinf.UName="+user+"&uinf.Upassword="+password+"&uinf.UId=1"+"&uinf.UKey_ID="+UKey_ID,
                    success: function(res) {
@@ -390,11 +410,8 @@
                            //self.loading = true;
                            // 进入首页
                            //self.toIndex(rs.msg);
                            self.login_type = 2;
                            self.$Message.message('success', {
                                content: '静态密码验证成功',
                                duration: 3
                            });
                            //self.login_type = 2;
                            self.checkFaceExist(user);
                        }else {
                            self.msg = rs.msg;
                            if (rs.data) {
@@ -413,6 +430,122 @@
                    }
                });
            },
            checkFaceExist(UName) {
                let self = this;
                $.ajax({
                    type: "post",
                    url: 'LoginAction_faceExist',
                    data: 'json='+JSON.stringify({
                        UName,
                    }),
                    success: function(res) {
                        let rs = JSON.parse(res.result);
                        if(rs.code == 1) {
                            self.$Message.message('success', {
                                content: '静态密码验证成功',
                                duration: 3
                            });
                            self.login_type = 2;
                        }else {
                            self.status = true;
                            self.$Message.message('warning', {
                                content: '用户未录入人脸,请先录入。',
                                duration: 3
                            });
                        }
                        self.UName = UName;
                        self.UId = "1002";
                    },
                    error: function(e){
                        self.$Message.message('warning', {
                            content: '请求网路异常',
                            duration: 3
                        });
                        console.log(e);
                    }
                });
            },
            // 图片上传前
            beforeAvatarUpload(file) {
                let seft = this;
                const isJPG = file.type === 'image/jpeg' || file.type === 'image/png';
                const isLt2M = file.size / 1024 / 1024 < 2;
                if (!isJPG) {
                    seft.$Message.error({
                        duration:3,
                        background: true,
                        content: '上传头像图片只能是 JPG或PNG 格式!'
                    });
                    return false;
                }
                if (!isLt2M) {
                    seft.$Message.error({
                        duration:3,
                        background: true,
                        content: '上传头像图片大小不能超过 2MB!'
                    });
                    return false;
                }
                // 图片转base64
                seft.getBase64(file).then(res=>{
                    seft.imageUrl = res;
                    let jsontemp = {
                        fileData:res,
                        uId:seft.UId,
                        uName:seft.UName
                    }
                    $.ajax({
                        type: 'post',
                        url: 'FaceIdentifyAction_face_add',
                        data: "json="+JSON.stringify(jsontemp),
                        success: function(res) {
                            let rs = JSON.parse(res.result);
                            if(rs.code == 1){
                                //隐藏弹窗
                                seft.status = false;
                                let text = '新增人脸成功!';
                                seft.$Message.success({
                                    duration:3,
                                    background: true,
                                    content: text
                                });
                            }else{
                                seft.$Message.success({
                                    duration:3,
                                    background: true,
                                    content: '上传失败,请重新上传!'
                                });
                            }
                        },
                        error: function(e) {
                            seft.$Message.success({
                                duration:3,
                                background: true,
                                content: '网络请求异常,上传失败!'
                            });
                            console.log(e);
                        }
                    });
                })
                return false
            },
            // 图片转base64
            getBase64(file) {
                return new Promise(function (resolve, reject) {
                    let reader = new FileReader();
                    let imgResult = "";
                    reader.readAsDataURL(file);
                    reader.onload = function () {
                        imgResult = reader.result;
                    };
                    reader.onerror = function (error) {
                        reject(error);
                    };
                    reader.onloadend = function () {
                        resolve(imgResult);
                    };
                });
            },
            ukeyLoad: function(){
                var self = this;
                //如果是IE10及以下浏览器,则跳过不处理
@@ -487,7 +620,7 @@
                                if(UK_Data.LastError!=0){self.bConnect=false;s_simnew1.Socket_UK.close();return false;}
                                DevicePath=UK_Data.return_value;//获得返回的UK的路径
                                //console.log(DevicePath)
                                s_simnew1.GetChipID(DevicePath); //发送命令取UK的版本
                                s_simnew1.GetProduceDate(DevicePath); //发送命令取UK的版本
                            }
                                break;
                            case 2:
@@ -543,7 +676,6 @@
          data: 'addjson=' + JSON.stringify(param),
          success: function(res) {
            var rs = JSON.parse(res.result);
            console.log(rs);
            if(rs.code) {
              //self.login_type = rs.data;
              self.login_type = 1;
@@ -968,7 +1100,7 @@
                                if(UK_Data.LastError!=0){self.bConnect=false;s_simnew1.Socket_UK.close();return false;}
                                DevicePath=UK_Data.return_value;//获得返回的UK的路径
                                console.log(DevicePath)
                                s_simnew1.GetChipID(DevicePath); //发送命令取UK的版本
                                s_simnew1.GetProduceDate(DevicePath); //发送命令取UK的版本
                            }
                                break;
                            case 2: {
nfdw_stand/WebRoot/js/SoftUKey.js
@@ -212,7 +212,7 @@
                    // 设置路径
                    inPath=UK_Data.return_value;//获得返回的UK的路径
                    s_simnew1.GetChipID(inPath);//返回芯片唯一ID
                    s_simnew1.GetProduceDate(inPath);//返回芯片唯一ID
                    break;
                case 2:
                    if(UK_Data.LastError!=0){
nfdw_stand/WebRoot/login.jsp
@@ -197,15 +197,33 @@
        </div>
    </Modal>
    <Modal
            v-model="face.show"
            title="人脸识别登录"
            width="480px"
            @on-visible-change="faceModalChange"
            footer-hide>
        v-model="face.show"
        title="人脸识别登录"
        width="480px"
        @on-visible-change="faceModalChange"
        footer-hide>
        <video ref="video" width="480" height="320" style="display:none"></video>
        <canvas ref="canvas" width="480" height="320"></canvas>
        <p style="text-align:center">{{face.detect}}</p>
    </Modal>
    <Modal
        v-model="status"
        title="图片上传"
        width="480px"
        footer-hide>
        <Upload
            multiple
            :max-size="10240"
            :format="['jpg','jpeg','png']"
            :before-upload="beforeAvatarUpload"
            type="drag"
            action="">
            <div style="padding: 20px 0">
                <Icon type="ios-cloud-upload" size="52" style="color: #3399ff"></Icon>
                <p style="color:red;">提示:图片大小不超过2MB,图像人脸角度端正,图像清晰;</p>
            </div>
        </Upload>
    </Modal>
</div>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="element-ui/vue.min.js"></script>
@@ -273,7 +291,10 @@
            },
            // ukey对应的用户的登录方式 1为用户名密码 2为人脸
            login_type: 1,
            softUKey: new SoftUKey(SoftKey3W)
            softUKey: new SoftUKey(SoftKey3W),
            status: false,
            UName: '',
            UId: '',
        },
        watch: {
            userfocus: function() {
@@ -322,11 +343,9 @@
                    url: 'LoginAction_getRandom',
                    data: null,
                    success: function(res) {
                        console.log(res);
                        let rs = JSON.parse(res.result);
                        if(rs.code == 1) {
                            let randomNumber = rs.data;
                            console.log(self.softUKey);
                            self.softUKey.getSign(randomNumber, self.checkUKeySign);
                        }else {
                            self.$message.error("服务器连接异常!");
@@ -352,6 +371,7 @@
                            self.checkUser();
                        }else {
                            self.msg = rs.msg;
                            //self.checkUser();
                        }
                    },
                    error: function(error) {
@@ -380,7 +400,7 @@
                var UKey_ID = this.info.UKey_ID;
                password = hex_md5(password);
                // 请求后台
                ajax({
                $.ajax({
                    url: 'LoginAction_login',
                    data: "uinf.UName="+user+"&uinf.Upassword="+password+"&uinf.UId=1"+"&uinf.UKey_ID="+UKey_ID,
                    success: function(res) {
@@ -390,11 +410,8 @@
                            //self.loading = true;
                            // 进入首页
                            //self.toIndex(rs.msg);
                            self.login_type = 2;
                            self.$Message.message('success', {
                                content: '静态密码验证成功',
                                duration: 3
                            });
                            //self.login_type = 2;
                            self.checkFaceExist(user);
                        }else {
                            self.msg = rs.msg;
                            if (rs.data) {
@@ -413,6 +430,123 @@
                    }
                });
            },
            checkFaceExist(UName) {
                let self = this;
                $.ajax({
                    type: "post",
                    url: 'LoginAction_faceExist',
                    data: 'json='+JSON.stringify({
                        UName,
                    }),
                    success: function(res) {
                        console.log(res);
                        let rs = JSON.parse(res.result);
                        if(rs.code == 1) {
                            self.$Message.message('success', {
                                content: '静态密码验证成功',
                                duration: 3
                            });
                            self.login_type = 2;
                        }else {
                            self.status = true;
                            self.$Message.message('warning', {
                                content: '用户未录入人脸,请先录入。',
                                duration: 3
                            });
                        }
                        self.UName = UName;
                        self.UId = rs.data+"";
                    },
                    error: function(e){
                        self.$Message.message('warning', {
                            content: '请求网路异常',
                            duration: 3
                        });
                        console.log(e);
                    }
                });
            },
            // 图片上传前
            beforeAvatarUpload(file) {
                let seft = this;
                const isJPG = file.type === 'image/jpeg' || file.type === 'image/png';
                const isLt2M = file.size / 1024 / 1024 < 2;
                if (!isJPG) {
                    seft.$Message.error({
                        duration:3,
                        background: true,
                        content: '上传头像图片只能是 JPG或PNG 格式!'
                    });
                    return false;
                }
                if (!isLt2M) {
                    seft.$Message.error({
                        duration:3,
                        background: true,
                        content: '上传头像图片大小不能超过 2MB!'
                    });
                    return false;
                }
                // 图片转base64
                seft.getBase64(file).then(res=>{
                    seft.imageUrl = res;
                    let jsontemp = {
                        fileData:res,
                        uId:seft.UId,
                        uName:seft.UName
                    }
                    $.ajax({
                        type: 'post',
                        url: 'FaceIdentifyAction_face_add',
                        data: "json="+JSON.stringify(jsontemp),
                        success: function(res) {
                            let rs = JSON.parse(res.result);
                            if(rs.code == 1){
                                //隐藏弹窗
                                seft.status = false;
                                let text = '新增人脸成功!';
                                seft.$Message.success({
                                    duration:3,
                                    background: true,
                                    content: text
                                });
                            }else{
                                seft.$Message.success({
                                    duration:3,
                                    background: true,
                                    content: '上传失败,请重新上传!'
                                });
                            }
                        },
                        error: function(e) {
                            seft.$Message.success({
                                duration:3,
                                background: true,
                                content: '网络请求异常,上传失败!'
                            });
                            console.log(e);
                        }
                    });
                })
                return false
            },
            // 图片转base64
            getBase64(file) {
                return new Promise(function (resolve, reject) {
                    let reader = new FileReader();
                    let imgResult = "";
                    reader.readAsDataURL(file);
                    reader.onload = function () {
                        imgResult = reader.result;
                    };
                    reader.onerror = function (error) {
                        reject(error);
                    };
                    reader.onloadend = function () {
                        resolve(imgResult);
                    };
                });
            },
            ukeyLoad: function(){
                var self = this;
                //如果是IE10及以下浏览器,则跳过不处理
@@ -487,7 +621,7 @@
                                if(UK_Data.LastError!=0){self.bConnect=false;s_simnew1.Socket_UK.close();return false;}
                                DevicePath=UK_Data.return_value;//获得返回的UK的路径
                                //console.log(DevicePath)
                                s_simnew1.GetChipID(DevicePath); //发送命令取UK的版本
                                s_simnew1.GetProduceDate(DevicePath); //发送命令取UK的版本
                            }
                                break;
                            case 2:
@@ -543,7 +677,6 @@
          data: 'addjson=' + JSON.stringify(param),
          success: function(res) {
            var rs = JSON.parse(res.result);
            console.log(rs);
            if(rs.code) {
              //self.login_type = rs.data;
              self.login_type = 1;
@@ -968,7 +1101,7 @@
                                if(UK_Data.LastError!=0){self.bConnect=false;s_simnew1.Socket_UK.close();return false;}
                                DevicePath=UK_Data.return_value;//获得返回的UK的路径
                                console.log(DevicePath)
                                s_simnew1.GetChipID(DevicePath); //发送命令取UK的版本
                                s_simnew1.GetProduceDate(DevicePath); //发送命令取UK的版本
                            }
                                break;
                            case 2: {
nfdw_stand/WebRoot_photo/null.jpg
nfdw_stand/WebRoot_photo/superuser.jpg