我在登录页面、css 文件和 js 文件中有一些内容。
<link rel="stylesheet" type="text/css" href="../../ext/resources/css/ext-all.css" />
<script type="text/javascript" src="../../ext/bootstrap.js"></script>
不幸的是,浏览器对这些的请求会得到 302 响应。Forms Auth 将请求视为未经授权,并将其重定向到登录页面。它没有意识到请求首先来自登录页面。
GET http://localhost:50880/ext/resources/css/ext-all.css HTTP/1.1
HTTP/1.1 302 Found
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/Account/LogOn?ReturnUrl=%2fext%2fresources%2fcss%2fext-all.css">here</a>.</h2>
</body></html>
我想也许为每个人设置包含文件夹(ext)的权限可能会有所帮助。
我在其他项目中没有遇到过这个问题。