var url = require('url'); var a = url.resolve('/one/two/three', 'four') , b = url.resolve('http://example.com/', '/one'), c = url.resolve('http://example.com/one', '/two'); console.log(a +","+ b +","+ c); //输出结果: ///one/two/four //http
参考资料:https://sites.google.com/site/netcorenote/asp-net-core/get-scheme-url-host Example there's an given url: http://localhost:4800/account/login 获取整个url地址: 在页面(cstml)中 Microsoft.AspNetCore.Http.Extensions.UriHelper.GetDisplayUrl(Context.Request); 在