Former-commit-id: ed7a929b480b629428021682ee8e31d98645c507
TangShanKaiPing
wanggang 6 years ago
parent 81ff24001b
commit 284912bfd8

@ -68,19 +68,19 @@
<Compile Include="Assets\UniversalMediaPlayer\Editor\UMPSettingsEditor.cs" /> <Compile Include="Assets\UniversalMediaPlayer\Editor\UMPSettingsEditor.cs" />
<Compile Include="Assets\UniversalMediaPlayer\Editor\UMPSettingsWindow.cs" /> <Compile Include="Assets\UniversalMediaPlayer\Editor\UMPSettingsWindow.cs" />
<Reference Include="Unity.TextMeshPro.Editor"> <Reference Include="Unity.TextMeshPro.Editor">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/ScriptAssemblies/Unity.TextMeshPro.Editor.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/ScriptAssemblies/Unity.TextMeshPro.Editor.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.PackageManagerUI.Editor"> <Reference Include="Unity.PackageManagerUI.Editor">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/ScriptAssemblies/Unity.PackageManagerUI.Editor.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/ScriptAssemblies/Unity.PackageManagerUI.Editor.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.CollabProxy.Editor"> <Reference Include="Unity.CollabProxy.Editor">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/ScriptAssemblies/Unity.CollabProxy.Editor.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/ScriptAssemblies/Unity.CollabProxy.Editor.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.TextMeshPro"> <Reference Include="Unity.TextMeshPro">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/ScriptAssemblies/Unity.TextMeshPro.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/ScriptAssemblies/Unity.TextMeshPro.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.Analytics.DataPrivacy"> <Reference Include="Unity.Analytics.DataPrivacy">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/ScriptAssemblies/Unity.Analytics.DataPrivacy.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/ScriptAssemblies/Unity.Analytics.DataPrivacy.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.AIModule"> <Reference Include="UnityEngine.AIModule">
<HintPath>D:/ProgramFiles/Unity/2018.3.14f1/Editor/Data/Managed/UnityEngine/UnityEngine.AIModule.dll</HintPath> <HintPath>D:/ProgramFiles/Unity/2018.3.14f1/Editor/Data/Managed/UnityEngine/UnityEngine.AIModule.dll</HintPath>
@ -323,22 +323,22 @@
<HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/15.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath> <HintPath>C:/Program Files (x86)/Microsoft Visual Studio Tools for Unity/15.0/Editor/SyntaxTree.VisualStudio.Unity.Bridge.dll</HintPath>
</Reference> </Reference>
<Reference Include="MediaPlayer"> <Reference Include="MediaPlayer">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Assets/UniversalMediaPlayer/Plugins/MediaPlayer.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Assets/UniversalMediaPlayer/Plugins/MediaPlayer.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor.Advertisements"> <Reference Include="UnityEditor.Advertisements">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/PackageCache/com.unity.ads@2.0.8/Editor/UnityEditor.Advertisements.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/PackageCache/com.unity.ads@2.0.8/Editor/UnityEditor.Advertisements.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.Analytics.Editor"> <Reference Include="Unity.Analytics.Editor">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/PackageCache/com.unity.analytics@3.2.2/Unity.Analytics.Editor.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/PackageCache/com.unity.analytics@3.2.2/Unity.Analytics.Editor.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.Analytics.StandardEvents"> <Reference Include="Unity.Analytics.StandardEvents">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/PackageCache/com.unity.analytics@3.2.2/Unity.Analytics.StandardEvents.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/PackageCache/com.unity.analytics@3.2.2/Unity.Analytics.StandardEvents.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.Analytics.Tracker"> <Reference Include="Unity.Analytics.Tracker">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/PackageCache/com.unity.analytics@3.2.2/Unity.Analytics.Tracker.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/PackageCache/com.unity.analytics@3.2.2/Unity.Analytics.Tracker.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor.Purchasing"> <Reference Include="UnityEditor.Purchasing">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/PackageCache/com.unity.purchasing@2.0.3/Editor/UnityEditor.Purchasing.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/PackageCache/com.unity.purchasing@2.0.3/Editor/UnityEditor.Purchasing.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEditor.iOS.Extensions.Xcode"> <Reference Include="UnityEditor.iOS.Extensions.Xcode">
<HintPath>D:/ProgramFiles/Unity/2018.3.14f1/Editor/Data/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath> <HintPath>D:/ProgramFiles/Unity/2018.3.14f1/Editor/Data/PlaybackEngines/iOSSupport/UnityEditor.iOS.Extensions.Xcode.dll</HintPath>

