Authored by 周少峰

alert api error message

... ... @@ -36,7 +36,7 @@ const acquireAsync = (cid, uid) => {
default:
return {
code: 500,
message: '领券失败!'
message: result.message
};
}
});
... ...
... ... @@ -158,13 +158,16 @@ bindEvent.add(function() {
couponId: cid
}).then(function(result) {
var defer = $.Deferred(); //eslint-disable-line
var couponAlert;
if (result.code === 200) {
defer.resolve();
} else if (result.code === 400) {
defer.reject({refer: window.signinUrl()});
} else {
defer.reject();
couponAlert = new Alert(result.message);
couponAlert.show();
}
return defer.promise();
... ...