一.git无法推送的报错
master -> master (prohibited by Git: Git:You are not allowed to push code to a protected branch on this project.)
如果是master但报这个错的话,可能是因为ssh密钥错误导致
ssh-keygen -t rsa -C “13000000000@163.com”
二.catch会捕获方法中的错误
that.Request.getRes(data).then(res =>{
if (res.status == 200) {
console.log("成功");
console.log(res);
that.state = res.message[0].state;
if (that.state == 6) {
wx.setNavigationBarTitle({
title: "真伪信息"
})
}
that.redeemData = res.message[0];
that.content = that.redeemData.jackpot;
let str = that.redeemData.content;
let strArray = [];
console.log("str"+str);
if (str) {
strArray = str.split("*");
}
that.specification = strArray[0];
}else if(res.status == 500){
wx.showToast({
title: '网络错误', //提示的内容,
icon: 'none', //图标,
duration: 2000, //延迟时间,
mask: true, //显示透明蒙层,防止触摸穿透,
});
}
}).catch(res =>{
console.log("接口错误");
console.log(res);
wx.showToast({
title: '接口错误', //提示的内容,
icon: 'none', //图标,
duration: 2000, //延迟时间,
mask: true, //显示透明蒙层,防止触摸穿透,
});
})