From 95c0cec6c5e2931fc8f0721ee868abaabf4c3b37 Mon Sep 17 00:00:00 2001
From: wuxw <928255095@qq.com>
Date: 星期日, 23 二月 2020 13:28:47 +0800
Subject: [PATCH] 优化申请钥匙

---
 WebService/src/main/resources/components/applicationKeyPackage/add-applicationKeyView/addApplicationKey.js |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/WebService/src/main/resources/components/applicationKeyPackage/add-applicationKeyView/addApplicationKey.js b/WebService/src/main/resources/components/applicationKeyPackage/add-applicationKeyView/addApplicationKey.js
index deb432c..18ba1c1 100644
--- a/WebService/src/main/resources/components/applicationKeyPackage/add-applicationKeyView/addApplicationKey.js
+++ b/WebService/src/main/resources/components/applicationKeyPackage/add-applicationKeyView/addApplicationKey.js
@@ -214,7 +214,7 @@
                     return;
                 }
                 if (!vc.component.addApplicationKeyValidate()) {
-                    vc.message(vc.validate.errInfo);
+                    vc.toast(vc.validate.errInfo);
 
                     return;
                 }
@@ -298,17 +298,17 @@
                         video: true,
                         audio: false
                     };
-                    var video = document.getElementById('AddApplicationKeyPhoto');
+                    var addVideo = document.getElementById('addApplicationKeyPhoto');
                     var media = navigator.getUserMedia(constraints, function (stream) {
                         var url = window.URL || window.webkitURL;
                         //video.src = url ? url.createObjectURL(stream) : stream;
                         vc.component.addApplicationKeyInfo.mediaStreamTrack = typeof stream.stop === 'function' ? stream : stream.getTracks()[0];
                         try {
-                            video.src = url ? url.createObjectURL(stream) : stream;
+                            addVideo.src = url ? url.createObjectURL(stream) : stream;
                         } catch (error) {
-                            video.srcObject = stream;
+                            addVideo.srcObject = stream;
                         }
-                        video.play();
+                        addVideo.play();
                         vc.component.addApplicationKeyInfo.videoPlaying = true;
                     }, function (error) {
                         console.log("ERROR");
@@ -321,10 +321,10 @@
             _takePhoto: function () {
                 if (vc.component.addApplicationKeyInfo.videoPlaying) {
                     var canvas = document.getElementById('AddApplicationKeyCanvas');
-                    var video = document.getElementById('AddApplicationKeyPhoto');
-                    canvas.width = video.videoWidth;
-                    canvas.height = video.videoHeight;
-                    canvas.getContext('2d').drawImage(video, 0, 0);
+                    var takeAddVideo = document.getElementById('AddApplicationKeyPhoto');
+                    canvas.width = takeAddVideo.videoWidth;
+                    canvas.height = takeAddVideo.videoHeight;
+                    canvas.getContext('2d').drawImage(takeAddVideo, 0, 0);
                     var data = canvas.toDataURL('image/webp');
                     vc.component.addApplicationKeyInfo.photo = data;
                     //document.getElementById('photo').setAttribute('src', data);

--
Gitblit v1.8.0