diff --git a/electron/controller/hardware.js b/electron/controller/hardware.js index bb55197..97ff8e8 100644 --- a/electron/controller/hardware.js +++ b/electron/controller/hardware.js @@ -19,11 +19,11 @@ class HardwareController extends Controller { /** * 获取打印机列表 */ - getPrinterList () { + async getPrinterList () { //主线程获取打印机列表 const win = CoreWindow.getMainWindow(); - const list = win.webContents.getPrinters(); + const list = await win.webContents.getPrintersAsync(); return list; } diff --git a/frontend/src/utils/axios.js b/frontend/src/utils/axios.js deleted file mode 100644 index 3b91f6b..0000000 --- a/frontend/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/frontend/src/utils/request.js b/frontend/src/utils/request.js index 0a171a0..9007ad0 100644 --- a/frontend/src/utils/request.js +++ b/frontend/src/utils/request.js @@ -1,7 +1,6 @@ import notification from 'ant-design-vue/es/notification' import axios from 'axios' import storage from 'store2' -import { VueAxios } from './axios' // 创建 axios 实例 const request = axios.create({ @@ -47,17 +46,9 @@ request.interceptors.response.use((response) => { return response.data }, errorHandler) -const installer = { - vm: {}, - install (Vue) { - Vue.use(VueAxios, request) - } -} - export default request export { - installer as VueAxios, request as axios } diff --git a/frontend/src/views/framework/java/Index.vue b/frontend/src/views/framework/java/Index.vue index 032cbba..02994cc 100644 --- a/frontend/src/views/framework/java/Index.vue +++ b/frontend/src/views/framework/java/Index.vue @@ -17,6 +17,7 @@ - \ No newline at end of file diff --git a/frontend/src/views/os/notification/Index.vue b/frontend/src/views/os/notification/Index.vue index 456ff7b..b93ab58 100644 --- a/frontend/src/views/os/notification/Index.vue +++ b/frontend/src/views/os/notification/Index.vue @@ -18,6 +18,7 @@