no message

Former-commit-id: 8875eda5374e7b3c28ace4a86298367611e34413 [formerly 48f7a1f44e9064bd34184017bea4267fad874753] [formerly 8875eda5374e7b3c28ace4a86298367611e34413 [formerly 48f7a1f44e9064bd34184017bea4267fad874753] [formerly 8875eda5374e7b3c28ace4a86298367611e34413 [formerly 48f7a1f44e9064bd34184017bea4267fad874753] [formerly 48f7a1f44e9064bd34184017bea4267fad874753 [formerly 6fcd5f0b6ae9cea49ec04173ccb90897abc23ffe [formerly 24f77ec2b60ff4ac3ae47e91aa49f7677b661a09]]]]]
Former-commit-id: b3dd073014052677834363034eccf3eb0344983a
Former-commit-id: ce0a7cf1053f2b4017a059cf4b93f0da9053d760
Former-commit-id: 24ced890882910d15d528f7fa40dc818b962b00a [formerly bd0692e26ad2820be577fa523e562c05de53c1ba]
Former-commit-id: 4952dc574ff9f704e58d0b94f7476a8a6e78ad7f
Former-commit-id: 86da3b969dd2f6dc82cba05da5c1bb033df24dec
Former-commit-id: 1372d798ba96c6aee0b2135c0909670c542dada9
Former-commit-id: 0f0980fe60ee071cecf80b6fa007980913ba9545
Former-commit-id: 003076fbf8df8cd2f7d86d69ea270ab0f8c30304
This commit is contained in:
liyang
2018-07-02 14:49:59 +08:00
parent b4c4b38fd8
commit 02bd54730d
5 changed files with 98 additions and 2 deletions

View File

@@ -1 +1 @@
2d3e492f0292e6cd7fcf39d98a7e99b72e7e82a9
8c23b4baa3bcba23bf62a363520ab0cbabbd2a3b

View File

@@ -0,0 +1,71 @@
<template>
<d2-container type="full" class="page">
<template slot="header">D2Admin 版本检查</template>
<div class="banner">
<img :src="`${$assetsPublicPath}static/image/icon/500/d2admin.png`">
</div>
<div v-if="update" class="releases">
<h1>有新版本 {{releases.tag_name}}</h1>
<p>更新日期 {{dayjs(releases.created_at).format('YYYY年M月D日')}}</p>
<a :href="releases.html_url" class="el-button el-button--primary d2-mb">{{releases.html_url}}</a>
<d2-markdown key="update" :source="releases.body"/>
</div>
<div v-else class="up2date">
<d2-markdown key="noupdate" :source="up2date"/>
</div>
<template slot="footer">
<el-button type="primary" size="mini" @click="d2adminUpdateNotifySet(!updateNotify)">
{{updateNotify ? '关闭更新提醒' : '打开更新提醒'}}
</el-button>
</template>
</d2-container>
</template>
<script>
import up2date from './md/up-to-date.md'
import dayjs from 'dayjs'
import { mapState, mapMutations } from 'vuex'
export default {
data () {
return {
dayjs,
up2date
}
},
computed: {
...mapState({
version: state => state.d2admin.version,
releases: state => state.d2admin.releases,
update: state => state.d2admin.update,
updateNotify: state => state.d2admin.updateNotify
})
},
methods: {
...mapMutations([
'd2adminUpdateNotifySet'
])
}
}
</script>
<style lang="scss" scoped>
@import '~@/assets/style/public.scss';
.page {
.banner {
text-align: center;
img {
width: 250px;
}
}
.releases {
padding: 20px;
border-radius: 4px;
background-color: $color-bg;
}
.up2date {
padding: 20px;
border-radius: 4px;
background-color: $color-bg;
}
}
</style>

View File

@@ -0,0 +1,9 @@
已经是最新版本
[Github仓库](https://github.com/FairyEver/d2-admin)
[码云仓库](https://gitee.com/fairyever/d2-admin)
[中文文档](https://fairyever.gitee.io/d2-admin-doc/zh/)
[预览地址](https://fairyever.gitee.io/d2-admin-preview)

View File

@@ -1 +1 @@
0e1a920511ec4883219ee769e78996943f2925ea
cee29f1fa988c380dbe32f3090e012852aa1f703

View File

@@ -2,12 +2,19 @@ import util from '@/libs/util.js'
import db from '@/libs/db.js'
import themeList from '@/assets/style/theme/list.js'
// 获取项目信息
import packJson from '../../../package.json'
export default {
state: {
// 拉取的最新版本信息
releases: {},
// D2Admin 版本
version: packJson.version,
// 有更新
update: false,
// 更新提醒弹窗
updateNotify: true,
// 全屏
isFullScreen: false,
// 灰度
@@ -74,6 +81,15 @@ export default {
d2adminUpdateSet (state, update) {
state.update = update
},
/**
* @description 设置是否有更新的时候显示弹窗
* @class updateNotify
* @param {state} state vuex state
* @param {boolean} update updateNotify value
*/
d2adminUpdateNotifySet (state, updateNotify) {
state.updateNotify = updateNotify
},
/**
* @class pageCurrent
* @description 设置当前激活的页面 name