Former-commit-id: 70f05d5d47b4204bbde7b2197d69ef6faf714e0d
TangShanKaiPing
zhengpengju 5 years ago
commit 553999a2c9

@ -77,6 +77,10 @@ namespace Infrastructure.Application
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{ {
if (PageIndex < 1)
{
yield return new ValidationResult("当前页索引必须大于等于1");
}
if (PageSize > 1000) if (PageSize > 1000)
{ {
yield return new ValidationResult("分页数量超出系统限制"); yield return new ValidationResult("分页数量超出系统限制");

@ -3,18 +3,14 @@
var links = Model.GetPageIndexs(); var links = Model.GetPageIndexs();
var url = Url.Content("~") + this.Context.Request.Path + this.Context.Request.QueryString; var url = Url.Content("~") + this.Context.Request.Path + this.Context.Request.QueryString;
var pageIndexParam = "PageIndex"; var pageIndexParam = "PageIndex";
var firstUrl = url.RemoveParam("PageIndex"); var empty = "javascript:;";
var prevUrl = Model.PageIndex - 1 == 1 ? firstUrl : url.SetParam(pageIndexParam, Model.PageIndex - 1); var firstUrl = url.RemoveParam(pageIndexParam);
var prevUrl = Model.PageIndex - 1 >= 1 ? url.SetParam(pageIndexParam, Model.PageIndex - 1) : empty;
var lastUrl = Model.TotalCount > 0 ? url.SetParam(pageIndexParam, Model.PageCount()) : empty;
var nextUrl = Model.PageIndex + 1 <= Model.PageCount() ? url.SetParam(pageIndexParam, Model.PageIndex + 1) : empty;
<ul class="pagination pagination-sm m-0 float-right"> <ul class="pagination pagination-sm m-0 float-right">
<li class="page-item"><a class="page-link" href="@firstUrl">首页</a></li> <li class="page-item"><a class="page-link" href="@firstUrl">首页</a></li>
@if (Model.HasPrev()) <li class="page-item"><a class="page-link" href="@prevUrl">上一页</a></li>
{
<li class="page-item"><a class="page-link" href="@url.SetParam(pageIndexParam,Model.PageIndex-1)">上一页</a></li>
}
else
{
<li class="page-item"><a class="page-link" href="javascript:;">上一页</a></li>
}
@foreach (var item in links) @foreach (var item in links)
{ {
if (item == Model.PageIndex) if (item == Model.PageIndex)
@ -26,19 +22,11 @@
<li class="page-item"><a class="page-link" href="@url.SetParam(pageIndexParam,item)">@item</a></li> <li class="page-item"><a class="page-link" href="@url.SetParam(pageIndexParam,item)">@item</a></li>
} }
} }
@if (Model.HasNext()) <li class="page-item"><a class="page-link" href="@nextUrl">下一页</a></li>
{ <li class="page-item"><a class="page-link" href="@lastUrl">末页</a></li>
<li class="page-item"><a class="page-link" href="@url.SetParam(pageIndexParam,Model.PageIndex+1)">下一页</a></li>
}
else
{
<li class="page-item"><a class="page-link" href="javascript:;">下一页</a></li>
}
<li class="page-item"><a class="page-link" href="@url.SetParam(pageIndexParam,Model.PageCount())">末页</a></li>
<li class="page-item"><a class="page-link" href="javascript:;">@Model.PageIndex / @Model.PageCount()</a></li> <li class="page-item"><a class="page-link" href="javascript:;">@Model.PageIndex / @Model.PageCount()</a></li>
<li class="page-item"> <li class="page-item">
@Html.DropDownListFor(o => Model.PageSize, Model.GetPageSizes().Select(o => new SelectListItem { Text = o.ToString(), Value = o.ToString() }), new { @class = "page-link" }) @Html.DropDownListFor(o => Model.PageSize, Model.GetPageSizes().Select(o => new SelectListItem { Text = o.ToString(), Value = o.ToString() }), new { @class = "page-link" })
</li> </li>
</ul> </ul>
} }

