From 0263e3842d2c8b9b6a7b382876af96f678e01391 Mon Sep 17 00:00:00 2001
From: chenyc <501753378@qq.com>
Date: 星期一, 15 一月 2024 11:23:22 +0800
Subject: [PATCH] 更新ui 血压体重趋势图

---
 src/samples/faceApi.ts |   40 ++++++++++++++++++++++++++++++----------
 1 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/src/samples/faceApi.ts b/src/samples/faceApi.ts
index 2bcb14a..d7a8d3e 100644
--- a/src/samples/faceApi.ts
+++ b/src/samples/faceApi.ts
@@ -1,5 +1,6 @@
 // This file is auto-generated, don't edit it
 import facebody20191230, * as $facebody20191230 from '@alicloud/facebody20191230';
+import {checkUploadFile} from '@/api/user'
 // 依赖的模块可通过下载工程中的模块依赖文件或右上角的获取 SDK 依赖信息查看
 import * as $OpenApi from '@alicloud/openapi-client';
 import Util, * as $Util from '@alicloud/tea-util';
@@ -8,6 +9,8 @@
 import { confingInfoStore } from '@/stores/StoresConfing'
 import {sendPationCodeApi} from './httpApi'
 import { sockteStore } from '@/stores/sockteInfo';
+import { type } from 'os';
+
 
 // 要识别的人脸库
 const faceDatabase= confingInfoStore().confingInfo.face_database
@@ -83,6 +86,21 @@
     delImg(path)
   })
 }
+const faceApiCheck=async(path:any)=>{
+  fs.readFile(path, (err, data) => {
+    if (err) throw err;
+      let blobFile = new File([data], 'name.png', {type:"image/png"})
+      console.log(blobFile)
+      const formData = new FormData() // 下面有备注
+      formData.append('File1', blobFile)
+      checkUploadFile(formData).then(re=>{
+        console.log('-----')
+      })
+  })
+  
+
+
+}
 // base64z转文件后验证
 const base64toFile = (dataurl:any,filename='file') =>  {
   if (!fs.existsSync('./imgs')) {
@@ -96,16 +114,18 @@
   // new Buffer 操作权限太大,v6.0后使用Buffer.from()创建构造函数
   const dataBuffer = new Buffer(base64, 'base64'); //把base64码转成buffer对象,
   // return dataBuffer
-  fs.writeFile(path, dataBuffer, function(err){//用fs写入文件
-  if(err){
-    console.log(err);
-  }else{
-    console.log('写入成功!验证阿里',path);
-    // getOssUrl(path)
-    // 验证图片
-    faceShibie(path)
-  }
-  })
+   fs.writeFile(path, dataBuffer, function (err) {
+     if (err) {
+       console.log(err);
+     } else {
+     
+      //  console.log('写入成功!验证阿里', path);
+       // getOssUrl(path)
+       // 验证图片
+       faceShibie(path)
+      //  faceApiCheck(path)
+     }
+   })
 }
 //验证后删除文件图片
 const delImg=(path:string)=>{

--
Gitblit v1.8.0