Merge branch 'hotfix/env_more' into develop
Former-commit-id: ed72e8707a8196c2fca54af3f243e50fc563cc20 [formerly ed72e8707a8196c2fca54af3f243e50fc563cc20 [formerly ed72e8707a8196c2fca54af3f243e50fc563cc20 [formerly ed72e8707a8196c2fca54af3f243e50fc563cc20 [formerly 5a8e9a01a65623c58efb2022021133720be82239 [formerly 32f22b3897792fd904ef53d18e36c06f7b768a78]]]]] Former-commit-id: 350ed0d6af2253fa61e3d0c330ae8c54a0c707db Former-commit-id: 8c18f86703e9e36962d0591a17120807afd60d66 Former-commit-id: 27c300f88a68cc4d9e3e84ba2f4e8d21aba23a0a [formerly 147593ba14aebdb85db9ecd634b27ad184c5b82b] Former-commit-id: c77c88b9ffa862ee95d4874d061bf5e545de892f Former-commit-id: 050c3ab00973fcddbcda76d35178706d91772cd5 Former-commit-id: 514b523fbfe8acd877a08cda1f3cc43e9788ed10 Former-commit-id: 8185f87961099032f99e0f78d68a93b17c2c7535 Former-commit-id: 00e1280b56dd1ee74f639170b31d1158b8467c37
This commit is contained in:
@@ -3,8 +3,9 @@
|
|||||||
<div class="d2-page-cover__logo">
|
<div class="d2-page-cover__logo">
|
||||||
<slot/>
|
<slot/>
|
||||||
</div>
|
</div>
|
||||||
<p class="d2-page-cover__title">{{title}}</p>
|
<p class="d2-page-cover__title">D2 Admin {{$version}}</p>
|
||||||
<p class="d2-page-cover__sub-title d2-mt-0">{{subTitle}}</p>
|
<p class="d2-page-cover__sub-title">优雅的中后台集成方案</p>
|
||||||
|
<p class="d2-page-cover__build-time">FINAL BUILD TIME {{$buildTime}}</p>
|
||||||
<slot name="footer"/>
|
<slot name="footer"/>
|
||||||
<a target="blank" href="https://github.com/d2-projects/d2-admin">
|
<a target="blank" href="https://github.com/d2-projects/d2-admin">
|
||||||
<img
|
<img
|
||||||
@@ -15,23 +16,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
props: {
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
required: false,
|
|
||||||
default: 'Title'
|
|
||||||
},
|
|
||||||
subTitle: {
|
|
||||||
type: String,
|
|
||||||
required: false,
|
|
||||||
default: 'subTitle'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.d2-page-cover {
|
.d2-page-cover {
|
||||||
@extend %full;
|
@extend %full;
|
||||||
@@ -46,10 +30,21 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.d2-page-cover__title {
|
.d2-page-cover__title {
|
||||||
|
margin: 0px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
font-weight: bold;
|
||||||
color: $color-text-main;
|
color: $color-text-main;
|
||||||
}
|
}
|
||||||
.d2-page-cover__sub-title {
|
.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>
|
</style>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import low from 'lowdb'
|
import low from 'lowdb'
|
||||||
import LocalStorage from 'lowdb/adapters/LocalStorage'
|
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)
|
const db = low(adapter)
|
||||||
|
|
||||||
db
|
db
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import Cookies from 'js-cookie'
|
import Cookies from 'js-cookie'
|
||||||
import setting from '@/setting.js'
|
|
||||||
|
|
||||||
const cookies = {}
|
const cookies = {}
|
||||||
|
|
||||||
@@ -14,7 +13,7 @@ cookies.set = function (name = 'default', value = '', cookieSetting = {}) {
|
|||||||
expires: 1
|
expires: 1
|
||||||
}
|
}
|
||||||
Object.assign(currentCookieSetting, cookieSetting)
|
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
|
* @param {String} name cookie name
|
||||||
*/
|
*/
|
||||||
cookies.get = function (name = 'default') {
|
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
|
* @param {String} name cookie name
|
||||||
*/
|
*/
|
||||||
cookies.remove = function (name = 'default') {
|
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
|
export default cookies
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<d2-container :filename="filename" class="page">
|
<d2-container :filename="filename" class="page">
|
||||||
<d2-page-cover
|
<d2-page-cover>
|
||||||
:title="`D2 Admin ${version}`"
|
|
||||||
sub-title="优雅的中后台集成方案">
|
|
||||||
<d2-icon-svg
|
<d2-icon-svg
|
||||||
class="page__logo"
|
class="page__logo"
|
||||||
name="d2-admin"/>
|
name="d2-admin"/>
|
||||||
@@ -35,7 +33,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState } from 'vuex'
|
|
||||||
import D2HelpBtn from './components/d2-help-btn'
|
import D2HelpBtn from './components/d2-help-btn'
|
||||||
import D2Badge from './components/d2-badge'
|
import D2Badge from './components/d2-badge'
|
||||||
export default {
|
export default {
|
||||||
@@ -47,11 +44,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
filename: __filename
|
filename: __filename
|
||||||
}
|
}
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
...mapState('d2admin/releases', [
|
|
||||||
'version'
|
|
||||||
])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -64,7 +56,7 @@ export default {
|
|||||||
.page__btn-group {
|
.page__btn-group {
|
||||||
color: $color-text-placehoder;
|
color: $color-text-placehoder;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
margin-top: -10px;
|
margin-top: 0px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
span {
|
span {
|
||||||
color: $color-text-sub;
|
color: $color-text-sub;
|
||||||
|
|||||||
@@ -16,12 +16,17 @@ import pluginOpen from '@/plugin/open'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
async install (Vue, options) {
|
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.config.productionTip = false
|
||||||
// 当前环境
|
// 当前环境
|
||||||
Vue.prototype.$env = process.env.NODE_ENV
|
Vue.prototype.$env = process.env.NODE_ENV
|
||||||
// 当前的 baseUrl
|
// 当前的 baseUrl
|
||||||
Vue.prototype.$baseUrl = process.env.BASE_URL
|
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
|
// Element
|
||||||
Vue.use(ElementUI)
|
Vue.use(ElementUI)
|
||||||
// 插件
|
// 插件
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { version } from '../package'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
// 快捷键
|
// 快捷键
|
||||||
// 支持快捷键 例如 ctrl+shift+s
|
// 支持快捷键 例如 ctrl+shift+s
|
||||||
@@ -26,10 +24,6 @@ export default {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
// 版本
|
|
||||||
releases: {
|
|
||||||
version
|
|
||||||
},
|
|
||||||
// 菜单搜索
|
// 菜单搜索
|
||||||
search: {
|
search: {
|
||||||
enable: true
|
enable: true
|
||||||
|
|||||||
@@ -1,19 +1,14 @@
|
|||||||
import util from '@/libs/util.js'
|
import util from '@/libs/util.js'
|
||||||
import setting from '@/setting.js'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
namespaced: true,
|
namespaced: true,
|
||||||
state: {
|
|
||||||
// D2Admin 版本
|
|
||||||
version: setting.releases.version
|
|
||||||
},
|
|
||||||
mutations: {
|
mutations: {
|
||||||
/**
|
/**
|
||||||
* @description 显示版本信息
|
* @description 显示版本信息
|
||||||
* @param {Object} state vuex state
|
* @param {Object} state vuex state
|
||||||
*/
|
*/
|
||||||
versionShow (state) {
|
versionShow () {
|
||||||
util.log.capsule('D2Admin', `v${state.version}`)
|
util.log.capsule('D2Admin', `v${process.env.VUE_APP_VERSION}`)
|
||||||
console.log('Github https://github.com/d2-projects/d2-admin')
|
console.log('Github https://github.com/d2-projects/d2-admin')
|
||||||
console.log('Doc https://doc.d2admin.fairyever.com/zh/')
|
console.log('Doc https://doc.d2admin.fairyever.com/zh/')
|
||||||
console.log('请不要吝啬您的 star,谢谢 ~')
|
console.log('请不要吝啬您的 star,谢谢 ~')
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
|
|||||||
// 拼接路径
|
// 拼接路径
|
||||||
const resolve = dir => require('path').join(__dirname, dir)
|
const resolve = dir => require('path').join(__dirname, dir)
|
||||||
|
|
||||||
|
// 增加环境变量
|
||||||
|
process.env.VUE_APP_VERSION = require('./package.json').version
|
||||||
|
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYY-M-D HH:mm:ss')
|
||||||
|
|
||||||
// 基础路径 注意发布之前要先修改这里
|
// 基础路径 注意发布之前要先修改这里
|
||||||
let baseUrl = '/'
|
let baseUrl = '/'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user