@ -35,7 +35,6 @@ using Microsoft.IdentityModel.Tokens;
using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Models;
using Newtonsoft.Json; using Newtonsoft.Json;
using System; using System;
using System.Buffers;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -264,7 +263,11 @@ namespace Infrastructure.Web
{ {
OnTokenValidated = context => OnTokenValidated = context =>
{ {
if (DateTime.UtcNow > context.SecurityToken.ValidTo) if (context.SecurityToken == null)
{
context.Fail("token error");
}
else if (DateTime.UtcNow > context.SecurityToken.ValidTo)
{ {
context.Fail("token time out"); context.Fail("token time out");
} }

@ -1,5 +1,5 @@
@section bread{ @section bread{
<li class="breadcrumb-item"><a href="@Url.Action("Product","Home",new { number=Model})">产品</a></li> <li class="breadcrumb-item"><a href="@Url.Action("Product","Home",new { number=Context.Request.Query["productNumber"]})">产品</a></li>
} }
<div id="template"> <div id="template">
<template v-if="device"> <template v-if="device">

File diff suppressed because one or more lines are too long

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WebRTCPlayer</title>
<style type="text/css">
html, body {
background-color: #111;
text-align: center;
}
</style>
</head>
<body>
<div class="jswebrtc" data-url="webrtc://localhost/live/b57e867ae29d11b483864cbd8fd0f747"></div>
<script type="text/javascript" src="jswebrtc.min.js"></script>
</body>
</html>

@ -28,7 +28,11 @@ namespace UserCenter.Areas.Admin.Controllers
public override IQueryable<User> Query(SearchUserModel model, IQueryable<User> query) public override IQueryable<User> Query(SearchUserModel model, IQueryable<User> query)
{ {
return query.WhereIf(!model.IsDeleted, o => o.IsDeleted == null); if (model.IsDeleted)
{
return query.Where(o => o.IsDeleted != null);
}
return query.Where(o => o.IsDeleted == null);
} }
public override IQueryable<User> Include(IQueryable<User> query) public override IQueryable<User> Include(IQueryable<User> query)

File diff suppressed because one or more lines are too long

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WebRTCPlayer</title>
<style type="text/css">
html, body {
background-color: #111;
text-align: center;
}
</style>
</head>
<body>
<div class="jswebrtc" data-url="webrtc://localhost/live/b57e867ae29d11b483864cbd8fd0f747"></div>
<script type="text/javascript" src="jswebrtc.min.js"></script>
</body>
</html>

@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WebRTCPlayer</title>
</head>
<body>
<video id="video-webrtc" controls></video>
<script type="text/javascript" src="../dist/jswebrtc.min.js"></script>
<script type="text/javascript">
var video = document.getElementById('video-webrtc');
var url = 'webrtc://osiii.com/live/livestream';
var player = new JSWebrtc.Player(url, { video: video, autoplay: true, onPlay: (obj) => { console.log("start play") } });
</script>
</body>
</html>

@ -13,6 +13,9 @@ services:
webmvc: webmvc:
image: nginx:1.18 image: nginx:1.18
restart: always restart: always
networks:
default:
ipv4_address: 10.0.1.80
environment: environment:
TZ: "Asia/Shanghai" TZ: "Asia/Shanghai"
volumes: volumes:
@ -21,6 +24,9 @@ services:
webspa: webspa:
image: nginx:1.18 image: nginx:1.18
restart: always restart: always
networks:
default:
ipv4_address: 10.0.1.90
environment: environment:
TZ: "Asia/Shanghai" TZ: "Asia/Shanghai"
volumes: volumes:

@ -4,6 +4,9 @@ services:
usercenter: usercenter:
image: mcr.microsoft.com/dotnet/core/runtime-deps:3.1-focal image: mcr.microsoft.com/dotnet/core/runtime-deps:3.1-focal
restart: always restart: always
networks:
default:
ipv4_address: 10.0.1.110
environment: environment:
- TZ=Asia/Shanghai - TZ=Asia/Shanghai
- ASPNETCORE_ENVIRONMENT=Docker - ASPNETCORE_ENVIRONMENT=Docker
@ -15,6 +18,9 @@ services:
iotcenter: iotcenter:
image: mcr.microsoft.com/dotnet/core/runtime-deps:3.1-focal image: mcr.microsoft.com/dotnet/core/runtime-deps:3.1-focal
restart: always restart: always
networks:
default:
ipv4_address: 10.0.1.120
environment: environment:
- TZ=Asia/Shanghai - TZ=Asia/Shanghai
- ASPNETCORE_ENVIRONMENT=Docker - ASPNETCORE_ENVIRONMENT=Docker

@ -1,8 +1,17 @@
version: "3.8" version: "3.8"
networks:
default:
driver: overlay
ipam:
config:
- subnet: 10.0.1.0/24
services: services:
#https://portainer.readthedocs.io/en/latest/deployment.html
portainer: portainer:
image: portainer/portainer:1.23.2 image: portainer/portainer:1.23.2
restart: always
networks:
default:
ipv4_address: 10.0.1.20
ports: ports:
- 9000:9000 - 9000:9000
volumes: volumes:
@ -11,18 +20,28 @@ services:
mysql: mysql:
image: mysql:8.0 image: mysql:8.0
restart: always restart: always
networks:
default:
ipv4_address: 10.0.1.30
environment: environment:
- MYSQL_ROOT_PASSWORD=root - MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=jobserver - MYSQL_DATABASE=jobserver
command: --default-authentication-plugin=mysql_native_password command: --default-authentication-plugin=mysql_native_password
volumes: volumes:
- ./mysql:/var/lib/mysql - ./mysql:/var/lib/mysql
redis: redis:
image: redis:6.0 image: redis:6.0
restart: always restart: always
networks:
default:
ipv4_address: 10.0.1.40
influxdb: influxdb:
image: influxdb:1.8 image: influxdb:1.8
restart: always restart: always
networks:
default:
ipv4_address: 10.0.1.50
hostname: influxdb hostname: influxdb
environment: environment:
TZ: "Asia/Shanghai" TZ: "Asia/Shanghai"
@ -33,6 +52,9 @@ services:
- ./influxdb:/var/lib/influxdb - ./influxdb:/var/lib/influxdb
srs: srs:
image: ossrs/srs:v4.0.23 image: ossrs/srs:v4.0.23
networks:
default:
ipv4_address: 10.0.1.60
environment: environment:
TZ: "Asia/Shanghai" TZ: "Asia/Shanghai"
restart: always restart: always
@ -46,6 +68,9 @@ services:
nginx: nginx:
image: nginx:1.18 image: nginx:1.18
restart: always restart: always
networks:
default:
ipv4_address: 10.0.1.70
environment: environment:
TZ: "Asia/Shanghai" TZ: "Asia/Shanghai"
ports: ports:

@ -45,11 +45,11 @@ http {
} }
location ^~ /live/ { location ^~ /live/ {
proxy_pass http://host.docker.internal:8080/live/; proxy_pass http://srs:8080/live/;
} }
location ^~ /video/ { location ^~ /video/ {
proxy_pass http://host.docker.internal:8080/video/; proxy_pass http://srs:8080/video/;
} }
location ^~ /UserCenter/ { location ^~ /UserCenter/ {

Loading…
Cancel
Save