提交 b8a42265 编写于 作者: yma16's avatar yma16

perf:no cdn

上级 17f6dbff
......@@ -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',
......
......@@ -18,6 +18,10 @@
<style>
body {
overflow: hidden;
background: url("https://yongma16.xyz/staticFile/common/img/blogScene.jpg");
background-position: center center;
background-clip: border-box;
background-repeat: no-repeat;
}
</style>
<!-- cdn css-->
......
......@@ -26,9 +26,7 @@
<el-submenu index="1-1">
<template slot="title"
>yma16
<span v-if="currentUserName">{{
currentUserName
}}</span></template
</template
>
<el-menu-item index="1-1-1">stay hungry</el-menu-item>
<a @click="jumpToEcharts">
......@@ -82,6 +80,16 @@
<!-- >&nbsp;&nbsp;在线聊天室</i-->
<!-- >-->
<div style="float: right; overflow: hidden;display: flex;justify-items: center;align-items:center;word-spacing: 16px;">
<span style="cursor: pointer; width: 80px" v-if="currentUserName">
<el-popover
trigger="click">
<span @click="loginOut" style="cursor: pointer; height: 16px">注销</span>
<template slot="reference">
<i class="el-icon-user" style="font-weight: 300">{{currentUserName}}</i>
</template>
</el-popover>
</span>
<a href="https://codechina.csdn.net/qq_38870145/myblogvue"
><img
src="@/assets/img/code-china.png"
......@@ -93,6 +101,7 @@
src="@/assets/img/github-fill.png"
style="cursor: pointer; height: 16px"
/></a>
</div>
<!-- <a v-on:click="changeNavigate"><i class="el-icon-menu"></i></a> -->
......@@ -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()
}
}
}
......
......@@ -44,13 +44,13 @@
<div style="width:50%;text-align: center">
<img src="https://ts2.cn.mm.bing.net/th?id=ODLS.f9daea21-9936-4164-815f-b5209459f3c6&w=32&h=32&qlt=90&pcl=fffffa&o=6&pid=1.2" style="width:10px;line-height: 56px"/>
<el-link type="primary" @click="thirdLogin('azure')"
>微软登录(测试中)</el-link
>微软登录(alpha)</el-link
>
</div>
<div style="width:50%;text-align: center">
<img src="https://sola.gtimg.cn/aoi/sola/20210118201807_hzF9zYwEBj.png" style="width:10px;line-height: 56px"/>
<el-link type="primary" @click="thirdLogin('qq')"
>QQ登录(测试中)</el-link
>QQ登录(alpha)</el-link
>
</div>
</div>
......
......@@ -15,7 +15,7 @@
</template>
<script>
// import * as echarts from 'echarts/index'
import * as echarts from 'echarts/index'
export default {
name: 'EchartWeather',
data () {
......
......@@ -27,7 +27,7 @@
</template>
<script>
// import * as echarts from 'echarts'
import * as echarts from 'echarts'
export default {
name: 'Map',
......
......@@ -26,7 +26,8 @@ import {
Select,
Divider,
Row,
Col
Col,
Popover
} from 'element-ui'
const importElementComponents = (Vue) => {
......@@ -56,6 +57,7 @@ const importElementComponents = (Vue) => {
Vue.use(Pagination)
Vue.use(Alert)
Vue.use(Select)
Vue.use(Popover)
Vue.prototype.$message = Message
Vue.prototype.$notify = Notification
}
......
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
// vue cdn
// import Vue from 'vue'
// import axios from 'axios'
// import hljs from 'highlight.js'
// import importElementComponents from './importElement'
// import importEchartsComponents from './importEchartsComponents'
import Vue from 'vue'
import axios from 'axios'
import hljs from 'highlight.js'
import importElementComponents from './importElement'
import importEchartsComponents from './importEchartsComponents'
// 样式cnd
import 'github-markdown-css/github-markdown.css'
import 'nprogress/nprogress.css'
......@@ -38,7 +38,7 @@ Vue.prototype.$cookies.set('user_session', 'null')
// 路由
const router = useRouter(Vue, VueRouter)
// 生产环境
if (env === 'production') {
if (env === 'production'&& false) {
try {
// 全局引入
Vue.config.productionTip = false
......@@ -53,11 +53,11 @@ if (env === 'production') {
throw Error(e)
}
} else {
// // 按需引入elementui
// importElementComponents(Vue)
//
// // 按需引入echarts
// importEchartsComponents(Vue)
// 按需引入elementui
importElementComponents(Vue)
// 按需引入echarts
importEchartsComponents(Vue)
Vue.config.productionTip = false
new Vue({
......
// import Vue from 'vue'
// import Vuex from 'vuex'
import Vue from 'vue'
import Vuex from 'vuex'
// import createLogger from '../../../src/plugins/logger'
......
......@@ -5,8 +5,8 @@ export default {
state: {
// 用户账号密码
userInfo: {
name: '游客',
password: null
name: '',
password: ''
}
},
getters: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册