|
@@ -70,7 +70,7 @@ export function requestData (options) {
|
|
|
store.state.loading = false;
|
|
|
}
|
|
|
if (response.code === 200) {
|
|
|
- options.success(resolve(response));
|
|
|
+ options.success && options.success(resolve(response));
|
|
|
} else {
|
|
|
Message.error(response.message || ("请求出错[" + response.code + "]"));
|
|
|
}
|
|
@@ -78,7 +78,7 @@ export function requestData (options) {
|
|
|
if (options.showLoading) {
|
|
|
store.state.loading = false;
|
|
|
}
|
|
|
- options.fail(reject(error));
|
|
|
+ options.fail && options.fail(reject(error));
|
|
|
});
|
|
|
});
|
|
|
}
|