|
@@ -1,19 +1,34 @@
|
|
|
<template>
|
|
|
<div style='height: 100%;'>
|
|
|
<div class='import-header'>
|
|
|
- <img src='./images/nav_images.png' alt=''>照片批量上传工具 - {{server}}
|
|
|
- <button class='exit-btn' @click='logout' title="退出"></button>
|
|
|
+ <img
|
|
|
+ src='./images/nav_images.png'
|
|
|
+ alt=''
|
|
|
+ >照片批量上传工具 - {{server}}
|
|
|
+ <button
|
|
|
+ class='exit-btn'
|
|
|
+ @click='logout'
|
|
|
+ title="退出"
|
|
|
+ ></button>
|
|
|
</div>
|
|
|
<div class='import-body'>
|
|
|
<div class='import-div'>
|
|
|
<a href='javascript:;'>
|
|
|
<!-- webkitdirectory-->
|
|
|
- <button class='import-btn' @click="importPhotos">
|
|
|
+ <button
|
|
|
+ class='import-btn'
|
|
|
+ @click="importPhotos"
|
|
|
+ >
|
|
|
上传照片
|
|
|
</button>
|
|
|
</a>
|
|
|
<div>
|
|
|
- <input class="base-id-input" type="text" v-model="baseID" placeholder="不处理小于此数字的身份证照片">
|
|
|
+ <input
|
|
|
+ class="base-id-input"
|
|
|
+ type="text"
|
|
|
+ v-model="baseID"
|
|
|
+ placeholder="不处理小于此数字的身份证照片"
|
|
|
+ >
|
|
|
</div>
|
|
|
<div class='progress-div'>
|
|
|
<div>
|
|
@@ -48,13 +63,22 @@
|
|
|
<span>处理速度:{{(1000*processSpeed).toFixed(2)}}个/秒</span>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <span v-show="completeShow" style="color: green;font-weight: bold;">全部处理完成</span>
|
|
|
- <span v-show="!completeShow&&(successNum>0||errorNum>0)" style="color: red;font-weight: bold;">处理中...</span>
|
|
|
+ <span
|
|
|
+ v-show="completeShow"
|
|
|
+ style="color: green;font-weight: bold;"
|
|
|
+ >全部处理完成</span>
|
|
|
+ <span
|
|
|
+ v-show="!completeShow&&(successNum>0||errorNum>0)"
|
|
|
+ style="color: red;font-weight: bold;"
|
|
|
+ >处理中...</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class='console-panel'>
|
|
|
- <div v-for='msgInfo in returnMsgList200' :key="msgInfo.fileName">
|
|
|
+ <div
|
|
|
+ v-for='msgInfo in returnMsgList200'
|
|
|
+ :key="msgInfo.fileName"
|
|
|
+ >
|
|
|
<p class='console-line'>
|
|
|
<span>{{msgInfo.fileName}}:{{msgInfo.msg}}</span>
|
|
|
</p>
|
|
@@ -227,20 +251,13 @@ export default {
|
|
|
|
|
|
//生成新名称
|
|
|
let serverPhotoPath = null;
|
|
|
- const upyunPhotoPath = (() => {
|
|
|
+ const upyunPhotoPath = studentId => {
|
|
|
const md5Hash = CryptoJS.MD5(
|
|
|
- Base64.encode(identityNumber + new Date().getTime())
|
|
|
+ Base64.encode(studentId + new Date().getTime())
|
|
|
).toString();
|
|
|
serverPhotoPath = md5Hash + fileSuffix;
|
|
|
- return (
|
|
|
- rootOrgId +
|
|
|
- "/" +
|
|
|
- encodeURIComponent(identityNumber) +
|
|
|
- "/" +
|
|
|
- md5Hash +
|
|
|
- fileSuffix
|
|
|
- );
|
|
|
- })();
|
|
|
+ return rootOrgId + "/" + studentId + "/" + md5Hash + fileSuffix;
|
|
|
+ };
|
|
|
|
|
|
// 核心流程:
|
|
|
// 1. get studentId from ecs
|
|
@@ -257,12 +274,14 @@ export default {
|
|
|
this.faceSetToken = await this.getFaceSetToken();
|
|
|
let faceCount = await this.addFaceToSet(this.faceSetToken, faceToken);
|
|
|
|
|
|
- await this.saveImageToUpyun({ upyunPhotoPath, photoFile });
|
|
|
+ await this.saveImageToUpyun({
|
|
|
+ upyunPhotoPath: upyunPhotoPath(studentId),
|
|
|
+ photoFile
|
|
|
+ });
|
|
|
const photoInfo = {
|
|
|
studentId: studentId,
|
|
|
faceSetToken: this.faceSetToken,
|
|
|
faceToken: faceToken,
|
|
|
- studentPhotoPath: studentPhotoPath,
|
|
|
rootOrgId: rootOrgId,
|
|
|
faceCount,
|
|
|
photoName: serverPhotoPath
|