h***@163.com
h***@163.com
  • 发布:2019-05-25 15:28
  • 更新:2019-05-25 15:39
  • 阅读:6514

uni-app post请求报错handleProxy function;at api request success callback function

分类:uni-app

uni-app用uni-request发起post请求,请求成功,后端有返回数据,控制台报错,请大佬们帮忙看看怎么回事。

源代码:

//请求接口数据  
                uni.request({  
                    url: this.api_server+'index/login',  
                    method: 'POST',  
                    data: {"account":mobile,"password":passwd},  
                    dataType:'json',  
                    success: function (res) {  
                        uni.hideLoading();  
                        var getData = res.data;  
                        if (getData.code == 0) {  
                            uni.hideLoading();  
                            uni.showToast({  
                                title:"登陆成功",  
                                icon:"success"  
                            });  
                            //将用户数据写入本地并执行跳转  

                            uni.setStorage({  
                                key:'user_info',  
                                data:getData.data,  
                            })  
                            uni.navigateTo({  
                                url:'../index/index'  
                            });  

                        }else{  
                            uni.showToast({  
                                title:getData.msg,  
                                icon:none  
                            });  

                        }  

                    },  
                    fail: function(err) {  
                        uni.showToast({  
                            icon:"none",  
                            title:"请求异常,请重试"  
                        })  
                    },  
                    complete: function() {  
                        uni.hideLoading();  
                    }  
                });

报错信息:
15:22:43.011 thirdScriptError
15:22:43.032 none is not defined;at pages/login/home handleProxy function;at api request success callback function
15:22:43.051 ReferenceError: none is not defined
15:22:43.071 at Function.success (uni-app:///pages/login/home.vue?vue&type=script&lang=js&?af70:91:21)

2019-05-25 15:28 负责人:无 分享
已邀请:
hhyang

hhyang - 如有问题,请添加QQ1606726660 备注付费咨询

亲 字符串

  • h***@163.com (作者)

    好的,非常感谢。

    2019-05-25 15:52

该问题目前已经被锁定, 无法添加新回复