public static void AddUrlResolve(this IServiceCollection services, IConfiguration config) { services.Add(new ServiceDescriptor(typeof(UrlResolveService), typeof(UrlResolveService), ServiceLifetime.Singleton)); //读取配置文件 UrlResolveService.AuthorityUrl = config["AuthorityUrl"]; } }