增加环境信息

Former-commit-id: 4dae4bb78d76f7f938f96cb7e8d70ae3e0f3ff9a [formerly 4dae4bb78d76f7f938f96cb7e8d70ae3e0f3ff9a [formerly 4dae4bb78d76f7f938f96cb7e8d70ae3e0f3ff9a [formerly 4dae4bb78d76f7f938f96cb7e8d70ae3e0f3ff9a [formerly 5e20e47a6957a82b94b57af913a9a45a58fa5281 [formerly 7b63f06f2da85d10f4df205ef81a25e2fa8a7933]]]]]
Former-commit-id: c9fce450c6afe4885d7105af2145fd597e2b7142
Former-commit-id: 837a71bd1de9152b2f22c7d2b310e6ab690cf563
Former-commit-id: e801081f67155ea604b9fbcfa8fb5f935d44189c [formerly d46bd2dfc6214d15783c2c9d1cf31e2ba8326ea7]
Former-commit-id: 43308d8ac292147918a94fcc23c20f992cf3f4f6
Former-commit-id: 5c2e21a21d6dbc1628f0aedd2366f6a96184c428
Former-commit-id: 8ac1d58beb3d54e8674e900cf0c9b15110eb8ed5
Former-commit-id: 9fee2dfe7f53f06b403f7a6a9a9d6585517d9518
Former-commit-id: d1971ac9f64902e97f4173008c87882e5a026496
This commit is contained in:
liyang
2018-12-14 11:16:10 +08:00
parent a2a2931af1
commit e563d9317a
8 changed files with 33 additions and 50 deletions

View File

@@ -3,8 +3,9 @@
<div class="d2-page-cover__logo">
<slot/>
</div>
<p class="d2-page-cover__title">{{title}}</p>
<p class="d2-page-cover__sub-title d2-mt-0">{{subTitle}}</p>
<p class="d2-page-cover__title">D2 Admin {{$version}}</p>
<p class="d2-page-cover__sub-title">优雅的中后台集成方案</p>
<p class="d2-page-cover__build-time">FINAL BUILD TIME {{$buildTime}}</p>
<slot name="footer"/>
<a target="blank" href="https://github.com/d2-projects/d2-admin">
<img
@@ -15,23 +16,6 @@
</div>
</template>
<script>
export default {
props: {
title: {
type: String,
required: false,
default: 'Title'
},
subTitle: {
type: String,
required: false,
default: 'subTitle'
}
}
}
</script>
<style lang="scss" scoped>
.d2-page-cover {
@extend %full;
@@ -46,10 +30,21 @@ export default {
}
}
.d2-page-cover__title {
margin: 0px;
margin-bottom: 20px;
font-weight: bold;
color: $color-text-main;
}
.d2-page-cover__sub-title {
color: $color-text-sub;
margin: 0px;
margin-bottom: 5px;
color: $color-text-normal;
}
.d2-page-cover__build-time {
margin: 0px;
margin-bottom: 10px;
font-size: 12px;
color: $color-text-placehoder;
}
}
</style>

View File

@@ -1,8 +1,7 @@
import low from 'lowdb'
import LocalStorage from 'lowdb/adapters/LocalStorage'
import setting from '@/setting.js'
const adapter = new LocalStorage(`d2admin-${setting.releases.version}`)
const adapter = new LocalStorage(`d2admin-${process.env.VUE_APP_VERSION}`)
const db = low(adapter)
db

View File

@@ -1,5 +1,4 @@
import Cookies from 'js-cookie'
import setting from '@/setting.js'
const cookies = {}
@@ -14,7 +13,7 @@ cookies.set = function (name = 'default', value = '', cookieSetting = {}) {
expires: 1
}
Object.assign(currentCookieSetting, cookieSetting)
Cookies.set(`d2admin-${setting.releases.version}-${name}`, value, currentCookieSetting)
Cookies.set(`d2admin-${process.env.VUE_APP_VERSION}-${name}`, value, currentCookieSetting)
}
/**
@@ -22,7 +21,7 @@ cookies.set = function (name = 'default', value = '', cookieSetting = {}) {
* @param {String} name cookie name
*/
cookies.get = function (name = 'default') {
return Cookies.get(`d2admin-${setting.releases.version}-${name}`)
return Cookies.get(`d2admin-${process.env.VUE_APP_VERSION}-${name}`)
}
/**
@@ -37,7 +36,7 @@ cookies.getAll = function () {
* @param {String} name cookie name
*/
cookies.remove = function (name = 'default') {
return Cookies.remove(`d2admin-${setting.releases.version}-${name}`)
return Cookies.remove(`d2admin-${process.env.VUE_APP_VERSION}-${name}`)
}
export default cookies

View File

@@ -1,8 +1,6 @@
<template>
<d2-container :filename="filename" class="page">
<d2-page-cover
:title="`D2 Admin ${version}`"
sub-title="优雅的中后台集成方案">
<d2-page-cover>
<d2-icon-svg
class="page__logo"
name="d2-admin"/>
@@ -35,7 +33,6 @@
</template>
<script>
import { mapState } from 'vuex'
import D2HelpBtn from './components/d2-help-btn'
import D2Badge from './components/d2-badge'
export default {
@@ -47,11 +44,6 @@ export default {
return {
filename: __filename
}
},
computed: {
...mapState('d2admin/releases', [
'version'
])
}
}
</script>
@@ -64,7 +56,7 @@ export default {
.page__btn-group {
color: $color-text-placehoder;
font-size: 12px;
margin-top: -10px;
margin-top: 0px;
margin-bottom: 20px;
span {
color: $color-text-sub;

View File

@@ -16,12 +16,17 @@ import pluginOpen from '@/plugin/open'
export default {
async install (Vue, options) {
// 设置为 false 以阻止 vue 在启动时生成生产提示。https://cn.vuejs.org/v2/api/#productionTip
// 设置为 false 以阻止 vue 在启动时生成生产提示
// https://cn.vuejs.org/v2/api/#productionTip
Vue.config.productionTip = false
// 当前环境
Vue.prototype.$env = process.env.NODE_ENV
// 当前的 baseUrl
Vue.prototype.$baseUrl = process.env.BASE_URL
// 当前版本
Vue.prototype.$version = process.env.VUE_APP_VERSION
// 构建时间
Vue.prototype.$buildTime = process.env.VUE_APP_BUILD_TIME
// Element
Vue.use(ElementUI)
// 插件

View File

@@ -1,5 +1,3 @@
import { version } from '../package'
export default {
// 快捷键
// 支持快捷键 例如 ctrl+shift+s
@@ -26,10 +24,6 @@ export default {
}
]
},
// 版本
releases: {
version
},
// 菜单搜索
search: {
enable: true

View File

@@ -1,19 +1,14 @@
import util from '@/libs/util.js'
import setting from '@/setting.js'
export default {
namespaced: true,
state: {
// D2Admin 版本
version: setting.releases.version
},
mutations: {
/**
* @description 显示版本信息
* @param {Object} state vuex state
*/
versionShow (state) {
util.log.capsule('D2Admin', `v${state.version}`)
versionShow () {
util.log.capsule('D2Admin', `v${process.env.VUE_APP_VERSION}`)
console.log('Github https://github.com/d2-projects/d2-admin')
console.log('Doc https://doc.d2admin.fairyever.com/zh/')
console.log('请不要吝啬您的 star谢谢 ~')