Comments (3)
经典问题,要么后端配置跨域,要么前端全局适配器走axios,但还是推荐后端配置好它,就可以使用amis的默认方式了
from amis.
经典问题,要么后端配置跨域,要么前端全局适配器走axios,但还是推荐后端配置好它,就可以使用amis的默认方式了
后端用的是.net core,我建立一个简单的webapi来测试,结果也是提示跨域错误,在startup里面也配置了跨域的方式,我用官网上的例子就能请求成功
namespace webapi
{
public class Startup
{
public IHostEnvironment Environment { get; }
public IConfiguration Configuration { get; }
public Startup(IConfiguration configuration,IHostEnvironment environment)
{
Configuration = configuration;
Environment = environment;
}
public void ConfigureServices(IServiceCollection services)
{
services.AddCors();
}
public void Configure(IApplicationBuilder app,IHostEnvironment env,ILoggerFactory loggerFactory)
{
app.UseCors(builder => builder.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader());
}
}
}
from amis.
这个还是自行搜索 cors headers 解决吧,不管你是什么 client 都会遇到这个问题,后端返回 header 里面补上相关信息即可
from amis.
Related Issues (20)
- input-datetime类型控件编辑时,如果连续点选某个日期或某个小时分两次值会跳8小时
- 无法打印表格 HOT 1
- JSSDK乱码
- 表单数据缓存
- input-table配置合并单元格后,表格错行 HOT 1
- picker组件 开启标签收纳,已选隐藏项样式有问题
- 如何禁止提交initApi获取表单的数据,只提交当前表单填写的数据 HOT 3
- aside中badge 动态设置数据
- inputTable组件在行内编辑时存在延迟更新数据域的问题
- amis-editor,编辑器初始化改变schema,导致功能无法使用
- tpl js模版引擎会自动转义
- #10134 table2刷新页面改成crud2下发存在bug HOT 1
- amis-editor-demo本地安装运行错误
- 移动端nav组件样式问题
- select控件搜索功能,输入搜索条件后,如果搜索结果没有包含当前控件本身已选中值项的话,已选中项会显示为选项value,应该显示为选项label
- dynamic input-range
- image配置enlargeTitle、enlargeCaption文字超过一行时展示有问题
- 爱速搭模组件模版功能有开源计划吗?
- 弹出窗口中下拉框联动CRUD表格内容不刷新数据 HOT 3
- Change view from List to Cards
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amis.