@ -339,6 +339,8 @@
<None Include="Assets\UniversalMediaPlayer\Shaders\UMP-TransparentCanvas.shader" /> <None Include="Assets\UniversalMediaPlayer\Shaders\UMP-TransparentCanvas.shader" />
<None Include="Assets\OpenCVForUnity\Plugins\macOS\opencvforunity.bundle\Contents\Resources\gl3w\readme.txt" /> <None Include="Assets\OpenCVForUnity\Plugins\macOS\opencvforunity.bundle\Contents\Resources\gl3w\readme.txt" />
<None Include="Assets\UniversalMediaPlayer\Shaders\UMP-QuadrantCanvas(Linear).shader" /> <None Include="Assets\UniversalMediaPlayer\Shaders\UMP-QuadrantCanvas(Linear).shader" />
<None Include="Assets\StreamingAssets\obj\Debug\netcoreapp2.2\IoT.Resources.csproj.FileListAbsolute.txt" />
<None Include="Assets\StreamingAssets\obj\Debug\netcoreapp2.2\Microsoft.Extensions.FileProviders.Embedded.Manifest.xml" />
<None Include="Assets\UniversalMediaPlayer\Shaders\UMP-EquirectangularCanvas.shader" /> <None Include="Assets\UniversalMediaPlayer\Shaders\UMP-EquirectangularCanvas.shader" />
<None Include="Assets\UniversalMediaPlayer\Shaders\UMP-ARVideoCanvas.shader" /> <None Include="Assets\UniversalMediaPlayer\Shaders\UMP-ARVideoCanvas.shader" />
<None Include="Assets\StreamingAssets\text\trained_classifier_erGrouping.xml" /> <None Include="Assets\StreamingAssets\text\trained_classifier_erGrouping.xml" />
@ -351,19 +353,19 @@
<None Include="Assets\UniversalMediaPlayer\Shaders\UMP-QuadrantCanvas(Gamma).shader" /> <None Include="Assets\UniversalMediaPlayer\Shaders\UMP-QuadrantCanvas(Gamma).shader" />
<None Include="Assets\OpenCVForUnity\Notices.txt" /> <None Include="Assets\OpenCVForUnity\Notices.txt" />
<Reference Include="Unity.TextMeshPro.Editor"> <Reference Include="Unity.TextMeshPro.Editor">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/ScriptAssemblies/Unity.TextMeshPro.Editor.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/ScriptAssemblies/Unity.TextMeshPro.Editor.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.PackageManagerUI.Editor"> <Reference Include="Unity.PackageManagerUI.Editor">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/ScriptAssemblies/Unity.PackageManagerUI.Editor.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/ScriptAssemblies/Unity.PackageManagerUI.Editor.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.CollabProxy.Editor"> <Reference Include="Unity.CollabProxy.Editor">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/ScriptAssemblies/Unity.CollabProxy.Editor.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/ScriptAssemblies/Unity.CollabProxy.Editor.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.TextMeshPro"> <Reference Include="Unity.TextMeshPro">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/ScriptAssemblies/Unity.TextMeshPro.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/ScriptAssemblies/Unity.TextMeshPro.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.Analytics.DataPrivacy"> <Reference Include="Unity.Analytics.DataPrivacy">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/ScriptAssemblies/Unity.Analytics.DataPrivacy.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/ScriptAssemblies/Unity.Analytics.DataPrivacy.dll</HintPath>
</Reference> </Reference>
<Reference Include="UnityEngine.AIModule"> <Reference Include="UnityEngine.AIModule">
<HintPath>D:/ProgramFiles/Unity/2018.3.14f1/Editor/Data/Managed/UnityEngine/UnityEngine.AIModule.dll</HintPath> <HintPath>D:/ProgramFiles/Unity/2018.3.14f1/Editor/Data/Managed/UnityEngine/UnityEngine.AIModule.dll</HintPath>
@ -564,16 +566,16 @@
<HintPath>D:/ProgramFiles/Unity/2018.3.14f1/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/RuntimeEditor/UnityEngine.SpatialTracking.dll</HintPath> <HintPath>D:/ProgramFiles/Unity/2018.3.14f1/Editor/Data/UnityExtensions/Unity/UnitySpatialTracking/RuntimeEditor/UnityEngine.SpatialTracking.dll</HintPath>
</Reference> </Reference>
<Reference Include="MediaPlayer"> <Reference Include="MediaPlayer">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Assets/UniversalMediaPlayer/Plugins/MediaPlayer.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Assets/UniversalMediaPlayer/Plugins/MediaPlayer.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.Analytics.Editor"> <Reference Include="Unity.Analytics.Editor">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/PackageCache/com.unity.analytics@3.2.2/Unity.Analytics.Editor.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/PackageCache/com.unity.analytics@3.2.2/Unity.Analytics.Editor.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.Analytics.StandardEvents"> <Reference Include="Unity.Analytics.StandardEvents">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/PackageCache/com.unity.analytics@3.2.2/Unity.Analytics.StandardEvents.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/PackageCache/com.unity.analytics@3.2.2/Unity.Analytics.StandardEvents.dll</HintPath>
</Reference> </Reference>
<Reference Include="Unity.Analytics.Tracker"> <Reference Include="Unity.Analytics.Tracker">
<HintPath>D:/1.0/ZHXY/labs/IoTClient/Library/PackageCache/com.unity.analytics@3.2.2/Unity.Analytics.Tracker.dll</HintPath> <HintPath>D:/1.0/ZHXY/projects/IoTClient/Library/PackageCache/com.unity.analytics@3.2.2/Unity.Analytics.Tracker.dll</HintPath>
</Reference> </Reference>
<Reference Include="netstandard"> <Reference Include="netstandard">
<HintPath>D:/ProgramFiles/Unity/2018.3.14f1/Editor/Data/NetStandard/ref/2.0.0/netstandard.dll</HintPath> <HintPath>D:/ProgramFiles/Unity/2018.3.14f1/Editor/Data/NetStandard/ref/2.0.0/netstandard.dll</HintPath>

