Commit 6fb3a46a authored by 姜春辉's avatar 姜春辉
parents 71b8e7b5 4045d9e9
......@@ -6,8 +6,15 @@
<Key Caption="心跳端口" Name="HeartPort" Value="16789"/>
<Key Caption="远程认证地址" Name="FaceWebSocket" Value="ws://192.168.1.7:5432/face/sdk2?persontype=访客"/>
</Dict>
<Dict Caption="识别方式配置" Name="authenticationconfig">
<Key Caption="人脸识别" Name="EnableFace" Value="true"/>
<Key Caption="二代证识别" Name="EnableIdCard" Value="false"/>
<Key Caption="二维码识别" Name="EnableQRCode" Value="false"/>
<!--0是人脸识别 1是二代证识别 2是二维码识别-->
<Key Caption="默认识别方式" Name="DefaultAuthMode" Value="1"/>
</Dict>
</Dictionaries>
<Structures>
<Structures>
<Structure Caption="服务地址配置" Name="ServiceList">
<Declare>
<Property Caption="服务描述" Name="Description"/>
......
......@@ -196,12 +196,13 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
/// <param name="useFace">是否启用人脸认证</param>
/// <param name="useIdCard">是否启用二代证认证</param>
/// <param name="useQRCode">其否启用二维码认证</param>
public void BeginAuth(AuthenticationSuccessDelegate successAction, IViewModel exitView = null, bool useFace = true, bool useIdCard = true, bool useQRCode = true)
public void BeginAuth(AuthenticationSuccessDelegate successAction, IViewModel exitView = null,
bool useFace = true, bool useIdCard = true, bool useQRCode = true)
{
_ExitView = exitView;
VM.EnableFace = useFace;
VM.EnableIdCard = useIdCard;
VM.EnableQRCode = useQRCode;
VM.EnableFace = LocalSetting.AuthenticationConfig.EnableFace;
VM.EnableIdCard = LocalSetting.AuthenticationConfig.EnableIdCard;
VM.EnableQRCode = useQRCode ? LocalSetting.AuthenticationConfig.EnableQRCode : useQRCode;
_AuthSuccessCallback = successAction;
ShowView();
}
......@@ -218,10 +219,32 @@ namespace GS.Terminal.VisitorSelfService.Logic.Core
private void VM_OnNavigateInto()
{
VM.AuthMode = ViewModels.Pages.AuthenticationPage.AuthenticationMode.Face;
//默认识别方式
VM.AuthMode = AuthMode();
Handlers.GetHandler<HeadHandler>().Start();
}
private ViewModels.Pages.AuthenticationPage.AuthenticationMode AuthMode()
{
switch (LocalSetting.AuthenticationConfig.DefaultAuthMode)
{
case ViewModels.Pages.AuthenticationPage.AuthenticationMode.Face:
if (LocalSetting.AuthenticationConfig.EnableFace)
return ViewModels.Pages.AuthenticationPage.AuthenticationMode.Face;
break;
case ViewModels.Pages.AuthenticationPage.AuthenticationMode.IdCard:
if (LocalSetting.AuthenticationConfig.EnableIdCard)
return ViewModels.Pages.AuthenticationPage.AuthenticationMode.IdCard;
break;
case ViewModels.Pages.AuthenticationPage.AuthenticationMode.QRCode:
if (LocalSetting.AuthenticationConfig.EnableQRCode)
return ViewModels.Pages.AuthenticationPage.AuthenticationMode.QRCode;
break;
}
return ViewModels.Pages.AuthenticationPage.AuthenticationMode.Face;
}
private void VideoOut(Mat mat)
{
if (!LocalSetting.AddonDefaultConfig.DisableVideoDetect)
......
......@@ -14,10 +14,21 @@ namespace GS.Terminal.VisitorSelfService.Logic
AppConfig = LocalSettingLoader.Load<AppConfig>(Program._Context);
ServiceList = LocalSettingLoader.Load<ServiceList>(Program._Context);
AddonDefaultConfig = LocalSettingLoader.Load<AddonDefaultConfig>(Program._Context);
AuthenticationConfig= LocalSettingLoader.Load<AuthenticationConfig>(Program._Context);
}
public static AddonDefaultConfig AddonDefaultConfig { get; }
public static AppConfig AppConfig { get; }
public static ServiceList ServiceList { get; }
public static AuthenticationConfig AuthenticationConfig { get; }
}
public class AuthenticationConfig : IDictSetting
{
public bool EnableFace { get; set; }
public bool EnableIdCard { get; set; }
public bool EnableQRCode { get; set; }
public ViewModels.Pages.AuthenticationPage.AuthenticationMode DefaultAuthMode { get; set; }
public string DictName => "authenticationconfig";
}
public class AddonDefaultConfig : IDictSetting
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment