Showing
1 changed file
with
12 additions
and
8 deletions
@@ -15,14 +15,18 @@ var util = { | @@ -15,14 +15,18 @@ var util = { | ||
15 | async: options.async, | 15 | async: options.async, |
16 | dataType: 'json', | 16 | dataType: 'json', |
17 | data: options.data || {}, | 17 | data: options.data || {}, |
18 | - success: function(res) { | ||
19 | - res = res.data; | ||
20 | - if (("" + res.code) === "200") { | ||
21 | - notip ? (callback && callback.bind(this, res)()) : util.__tip(res.message, "success", callback && callback.bind(this, res)()); | ||
22 | - return true; | ||
23 | - } else { | ||
24 | - (!notip) && util.__tip(res.message, "danger"); | ||
25 | - return false; | 18 | + success: function(result) { |
19 | + res = result.data; | ||
20 | + if(res){ | ||
21 | + if (("" + res.code) === "200") { | ||
22 | + notip ? (callback && callback.bind(this, res)()) : util.__tip(res.message, "success", callback && callback.bind(this, res)()); | ||
23 | + return true; | ||
24 | + } else { | ||
25 | + (!notip) && util.__tip(res.message, "danger"); | ||
26 | + return false; | ||
27 | + } | ||
28 | + }else{ | ||
29 | + util.__tip(result.message, "danger"); | ||
26 | } | 30 | } |
27 | }, | 31 | }, |
28 | error: function(err) { | 32 | error: function(err) { |
-
Please register or login to post a comment