@ -229,8 +229,9 @@ namespace Assets.Scripts
{ {
var form = new WWWForm(); var form = new WWWForm();
form.AddBinaryData("face", jpgBytes); form.AddBinaryData("face", jpgBytes);
using (var request = UnityWebRequest.Post("http://192.168.253.1:8000/Account/FaceLogin", form)) using (var request = UnityWebRequest.Post(WebViewController.Server + "/Account/FaceLogin", form))
{ {
text.text = WebViewController.Server;
yield return request.SendWebRequest(); yield return request.SendWebRequest();
if (request.isNetworkError || request.isHttpError) if (request.isNetworkError || request.isHttpError)
{ {
@ -238,11 +239,16 @@ namespace Assets.Scripts
} }
else else
{ {
Debug.Log(request.downloadHandler.text); var response = request.downloadHandler.text;
var result = JsonUtility.FromJson<LoginResult>(request.downloadHandler.text); Debug.Log(response);
if (result.Success) var result = JsonUtility.FromJson<LoginResult>(response);
if (result.Code == 0)
{ {
text.text = result.NickName; text.text = result.NickName;
result.Server = WebViewController.Server;
result.RememberMe = WebViewController.RememberMe;
WebViewController.LoginMessage = JsonUtility.ToJson(result);
SceneManager.LoadScene(0);
} }
} }
} }

@ -1,6 +1,11 @@
public class LoginResult public class LoginResult
{ {
public bool Success; public int Code;
public string UserName; public string UserName;
public string NickName; public string NickName;
public string Token;
public string Title;
public string IoTServer;
public string Server;
public bool RememberMe;
} }

@ -1,4 +1,6 @@
using UnityEngine; using System.Text.RegularExpressions;
using UnityEngine;
using UnityEngine.Networking;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
public class WebViewController : MonoBehaviour public class WebViewController : MonoBehaviour
@ -6,6 +8,10 @@ public class WebViewController : MonoBehaviour
{ {
private UniWebView webView; private UniWebView webView;
public static string LoginMessage { get; set; }
public static string Server { get; set; }
public static bool RememberMe { get; set; }
private void Start() private void Start()
{ {
var webViewGameObject = new GameObject("UniWebView"); var webViewGameObject = new GameObject("UniWebView");
@ -18,8 +24,22 @@ public class WebViewController : MonoBehaviour
}; };
webView.OnMessageReceived += (view, message) => webView.OnMessageReceived += (view, message) =>
{ {
if (message.Path == "facelogin") if (message.Path == "init")
{
if (string.IsNullOrEmpty(LoginMessage))
{
webView.EvaluateJavaScript($"load()");
}
else
{
webView.EvaluateJavaScript($"load2('{LoginMessage}')");
LoginMessage = null;
}
}
else if (message.Path == "facelogin")
{ {
Server = UnityWebRequest.UnEscapeURL(Regex.Match(message.RawMessage, "Server=(.*)&").Groups[1].Value);
RememberMe = Regex.Match(message.RawMessage, "RememberMe=(.*)").Groups[1].Value == "true";
this.FaceLogin(); this.FaceLogin();
} }
}; };

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: ad4e74daf3223ec46a53e3944338ad38
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 3021fb3419ffa244ea3b795785441d3f
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 061c976d505588c4f8aea2c9cf73960a
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3128d97a98613c340b87b33f5bbbfd19
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -65,6 +65,9 @@ img.shot.zoom {
overflow: auto; overflow: auto;
} }
/*html5 input rang style*/ /*html5 input rang style*/
input[type='range']{
width:100%;
}
input[type='range']::-webkit-slider-thumb { input[type='range']::-webkit-slider-thumb {
border: 15px solid #fff; border: 15px solid #fff;
border-radius: 15px; border-radius: 15px;

@ -27,7 +27,7 @@
<f7-navbar> <f7-navbar>
<f7-nav-title>登录</f7-nav-title> <f7-nav-title>登录</f7-nav-title>
<f7-nav-right> <f7-nav-right>
<f7-link external panel-open="right" icon-f7="add" href="qr.html"></f7-link> <f7-link external panel-open="right" icon-f7="add" v-on:click="FaceLogin(Server,RememberMe)"></f7-link>
</f7-nav-right> </f7-nav-right>
</f7-navbar> </f7-navbar>
<form v-bind:action="Server+'/Account/AppLogin'" v-on:submit.prevent="OnSubmit" class="login"> <form v-bind:action="Server+'/Account/AppLogin'" v-on:submit.prevent="OnSubmit" class="login">
@ -101,9 +101,6 @@
<f7-page :page-content="false" @page:reinit="vm.init"> <f7-page :page-content="false" @page:reinit="vm.init">
<f7-navbar> <f7-navbar>
<f7-nav-title>{{vm.Title}}</f7-nav-title> <f7-nav-title>{{vm.Title}}</f7-nav-title>
<f7-nav-right>
<f7-link external panel-open="right" icon-f7="add" href="webqr.html"></f7-link>
</f7-nav-right>
</f7-navbar> </f7-navbar>
<f7-toolbar tabbar labels bottom> <f7-toolbar tabbar labels bottom>
<f7-link tab-link="#tab-message" icon-ios="f7:chat" icon-md="f7:chat" text="消息"></f7-link> <f7-link tab-link="#tab-message" icon-ios="f7:chat" icon-md="f7:chat" text="消息"></f7-link>

@ -9,8 +9,6 @@ using Infrastructure.Security;
using Infrastructure.Sms; using Infrastructure.Sms;
using Infrastructure.Web; using Infrastructure.Web;
using Infrastructure.Web.DataAnnotations; using Infrastructure.Web.DataAnnotations;
using JWT.Algorithms;
using JWT.Builder;
using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
@ -22,7 +20,6 @@ using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Linq; using System.Linq;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
@ -139,10 +136,20 @@ namespace UserCenter.Controllers
var user = this._userRepo.ReadOnlyTable().FirstOrDefault(o => o.UserName == userName); var user = this._userRepo.ReadOnlyTable().FirstOrDefault(o => o.UserName == userName);
if (user != null) if (user != null)
{ {
return Json(new { Success = true, UserName = userName, NickName = user.NickName }); var list = this._siteRepo.ReadOnlyTable().ToList();
var result = new
{
Code = 0,
Token = this._jwtHelper.GetToken(new Dictionary<string, object>() { { nameof(user.UserName), user.UserName } }),
user.NickName,
user.UserName,
Title = this._cfg["name"],
IoTServer = list.FirstOrDefault(o => o.Name == "物联网平台").Home
};
return Json(result);
} }
} }
return Json(new { Success = false }); return Json(new { Code = 1 });
} }
} }
} }

Loading…
Cancel
Save