From b8a42265517a691e9ed3ce2788f860dd429ade1e Mon Sep 17 00:00:00 2001 From: yma16 <17685043634@163.com> Date: Mon, 10 Jul 2023 21:19:45 +0800 Subject: [PATCH] perf:no cdn --- build/webpack.prod.conf.js | 2 +- index.html | 4 ++++ src/App.vue | 21 +++++++++++++++++---- src/components/user/Login.vue | 4 ++-- src/components/weather/EchartWeather.vue | 2 +- src/components/weather/echarts/Map.vue | 2 +- src/importElement.js | 4 +++- src/main.js | 22 +++++++++++----------- src/store/index.js | 5 ++--- src/store/modules/user.js | 4 ++-- 10 files changed, 44 insertions(+), 26 deletions(-) diff --git a/build/webpack.prod.conf.js b/build/webpack.prod.conf.js index b68e7e1..ad81f73 100644 --- a/build/webpack.prod.conf.js +++ b/build/webpack.prod.conf.js @@ -20,7 +20,7 @@ const env = let externalModules = {} //cdn 配置 let externalConfig = [] -if (process.env.NODE_ENV === 'production') { +if (process.env.NODE_ENV === 'production' && false) { //生产环境 externalModules = { vue: 'Vue', diff --git a/index.html b/index.html index 83668c4..ed8b38c 100644 --- a/index.html +++ b/index.html @@ -18,6 +18,10 @@ diff --git a/src/App.vue b/src/App.vue index 59eeced..13ed6c4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -26,9 +26,7 @@ stay hungry @@ -82,6 +80,16 @@
+ + + 注销 + + + + +
@@ -159,7 +168,7 @@ export default { currentUserName: function () { return store.state.user.userInfo && store.state.user.userInfo.name ? store.state.user.userInfo.name - : '游客' + : '' } }, mounted () { @@ -285,6 +294,10 @@ export default { .catch((error) => { throw Error(error) }) + }, + loginOut () { + localStorage.removeItem('yma16siteUserInfo') + window.location.reload() } } } diff --git a/src/components/user/Login.vue b/src/components/user/Login.vue index 0aa4fcc..46d7605 100644 --- a/src/components/user/Login.vue +++ b/src/components/user/Login.vue @@ -44,13 +44,13 @@
微软登录(测试中)微软登录(alpha)
QQ登录(测试中)QQ登录(alpha)
diff --git a/src/components/weather/EchartWeather.vue b/src/components/weather/EchartWeather.vue index d683444..804d1a4 100644 --- a/src/components/weather/EchartWeather.vue +++ b/src/components/weather/EchartWeather.vue @@ -15,7 +15,7 @@