src/EasyFrameWork/Mvc/Resource/ExtApplicationBuilder.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/* http://www.zkea.net/
* Copyright (c) ZKEASOFT. All rights reserved.
* http://www.zkea.net/licenses */
using Easy.Serializer;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace Easy.Mvc.Resource
{
public static class ExtApplicationBuilder
{
public static void ConfigureResource(this IApplicationBuilder applicationBuilder)
{
foreach (var item in applicationBuilder.ApplicationServices.GetServices<ResourceManager>())
{
item.SetupResource();
}
FileInfo file = new FileInfo("assets.json");
if (file.Exists)
{
using (StreamReader reader = file.OpenText())
{
var replacement = JsonConverter.Deserialize<Replacement>(reader.ReadToEnd());
if (replacement.Scripts != null)
{
foreach (var item in ResourceHelper.ScriptSource)
{
if (replacement.Scripts.ContainsKey(item.Key))
{
int count = Math.Min(item.Value.Count, replacement.Scripts[item.Key].Count);
for (int i = 0; i < count; i++)
{
string newSource = replacement.Scripts[item.Key][i];
ResourceEntity resource = item.Value[i];
resource.DebugSource = newSource;
resource.ReleaseSource = newSource;
if (resource.CDN != null)
{
resource.CDN.Enable = false;
}
}
}
}
}
if (replacement.Styles != null)
{
foreach (var item in ResourceHelper.StyleSource)
{
if (replacement.Styles.ContainsKey(item.Key))
{
int count = Math.Min(item.Value.Count, replacement.Styles[item.Key].Count);
for (int i = 0; i < count; i++)
{
string newSource = replacement.Styles[item.Key][i];
ResourceEntity resource = item.Value[i];
后面还有 17 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。