From a99b56c11166cc1b0cde89fe5982c853ced17c57 Mon Sep 17 00:00:00 2001 From: Takumi Kakuda <39277481+takumiz19@users.noreply.github.com> Date: Mon, 25 Oct 2021 19:39:45 +0900 Subject: [PATCH] refactor: replace `process.browser` with `process.client` (#516) --- lib/plugin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/plugin.js b/lib/plugin.js index fc4493e..09bcd64 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -95,7 +95,7 @@ const setupDebugInterceptor = axios => { '[' + res.config.method.toUpperCase() + ']', res.config.url) - if (process.browser) { + if (process.client) { console.log(res) } else { console.log(JSON.stringify(res.data, undefined, 2)) @@ -193,7 +193,7 @@ export default (ctx, inject) => { // runtimeConfig const runtimeConfig = ctx.$config && ctx.$config.axios || {} // baseURL - const baseURL = process.browser + const baseURL = process.client ? (runtimeConfig.browserBaseURL || runtimeConfig.browserBaseUrl || runtimeConfig.baseURL || runtimeConfig.baseUrl || '<%= options.browserBaseURL || '' %>') : (runtimeConfig.baseURL || runtimeConfig.baseUrl || process.env._AXIOS_BASE_URL_ || '<%= options.baseURL || '' %>')