Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

跨域无法正常运转 #5

Open
zzyyzz1992 opened this issue Sep 19, 2017 · 6 comments
Open

跨域无法正常运转 #5

zzyyzz1992 opened this issue Sep 19, 2017 · 6 comments

Comments

@zzyyzz1992
Copy link

点击注册按钮输入邮箱无反应,12302端口为code-push-server端口,12303为code-push-web端口
//真实ip隐藏掉了
Console显示:
Fetch API cannot load http://我的ip:12302/users/[email protected]. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://我的ip:12303' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

网上查询到关闭网络安全的命令(Windows):
chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security
关闭后可以正常访问。
还请大神解答,谢谢!

@lisong
Copy link
Owner

lisong commented Sep 20, 2017

参考 #1
设置跨域

@zzyyzz1992
Copy link
Author

感谢,在生产模式下亦进行此设置,登陆、邮箱模块都正常运转。
app.all('*', function(req, res, next) { res.header("Access-Control-Allow-Origin", "*"); res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization"); res.header("Access-Control-Allow-Methods","PUT,POST,GET,PATCH,DELETE,OPTIONS"); next(); });

还有一个问题请教:
就是使用 code-push-cli 查看应用版本是正常的:
`Zeyangs-MacBook-Pro:Mobile zzy$ code-push deployment ls Mobile-android
┌────────────┬──────────────────────────────────┬──────────────────────┐

│ Name │ Update Metadata │ Install Metrics │
├────────────┼──────────────────────────────────┼──────────────────────┤
│ Production │ Label: v2 │ Active: 50% (1 of 2) │
│ │ App Version: 1.3.0 │ Total: 1 (1 pending) │
│ │ Mandatory: No │ │
│ │ Release Time: 30 minutes ago │ │
│ │ Released By: [email protected] │ │
├────────────┼──────────────────────────────────┼──────────────────────┤
│ Staging │ Label: v4 │ Active: 0% (0 of 0) │
│ │ App Version: 1.3.0 │ Total: 0 │
│ │ Mandatory: No │ │
│ │ Release Time: 32 minutes ago │ │
│ │ Released By: [email protected] │ │
└────────────┴──────────────────────────────────┴──────────────────────┘
Zeyangs-MacBook-Pro:Mobile zzy$ code-push deployment ls Mobile-ios
┌────────────┬──────────────────────────────────┬─────────────────────┐
│ Name │ Update Metadata │ Install Metrics │
├────────────┼──────────────────────────────────┼─────────────────────┤
│ Production │ Label: v7 │ Active: 0% (0 of 2) │
│ │ App Version: 1.3.0 │ Total: 0 │
│ │ Mandatory: No │ │
│ │ Release Time: 32 minutes ago │ │
│ │ Released By: [email protected] │ │
├────────────┼──────────────────────────────────┼─────────────────────┤
│ Staging │ Label: v8 │ Active: 0% (0 of 4) │
│ │ App Version: 1.3.0 │ Total: 0 │
│ │ Mandatory: No │ │
│ │ Release Time: 32 minutes ago │ │
│ │ Released By: [email protected] │ │
└────────────┴──────────────────────────────────┴─────────────────────┘
`
但是在 web 端都是空的:
1
2

请问何故?
望能在百忙之中解答一下,谢谢:)

@WaterEye0o
Copy link

+1 我这边code-push用命令行也看到了有输出 但是web上面什么数据都没有

@WaterEye0o
Copy link

@zzyyzz1992 请问web没更新的问题解决了吗?

@zzyyzz1992
Copy link
Author

@WaterEye0o web端我这边没有深究了,终端命令够用就好了,太忙了...

@WaterEye0o
Copy link

恩好的谢谢 @zzyyzz1992

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants