起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1391|回复: 1

[处理中3] 访问.net问题,能查询,不能保存

[复制链接]

21

主题

39

帖子

239

积分

中级会员

Rank: 3Rank: 3

积分
239
QQ
发表于 2017-5-22 14:51:48 | 显示全部楼层 |阅读模式
XMLHttpRequest cannot load http://localhost:2080/baas/PigManager/Pig_action/saveJxDw. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.send @ core.min.js:71h.extend.ajax @ core.min.js:71i.sendRequest @ core.min.js:71r.extend.doSaveData @ common.min.js:15justep.ModelComponent.extend.saveData @ common.min.js:15Model.saveBtnClick @ mainActivity.js:10r.extend.fire @ core.min.js:71r.extend.fireEvent @ core.min.js:71n.callParent @ core.min.js:71Component.extend.fireEvent @ common.min.js:15n.BindComponent.extend._doClick @ comp.min.js:144h.isFunction.i @ core.min.js:71h.event.dispatch @ core.min.js:71g.handle @ core.min.js:71
core.min.js:71 Uncaught Error: __justepClientErrorStart__{"code":"JUSTEP230109","message":"网络出错"}__justepClientErrorEnd__
http://localhost:8080/x5/UI2/v_/PigManager/mainActivity.w?device=m
动态配置访问baas的路径:justep.Baas.BASE_URL = "http://localhost:2080/baas";

能查询出数据,但不能保存,麻烦明白的再给指点指点,考虑了半天,解决不了!!!!!
发表于 2017-5-22 15:20:34 | 显示全部楼层
是跨域问题!BaasServer的端口和 访问.w页面的端口不一致 就会参数跨域
请设置BaasServer 支持跨域请求

response.setHeader(“Access-Control-Allow-Origin”, “*”);

跨域的解决方法请参考:
http://docs.wex5.com/ajax-cross-domain/
baas的跨域
http://docs.wex5.com/wex5-server-question-list-2011/
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-9-23 22:36 , Processed in 0.054511 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表