Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
何阳
/
FaceApp
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c9a9c202
authored
Jul 15, 2024
by
何阳
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
NEW:1. 修复了人脸图片拉取,后端模板没有替换的问题
parent
f87cba62
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
FaceServer/Properties/AssemblyInfo.cs
FaceServer/Server/FaceDataSet.cs
FaceServer/Properties/AssemblyInfo.cs
View file @
c9a9c202
...
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
...
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.
1
")]
[assembly: AssemblyVersion("1.0.0.
2
")]
[assembly: AssemblyFileVersion("1.0.0.
1
")]
[assembly: AssemblyFileVersion("1.0.0.
2
")]
FaceServer/Server/FaceDataSet.cs
View file @
c9a9c202
...
@@ -71,9 +71,15 @@ namespace FaceServer.Server
...
@@ -71,9 +71,15 @@ namespace FaceServer.Server
}
}
public
static
async
Task
<
Result
<
byte
[],
string
>>
GetImage
(
string
imageUrl
)
public
static
async
Task
<
Result
<
byte
[],
string
>>
GetImage
(
string
imageUrl
)
{
{
var
respond
=
await
client
.
GetAsync
(
imageUrl
);
var
baseUrl
=
new
Uri
(
Config
.
BaseUrl
);
if
(
imageUrl
.
Contains
(
"{host}"
))
{
imageUrl
=
imageUrl
.
Replace
(
"{host}"
,
baseUrl
.
Authority
);
}
try
{
var
respond
=
await
client
.
GetAsync
(
imageUrl
);
if
(
respond
.
StatusCode
!=
System
.
Net
.
HttpStatusCode
.
OK
)
if
(
respond
.
StatusCode
!=
System
.
Net
.
HttpStatusCode
.
OK
)
{
{
var
rawError
=
await
respond
.
Content
.
ReadAsStringAsync
();
var
rawError
=
await
respond
.
Content
.
ReadAsStringAsync
();
...
@@ -84,6 +90,13 @@ namespace FaceServer.Server
...
@@ -84,6 +90,13 @@ namespace FaceServer.Server
var
imageBytes
=
await
respond
.
Content
.
ReadAsByteArrayAsync
();
var
imageBytes
=
await
respond
.
Content
.
ReadAsByteArrayAsync
();
return
imageBytes
;
return
imageBytes
;
}
}
catch
(
Exception
ex
)
{
Log
.
Error
(
ex
,
$"下载图片失败:
{
imageUrl
}
"
);
return
$"下载图片失败:
{
imageUrl
}
"
;
}
}
public
static
async
Task
<
Result
<
OssFile
,
string
>>
QueryFileAsync
(
User
usr
)
public
static
async
Task
<
Result
<
OssFile
,
string
>>
QueryFileAsync
(
User
usr
)
{
{
Log
.
Information
(
$"查询
{
usr
.
Name
}
照片"
);
Log
.
Information
(
$"查询
{
usr
.
Name
}
照片"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment