小编Dar*_*rem的帖子

使用VS代码调试Vue.js应用程序.错误未验证的断点

我有以下问题.我想用VS Code和Chrome调试我的Vue.js项目.所以我按照网站指南上的官方指南,但它不起作用.问题是我总是得到错误:

 unverified breakpoint
Run Code Online (Sandbox Code Playgroud)

我错了什么?

这是我的 vue.config.js

    module.exports = {
    configureWebpack: {
      devtool: 'source-map'
    }
  }
Run Code Online (Sandbox Code Playgroud)

这是我的调试步骤:

    {
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "chrome",
            "request": "launch",
            "name": "vuejs: chrome",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceFolder}/src",
            "breakOnLoad": true,
            "sourceMapPathOverrides": {
                "webpack:/src/*": "${webRoot}/*",
                "webpack:///./*": "${webRoot}/*",
                "webpack:///src/*": "${webRoot}/*",
                "webpack:///*": "*",
                "webpack:///./~/*": "${webRoot}/node_modules/*",
                "meteor://app/*": "${webRoot}/*"
            }
        }
    ]
} …
Run Code Online (Sandbox Code Playgroud)

javascript google-chrome npm vue.js visual-studio-code

11
推荐指数
2
解决办法
2455
查看次数

ASP.NET Core 3 API忽略Bearertoken的授权属性

我正在研究ASP.NET Core Web API。我正在使用最新的版本3.0.0-preview4.19216.2。

我有一个问题,我的API控制器会忽略Authorize-Attribute,但是在另一个控制器上,该属性可以正常工作。

    [Route("api/[controller]")]
    [ApiController]
    [Authorize(AuthenticationSchemes =JwtBearerDefaults.AuthenticationScheme)]
    public class SuppliersController : ControllerBase
    {

        [HttpGet("GetAll")]
        public IActionResult GetAll()
        {
            var companyId = int.Parse(User.Claims.FirstOrDefault(c => c.Type == "Company_Id").Value); // throws nullreference exception

            return Ok();
        }
    }
Run Code Online (Sandbox Code Playgroud)

但是在另一个控制器上,我也有类似的东西,但是该属性按预期工作

    [Route("api/[controller]")]
    [ApiController]
    [Authorize]
    public class UsersController : ControllerBase
    {
        [HttpGet("{id}")]
        public IActionResult GetById(int id)
        {
            var test = User.Claims.FirstOrDefault(c => c.Type == "Company_Id").Value;
        }

    }
Run Code Online (Sandbox Code Playgroud)

在用户控制器中,一切正常。

我也没有在SupplierController中尝试过

认证方案

但没有什么不同。

这是我在Startup.cs中的AddAuthentication

services.AddAuthentication(x =>
            {
                x.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
                x.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
            })
            .AddJwtBearer(x =>
            { …
Run Code Online (Sandbox Code Playgroud)

.net c# asp.net asp.net-web-api asp.net-core

9
推荐指数
1
解决办法
1333
查看次数

向 ASP.Net MVC 5 添加新主题不起作用

我有以下问题。当我尝试向 ASP.Net MVC 5 添加新主题时,我的导航栏崩溃了。当我使用标准引导程序时,它可以工作。我不知道为什么它不起作用。

这是我的 BundleConfig:

bundles.Add(new StyleBundle("~/Content/css").Include(
                  "~/Content/bootstrap-lumen.css",
                  "~/Content/site.css"));
Run Code Online (Sandbox Code Playgroud)

这是标准 MVC _Layout.cshtml 页面:

<div class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            @Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <li>@Html.ActionLink("Home", "Index", "Home")</li>
                <li>@Html.ActionLink("About", "About", "Home")</li>
                <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
            </ul>
            @Html.Partial("_LoginPartial")
        </div>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

这是我使用普通 Bootstrap 时的结果:

正确的导航栏

这是我尝试使用 Lumen 主题运行时的结果

在此处输入图片说明

有人能帮我吗?在其他项目中,它一直有效,我不知道出了什么问题。

css asp.net asp.net-mvc twitter-bootstrap asp.net-mvc-5

6
推荐指数
1
解决办法
1822
查看次数

无法在Angular 6中添加Bootstrap 4

当我尝试添加最新的bootstrap版本时,我遇到了问题

npm install bootstrap
Run Code Online (Sandbox Code Playgroud)

当我尝试运行时,我收到一条错误消息

ng serve --open
Run Code Online (Sandbox Code Playgroud)

我在angular.json中添加了bootstap

像这样

"styles": [
          "../node_modules/bootstrap/dist/css/bootstrap.min.css",
          "src/styles.css"
        ],
Run Code Online (Sandbox Code Playgroud)

并且错误消息是

    ERROR in multi ../node_modules/bootstrap/dist/css/bootstrap.min.css ./src/styles.css
Module not found: Error: Can't resolve '...\node_modules\bootstrap\dist\css\bootstrap.min.css' in '...'
Run Code Online (Sandbox Code Playgroud)

为什么我收到错误消息?

javascript css twitter-bootstrap angular angular6

2
推荐指数
1
解决办法
4572
查看次数