diff --git a/labs/XamarinApp/XamarinApp.iOS/WkWebViewRenderer.cs b/labs/XamarinApp/XamarinApp.iOS/WkWebViewRenderer.cs index b9ab0d79..fb334b22 100644 --- a/labs/XamarinApp/XamarinApp.iOS/WkWebViewRenderer.cs +++ b/labs/XamarinApp/XamarinApp.iOS/WkWebViewRenderer.cs @@ -1,5 +1,4 @@ -using System.Runtime.InteropServices; -using Xamarin.Essentials; +using Xamarin.Essentials; using Xamarin.Forms; using Xamarin.Forms.Platform.iOS; using XamarinApp.iOS; @@ -16,7 +15,7 @@ namespace XamarinApp.iOS if (e.NewElement != null) { - CustomUserAgent = $"{DeviceInfo.Manufacturer}~{DeviceInfo.Model}~{Device.RuntimePlatform}~{(Device.Idiom == TargetIdiom.Tablet ? "ipad" : "iphone")}"; + CustomUserAgent = $"{DeviceInfo.Manufacturer} {DeviceInfo.Model} {Device.RuntimePlatform} {(Device.Idiom == TargetIdiom.Tablet ? "ipad" : "iphone")} Mac OS X"; } } } diff --git a/projects/Infrastructure/Web/BaseStartup.cs b/projects/Infrastructure/Web/BaseStartup.cs index ffcbff4f..36f651c5 100644 --- a/projects/Infrastructure/Web/BaseStartup.cs +++ b/projects/Infrastructure/Web/BaseStartup.cs @@ -284,7 +284,7 @@ namespace Infrastructure.Web { if (!context.Request.IsAjax()) { - context.Response.Redirect("/Account/Login"); + context.Response.Redirect("/UserCenter/Account/Login"); context.HandleResponse(); } return Task.CompletedTask; diff --git a/projects/IoTCenter/Controllers/AccountController.cs b/projects/IoTCenter/Controllers/AccountController.cs index 14371160..6775dd1e 100644 --- a/projects/IoTCenter/Controllers/AccountController.cs +++ b/projects/IoTCenter/Controllers/AccountController.cs @@ -58,9 +58,8 @@ namespace IoTCenter.Controllers public IActionResult Logout() { - var fullReturnUrl = Url.FullAction("Index", "Home"); var logoutUrl = this._cfg["usercenter:logout"]; - var url = logoutUrl.SetParam("returnUrl", fullReturnUrl); + var url = logoutUrl.SetParam("returnUrl", "/IoTCenter/"); return Redirect(url); } @@ -122,9 +121,8 @@ namespace IoTCenter.Controllers [AllowAnonymous] public IActionResult Login(string returnUrl = null) { - var fullReturnUrl = Url.GetFullUrl(returnUrl ?? "~"); var loginUrl = this._cfg["usercenter:login"]; - var url = loginUrl.SetParam(nameof(returnUrl), fullReturnUrl); + var url = loginUrl.SetParam(nameof(returnUrl), returnUrl ?? "/IoTCenter/"); return Redirect(url); } diff --git a/projects/IoTCenter/IoTCenter.csproj b/projects/IoTCenter/IoTCenter.csproj index ca630ff5..321bf136 100644 --- a/projects/IoTCenter/IoTCenter.csproj +++ b/projects/IoTCenter/IoTCenter.csproj @@ -2,7 +2,7 @@ netcoreapp3.1 true - 1.0.0-alpha.317 + 1.0.0-alpha.325 diff --git a/projects/IoTCenter/Views/Home/Device.cshtml b/projects/IoTCenter/Views/Home/Device.cshtml index 05220823..099b55a0 100644 --- a/projects/IoTCenter/Views/Home/Device.cshtml +++ b/projects/IoTCenter/Views/Home/Device.cshtml @@ -60,6 +60,7 @@ var hubUrl = "@Url.Content("~")/hub?group=page"; var onMessage = null; + diff --git a/projects/IoTCenter/appsettings.json b/projects/IoTCenter/appsettings.json index 78a357f5..8631620e 100644 --- a/projects/IoTCenter/appsettings.json +++ b/projects/IoTCenter/appsettings.json @@ -45,9 +45,9 @@ }, "usercenter": { "key": "123456", - "login": "http://localhost:8010/Account/Login", - "logout": "http://localhost:8010/Account/Logout", - "register": "http://localhost:8010/Account/Register" + "login": "http://localhost/UserCenter/Account/Login", + "logout": "http://localhost/UserCenter/Account/Logout", + "register": "http://localhost/UserCenter/Account/Register" }, "ConnectionStrings": { "postgresql": "User ID=root;Host=localhost;Port=26257;Database=iotdb;CommandTimeout=120", diff --git a/projects/IoTCenter/wwwroot/js/iot.js b/projects/IoTCenter/wwwroot/js/iot.js index 5dc513ef..6944fb86 100644 --- a/projects/IoTCenter/wwwroot/js/iot.js +++ b/projects/IoTCenter/wwwroot/js/iot.js @@ -1,8 +1,8 @@ var time = '1d'; if (WXInlinePlayer.isSupport()) { WXInlinePlayer.init({ - asmUrl: '/lib/WXInlinePlayer/prod.all.asm.combine.js', - wasmUrl: '/lib/WXInlinePlayer/prod.all.wasm.combine.js' + asmUrl: baseUrl+'/lib/WXInlinePlayer/prod.all.asm.combine.js', + wasmUrl: baseUrl +'/lib/WXInlinePlayer/prod.all.wasm.combine.js' }); } function getDeviceDataValue(device, name) { @@ -46,67 +46,67 @@ function parseModel(response) { return model; } Vue.component('iot-gateway', function (resolve, reject) { - axios.get("/pages/iot/device/gateway.html").then(function (response) { + axios.get(baseUrl+"/pages/iot/device/gateway.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('iot-light', function (resolve, reject) { - axios.get("/pages/iot/device/light.html").then(function (response) { + axios.get(baseUrl+"/pages/iot/device/light.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('iot-humiture', function (resolve, reject) { - axios.get("/pages/iot/device/humiture.html").then(function (response) { + axios.get(baseUrl+"/pages/iot/device/humiture.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('iot-smoke', function (resolve, reject) { - axios.get("/pages/iot/device/smoke.html").then(function (response) { + axios.get(baseUrl+"/pages/iot/device/smoke.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('iot-person', function (resolve, reject) { - axios.get("/pages/iot/device/person.html").then(function (response) { + axios.get(baseUrl+"/pages/iot/device/person.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('iot-curtain', function (resolve, reject) { - axios.get("/pages/iot/device/curtain.html").then(function (response) { + axios.get(baseUrl+"/pages/iot/device/curtain.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('iot-switch', function (resolve, reject) { - axios.get("/pages/iot/device/switch.html").then(function (response) { + axios.get(baseUrl+"/pages/iot/device/switch.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('iot-switch3', function (resolve, reject) { - axios.get("/pages/iot/device/switch3.html").then(function (response) { + axios.get(baseUrl+"/pages/iot/device/switch3.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('iot-socket', function (resolve, reject) { - axios.get("/pages/iot/device/socket.html").then(function (response) { + axios.get(baseUrl+"/pages/iot/device/socket.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('iot-ir', function (resolve, reject) { - axios.get("/pages/iot/device/ir.html").then(function (response) { + axios.get(baseUrl+"/pages/iot/device/ir.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('iot-color-light', function (resolve, reject) { - axios.get("/pages/iot/device/color-light.html").then(function (response) { + axios.get(baseUrl+"/pages/iot/device/color-light.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('iot-camera', function (resolve, reject) { - axios.get("/pages/iot/device/camera.html").then(function (response) { + axios.get(baseUrl+"/pages/iot/device/camera.html").then(function (response) { resolve(parseModel(response)); }); }); Vue.component('iot-serial-port', function (resolve, reject) { - axios.get("/pages/iot/device/serial-port.html").then(function (response) { + axios.get(baseUrl+"/pages/iot/device/serial-port.html").then(function (response) { resolve(parseModel(response)); }); }); \ No newline at end of file diff --git a/projects/IoTCenter/wwwroot/pages/iot/device/camera.html b/projects/IoTCenter/wwwroot/pages/iot/device/camera.html index d1043cd0..34078681 100644 --- a/projects/IoTCenter/wwwroot/pages/iot/device/camera.html +++ b/projects/IoTCenter/wwwroot/pages/iot/device/camera.html @@ -5,26 +5,7 @@
- - +
@@ -85,7 +66,7 @@ this.playByFlvJs(); } else { - this.playByWXInlinePlayer(); + this.playHls(); } }, destroyed: function () { @@ -98,9 +79,13 @@ this.wxInlinePlayer.stop(); } else { + this.wxInlinePlayer.play(); } }, + playHls: function () { + $('video.' + this.device.number).attr('src', this.url); + }, playByFlvJs: function () { var videoElement = $('video.' + this.device.number)[0]; var push = Enumerable.from(this.device.data).where(o => o.name === '推流').firstOrDefault(); @@ -258,11 +243,16 @@ }, computed: { url: function () { - return location.protocol + '//' + location.hostname + '/live/' + this.device.number + '.flv'; + if (this.isFlvSupported) { + return location.protocol + '//' + location.hostname + '/live/' + this.device.number + '.flv'; + } + else { + return location.protocol + '//' + location.hostname + '/live/' + this.device.number + '.m3u8'; + } //return getDeviceDataValue(this.device, 'flv'); }, isFlvSupported: function () { - return flvjs.isSupported(); + return flvjs.isSupported() && window.navigator.userAgent.indexOf('Mac OS X') === -1;//AppleWebKit }, ptz: function () { if (getDeviceDataValue(this.device, '云台地址')) { diff --git a/projects/IoTNode/Startup.cs b/projects/IoTNode/Startup.cs index 6e85e9e7..d7036838 100644 --- a/projects/IoTNode/Startup.cs +++ b/projects/IoTNode/Startup.cs @@ -102,7 +102,7 @@ namespace IoTNode set.Add(new Setting { Name = "stream.rtmp", Value = stream }); set.Add(new Setting { Name = "stream.flv", Value = $"{stream})" }); set.Add(new Setting { Name = "stream.hls", Value = $"{stream})" }); - set.Add(new Setting { Name = "ffmpeg.args", Value = " -y -threads {0}) -rtsp_transport tcp -use_wallclock_as_timestamps 1 -stimeout 3000000 -i \"{1})\" -fflags +genpts -c copy -f flv \"{2})\"" }); + set.Add(new Setting { Name = "ffmpeg.args", Value = " -y -threads {0} -rtsp_transport tcp -use_wallclock_as_timestamps 1 -stimeout 3000000 -i \"{1}\" -fflags +genpts -c copy -f flv \"{2}\"" }); set.Add(new Setting { Name = "fbee.writelist", Value = "" }); set.Add(new Setting { Name = "camera.writelist", Value = "" }); dbContext.SaveChanges(); diff --git a/projects/UserCenter/Startup.cs b/projects/UserCenter/Startup.cs index e4d08075..e9276f63 100644 --- a/projects/UserCenter/Startup.cs +++ b/projects/UserCenter/Startup.cs @@ -161,9 +161,9 @@ namespace UserCenter Icon = "/images/iotcenter.png", Name = "物联网平台", Description = "智能设备管控中心", - Home = $"http://{host}:8011/", - Login = $"http://{host}:8011/Account/JsonpLogin", - Logout = $"http://{host}:8011/Account/JsonpLogout", + Home = $"http://{host}/IoTCenter/", + Login = $"http://{host}/IoTCenter/Account/JsonpLogin", + Logout = $"http://{host}/IoTCenter/Account/JsonpLogout", Key = "123456" }); dbContext.Set().Add(new Site diff --git a/projects/WebMVC/wwwroot/index.html b/projects/WebMVC/wwwroot/index.html index c4de8265..3baabb17 100644 --- a/projects/WebMVC/wwwroot/index.html +++ b/projects/WebMVC/wwwroot/index.html @@ -5,6 +5,8 @@ - 物联网平台 + \ No newline at end of file diff --git a/projects/WebSPA/wwwroot/js/config.js b/projects/WebSPA/wwwroot/js/config.js index 7c9606ca..48e5821c 100644 --- a/projects/WebSPA/wwwroot/js/config.js +++ b/projects/WebSPA/wwwroot/js/config.js @@ -1,6 +1,5 @@ var config = (function(global){ global.apigateway = 'http://192.168.1.8'; // 设置通过API网关访问 - //global.resourceUrl = 'http://192.168.3.118'; // 媒体文件资源 global.iotCenterUrl = global.apigateway + '/IoTCenter'; // IoT服务API global.hubUrl = global.apigateway + '/IoTCenter/hub?group=page'; // 设备WebSocket访问地址 global.liverUrl = global.apigateway; // 流媒体服务器地址 diff --git a/projects/WebSPA/wwwroot/pages/iot/device/camera.html b/projects/WebSPA/wwwroot/pages/iot/device/camera.html index 30143372..6a1abd6c 100644 --- a/projects/WebSPA/wwwroot/pages/iot/device/camera.html +++ b/projects/WebSPA/wwwroot/pages/iot/device/camera.html @@ -5,38 +5,19 @@
- - +
- + - + - + - +