小编Jay*_*Jay的帖子

登录到MVC 5 ASP.NET模板从根文件夹移动时Web应用程序失败

我使用ASP.NET Web应用程序模板创建了一个带有"身份验证:个人用户帐户"的新"单页应用程序".它将使用默认设置运行,没有任何问题.

如果我不将应用程序部署到Web服务器的根文件夹,则身份验证将失败.罪魁祸首在app.viewmodel.js文件中,可以找到以下代码:

self.addViewModel = function (options) {
    var viewItem = new options.factory(self, dataModel),
        navigator;

    // Add view to AppViewModel.Views enum (for example, app.Views.Home).
    self.Views[options.name] = viewItem;

    // Add binding member to AppViewModel (for example, app.home);
    self[options.bindingMemberName] = ko.computed(function () {
        if (!dataModel.getAccessToken()) {
            // The following code looks for a fragment in the URL to get the access token which will be
            // used to call the protected Web API resource
            var fragment = common.getFragment();

            if (fragment.access_token) {
                // …
Run Code Online (Sandbox Code Playgroud)

asp.net asp.net-mvc asp.net-identity

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

标签 统计

asp.net ×1

asp.net-identity ×1

asp.net-mvc ×1