|
请问我这个代码为什么会报错呢,{"msg":"连接错误,请检查网络或者请求配置是否正确","body":"连接错误,请检查网络或者请求配置是否正确","statusCode":0,"code":0,"headers":{}}
- registerhandle(){
- // 注册处理
- this.game.play_music('../mp3/btn1.mp3');
- // 发送请求
- // 校验手机号是否已经注册
- let uuid = this.game.uuid();
- api.ajax({
- url: this.game.config.server_api,
- method: 'post',
- headers: {
- 'Content-Type': 'application/json;charset=utf-8'
- },
- data: {
- "jsonrpc": "2.0",
- "id": uuid,
- "method": "Users.register",
- "params": {
- "mobile": this.mobile,
- "sms_code": this.sms_code,
- "password": this.password,
- "re_password": this.re_password,
- }
- }
- }, function(ret, err){
- if (ret) {
- api.alert({ msg: JSON.stringify(ret) });
- } else {
- api.alert({ msg: JSON.stringify(err) });
- }
- })
-
-
- }
复制代码 |
|