From 6daa8653eade9e822fb01f3efcc6aa7eab19e2a3 Mon Sep 17 00:00:00 2001 From: johnniang Date: Fri, 29 Mar 2019 01:22:49 +0800 Subject: [PATCH] Fix undefined bug --- src/core/lazy_lib/components_use.js | 3 +-- src/utils/service.js | 9 +++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/lazy_lib/components_use.js b/src/core/lazy_lib/components_use.js index c7c28c33..cd44520e 100644 --- a/src/core/lazy_lib/components_use.js +++ b/src/core/lazy_lib/components_use.js @@ -1,4 +1,3 @@ - /* eslint-disable */ /** * 该文件是为了按需加载,剔除掉了一些不需要的框架组件。 @@ -96,4 +95,4 @@ Vue.prototype.$notification = notification Vue.prototype.$info = Modal.info Vue.prototype.$success = Modal.success Vue.prototype.$error = Modal.error -Vue.prototype.$warning = Modal.warning \ No newline at end of file +Vue.prototype.$warning = Modal.warning diff --git a/src/utils/service.js b/src/utils/service.js index 7eebbe4d..25bf9b8d 100644 --- a/src/utils/service.js +++ b/src/utils/service.js @@ -1,7 +1,8 @@ import axios from 'axios' import NProgress from 'nprogress' -import Vue from 'vue' import 'nprogress/nprogress.css' +import Vue from 'vue' +import { message } from 'ant-design-vue' const service = axios.create({ baseURL: process.env.NODE_ENV === 'production' ? 'https://ryanc.cc/' : 'http://localhost:8090', @@ -26,8 +27,8 @@ service.interceptors.response.use( return response }, error => { - Vue.$log.error('Response failed', error) NProgress.done() + Vue.$log.error('Response failed', error) const response = error.response const status = response ? response.status : -1 @@ -49,9 +50,9 @@ service.interceptors.response.use( // TODO handle 500 status error } - Vue.$message.error(data.message) + message.error(data.message) } else { - Vue.$message.error('Unkown reason') + message.error('Unkown reason') } return Promise.reject(error)