From 745133a70b3eb595e1341739ef9c0d77c1f532e5 Mon Sep 17 00:00:00 2001 From: johnniang Date: Mon, 1 Apr 2019 15:16:57 +0800 Subject: [PATCH] Update option api --- src/api/option.js | 2 +- src/utils/axios.js | 35 --- src/utils/service.js | 2 +- src/views/system/OptionForm.vue | 463 ++++++++++++++++++++++++-------- 4 files changed, 355 insertions(+), 147 deletions(-) delete mode 100644 src/utils/axios.js diff --git a/src/api/option.js b/src/api/option.js index 0fc49402..5d89ca18 100644 --- a/src/api/option.js +++ b/src/api/option.js @@ -1,6 +1,6 @@ import service from '@/utils/service' -const baseUrl = '/admin/api/options' +const baseUrl = '/admin/api/options/map_view' const optionApi = {} diff --git a/src/utils/axios.js b/src/utils/axios.js deleted file mode 100644 index 1149e12c..00000000 --- a/src/utils/axios.js +++ /dev/null @@ -1,35 +0,0 @@ -const VueAxios = { - vm: {}, - // eslint-disable-next-line no-unused-vars - install(Vue, instance) { - if (this.installed) { - return - } - this.installed = true - - if (!instance) { - // eslint-disable-next-line no-console - console.error('You have to install axios') - return - } - - Vue.axios = instance - - Object.defineProperties(Vue.prototype, { - axios: { - get: function get() { - return instance - } - }, - $http: { - get: function get() { - return instance - } - } - }) - } -} - -export { - VueAxios -} diff --git a/src/utils/service.js b/src/utils/service.js index 02d00d31..864a2288 100644 --- a/src/utils/service.js +++ b/src/utils/service.js @@ -35,7 +35,7 @@ service.interceptors.response.use( const status = response ? response.status : -1 Vue.$log.error('Server response status', status) - const data = response.data + const data = response ? response.data : null if (data) { // Business response Vue.$log.error('Business response status', data.status) diff --git a/src/views/system/OptionForm.vue b/src/views/system/OptionForm.vue index cb9f8e8c..5d999e86 100644 --- a/src/views/system/OptionForm.vue +++ b/src/views/system/OptionForm.vue @@ -1,24 +1,48 @@