登陆与用户两个Controller支持跨域访问

This commit is contained in:
Argo-Lenovo 2016-12-23 12:36:30 +08:00
parent 548923b750
commit 2e84178914
3 changed files with 27 additions and 0 deletions

View File

@ -41,5 +41,15 @@ namespace Bootstrap.Admin.Controllers
} }
return new LoginInfo(); return new LoginInfo();
} }
/// <summary>
///
/// </summary>
/// <returns></returns>
[AllowAnonymous]
[HttpOptions]
public string Options()
{
return null;
}
} }
} }

View File

@ -140,5 +140,15 @@ namespace Bootstrap.Admin.Controllers
{ {
return UserHelper.DeleteUser(value); return UserHelper.DeleteUser(value);
} }
/// <summary>
///
/// </summary>
/// <returns></returns>
[AllowAnonymous]
[HttpOptions]
public string Options()
{
return null;
}
} }
} }

View File

@ -83,6 +83,13 @@
<machineKey validation="SHA1" validationKey="78EA3850338FBADCE59D8DDF58C9E4518E75AC149C46142D7AAD7F1AD49D95D4" decryptionKey="684FC9301F404DE1B9565E7D9520AC579E823307BED44885" /> <machineKey validation="SHA1" validationKey="78EA3850338FBADCE59D8DDF58C9E4518E75AC149C46142D7AAD7F1AD49D95D4" decryptionKey="684FC9301F404DE1B9565E7D9520AC579E823307BED44885" />
</system.web> </system.web>
<system.webServer> <system.webServer>
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Methods" value="GET,POST,PUT,DELETE,OPTIONS"/>
<add name="Access-Control-Allow-Headers" value="Token" />
</customHeaders>
</httpProtocol>
<staticContent> <staticContent>
<remove fileExtension=".woff"/> <remove fileExtension=".woff"/>
<mimeMap fileExtension=".woff" mimeType="application/x-font-woff" /> <mimeMap fileExtension=".woff" mimeType="application/x-font-woff" />