wxr
2024-05-07 f16fd06aa226e9f97a27858624d4ea7cf8975d25
HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs
@@ -1,4 +1,5 @@
using System;
using System.IO;
using System.Threading;
using HDL_ON.DAL.Server;
using HDL_ON.Entity;
@@ -171,6 +172,12 @@
                TextID = StringId.AboutFaceIdAndPrivacy
            };
            contentView.AddChidren(btnTip);
            btnTip.MouseUpEventHandler += (sender2, e2) =>
            {
                string url = "https://developer.hdlcontrol.com/FaceProtocolSantam.html";
                new WebViewDialog().LoadPage(Language.StringByID(StringId.GetFaceProtocol), url);
            };
            btnSetFaceId = new Button()
@@ -534,6 +541,39 @@
            {
                //1.读取裁剪后的图片,然后删除
                var imageBytes = Shared.IO.FileUtils.ReadFile(selectImagePath);
                System.IO.FileStream fs = null;
                try
                {
                    if (System.IO.File.Exists(System.IO.Path.Combine(Application.RootPath, selectImagePath)))
                    {
                        fs = new FileStream(System.IO.Path.Combine(Application.RootPath, selectImagePath), FileMode.Open, FileAccess.Read);
                    }
                    else if (System.IO.File.Exists(selectImagePath))
                    {
                        fs = new FileStream(selectImagePath, FileMode.Open, FileAccess.Read);
                    }
                    else
                    {
                    }
                    byte[] bytes = new byte[fs.Length];
                    fs.Read(bytes, 0, bytes.Length);
                }
                catch(Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
                finally
                {
                    if (fs != null)
                    {
                        fs.Close();
                    }
                }
                System.IO.File.Delete(selectImagePath);
                var waitPage = new Loading();
@@ -545,6 +585,7 @@
                    try
                    {
                        string base64string = Convert.ToBase64String(imageBytes);
                Console.WriteLine("wxr" + base64string);
                        //Utlis.WriteLine("上传图片Length:" + imageBytes.Length + " base64:" + base64string);
                        var pack = new HttpServerRequest().FaceSetting(base64string);
                        if (pack != null)