简体   繁体   English

Backand - 没有“Access-Control-Allow-Origin”标头

[英]Backand - No 'Access-Control-Allow-Origin' header

I'm trying to register a new user using:我正在尝试使用以下方法注册新用户:

Backand.signup(firstName, lastName, username, password, password2);

but I end up getting:但我最终得到:

XMLHttpRequest cannot load https://api.backand.com/1/user/signup. 
No 'Access-Control-Allow-Origin' header is present on the 
requested resource. Origin 'http://localhost:8100' is therefore 
not allowed access. 
The response had HTTP status code 504.

This endpoint always used to work, with this setup, but it seemed to stop working today.使用此设置,此端点过去一直可以工作,但今天似乎停止工作。 AFAIK, I hit all my endpoints at this url " https://api.backand.com/ doing GET's, PUT's, POST's, etc and they all work as expected. This is the only one showing this behavior. AFAIK,我在这个 url " https://api.backand.com/ 上点击了我的所有端点,做 GET、PUT、POST 等,它们都按预期工作。这是唯一一个显示这种行为的端点。

How could every other endpoint work fine at this url, except for /1/user/signup ?除了/1/user/signup之外,所有其他端点如何在此 url 上正常工作?

Any help would be appreciated.任何帮助将不胜感激。

As you can see in Backand sdk code in github here ,正如您在此处的github 中的 Backand sdk 代码中所见,

signup function take an email and not a username.注册功能需要一个电子邮件而不是用户名。

Is the code:是不是代码:

self.signup = function (firstName, lastName, email, password,confirmPassword, parameters) {
        return BackandAuthService.signup(firstName, lastName, email,
                              password, confirmPassword, parameters);
};

So ensure you send an email and not a simple username.因此,请确保您发送电子邮件而不是简单的用户名。

Another problem can be if you send a password that is less than 6 chars.另一个问题可能是您发送的密码少于 6 个字符。

You can find detailed error in network tab of chrome.您可以在 chrome 的网络选项卡中找到详细的错误信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM