提交 01b389aa 编写于 作者: 麦壳饼's avatar 麦壳饼

update to vue.js

上级 bcb8b6eb
[submodule "ClientApp"]
path = ClientApp
[submodule "IoTSharp/ClientApp"]
path = IoTSharp/ClientApp
url = https://github.com/IoTSharp/IoTSharp-UI.git
branch = master
......@@ -12,7 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IoTSharp.Test", "IoTSharp.Test\IoTSharp.Test.csproj", "{70DFF66F-6791-4713-81F3-DD7A64B59185}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IoTSharp", "IoTSharp\IoTSharp.csproj", "{CCD2C255-72D2-4A25-B0E9-E30FBEF774C7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IoTSharp", "IoTSharp\IoTSharp.csproj", "{CCD2C255-72D2-4A25-B0E9-E30FBEF774C7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
......
.DS_Store
node_modules/
npm-debug.log
# /Properties/launchSettings.json
package-lock.json
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
......@@ -17,7 +25,6 @@
[Rr]eleases/
x64/
x86/
build/
bld/
bin/
Bin/
......@@ -26,6 +33,12 @@ Obj/
# Visual Studio 2015 cache/options directory
.vs/
/wwwroot/dist/**
# Workaround for https://github.com/aspnet/JavaScriptServices/issues/235
!/wwwroot/dist/_placeholder.txt
/yarn.lock
# MSTest test Results
[Tt]est[Rr]esult*/
......@@ -40,6 +53,10 @@ TestResult.xml
[Rr]eleasePS/
dlldata.c
# DNX
project.lock.json
artifacts/
*_i.c
*_p.c
*_i.h
......@@ -179,7 +196,9 @@ ClientBin/
*.publishsettings
orleans.codegen.cs
/node_modules
# Workaround for https://github.com/aspnet/JavaScriptServices/issues/235
/node_modules/**
!/node_modules/_placeholder.txt
# RIA/Silverlight projects
Generated_Code/
......@@ -229,3 +248,5 @@ _Pvt_Extensions
# FAKE - F# Make
.fake/
.vscode/
......@@ -21,7 +21,7 @@
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
<!-- Set this to true if you enable server-side prerendering -->
<BuildServerSideRenderer>false</BuildServerSideRenderer>
<BuildServerSideRenderer>true</BuildServerSideRenderer>
</PropertyGroup>
<ItemGroup>
......@@ -31,6 +31,7 @@
<None Remove="Migrations\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Changwei.AspNetCore.SpaServices.Extensions.VueCli" Version="1.0.0" />
<PackageReference Include="IoTSharp.X509Extensions" Version="1.3.3" />
<PackageReference Include="LiteDB" Version="4.1.4" />
<PackageReference Include="Microsoft.AspNetCore.App" />
......
using IoTSharp.Data;
using IoTSharp.Data;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Builder;
......@@ -7,7 +7,9 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.SpaServices.AngularCli;
using Microsoft.AspNetCore.ResponseCompression;
using Microsoft.AspNetCore.SpaServices.VueCli;
using Microsoft.AspNetCore.SpaServices.Webpack;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
......@@ -16,6 +18,7 @@ using MQTTnet.AspNetCoreEx;
using MQTTnet.Client;
using NSwag.AspNetCore;
using System;
using System.Configuration;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Reflection;
......@@ -55,6 +58,12 @@ namespace IoTSharp
services.AddLogging(loggingBuilder => loggingBuilder.AddConsole());
services.AddIoTSharpHub(Configuration);
// Enable the Gzip compression especially for Kestrel
services.Configure<GzipCompressionProviderOptions>(options => options.Level = System.IO.Compression.CompressionLevel.Optimal);
services.AddResponseCompression(options =>
{
options.EnableForHttps = true;
});
services.AddIdentity<IdentityUser, IdentityRole>()
.AddRoles<IdentityRole>()
......@@ -77,11 +86,9 @@ namespace IoTSharp
configure.Description = description?.Description;
});
services.AddTransient<ApplicationDBInitializer>();
services.AddIoTSharpMqttServer(AppSettings.MqttBroker);
services.AddMqttClient(AppSettings.MqttClient);
}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
......@@ -101,6 +108,7 @@ namespace IoTSharp
app.UseAuthentication();
app.UseSwagger();
app.UseHttpsRedirection();
app.UseIoTSharpMqttClient();
app.UseIotSharpMqttServer();
......@@ -108,8 +116,12 @@ namespace IoTSharp
{
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
});
app.UseResponseCompression(); // No need if you use IIS, but really something good for Kestrel!
app.UseHttpsRedirection();
// Idea: https://code.msdn.microsoft.com/How-to-fix-the-routing-225ac90f
// This avoid having a real mvc view. You have other way of doing, but this one works
// properly.
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseSpaStaticFiles();
......@@ -126,10 +138,10 @@ namespace IoTSharp
// see https://go.microsoft.com/fwlink/?linkid=864501
spa.Options.SourcePath = "ClientApp";
spa.Options.StartupTimeout = new TimeSpan(0, 0, 120);
spa.Options.StartupTimeout = TimeSpan.FromSeconds(80);
if (env.IsDevelopment())
{
spa.UseAngularCliServer(npmScript: "start");
spa.UseVueCliServer(npmScript: "serve");
}
});
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册