Merge pull request #16 from FairyEver/dev
bug fixed Former-commit-id: 1b0a473d94b7a6fa4c3613660bf03a2fed403913 [formerly 1b0a473d94b7a6fa4c3613660bf03a2fed403913 [formerly 1b0a473d94b7a6fa4c3613660bf03a2fed403913 [formerly 1b0a473d94b7a6fa4c3613660bf03a2fed403913 [formerly 95bb8cf256f28ef4f16b2b2c2d47fa76e58c8e23 [formerly d69e06f914ce9718bb47e10a1cc994faf7e19a87]]]]] Former-commit-id: 6bb1ab748cbbe2d78d569d9206dab2744faea187 Former-commit-id: 375f0cb9d3abe5a9b3485b7a685336dbc53bc8af Former-commit-id: cf37640afce7e2df5b0c5ef17b5692bb5f33926a [formerly f43b978d9a3fdd676f2134fcbd70da33246b29f1] Former-commit-id: 81524d3fb4c8916a8b8f4b4fe71d7b872f66eb52 Former-commit-id: 0f95979569e589165accef31a68226ab3433e8fd Former-commit-id: 8c2f2fe3dc55058da9cdae632d0aeb5bb89be5ea Former-commit-id: 6fffaa0cb3dd1c616e697df03939108b9b10f500 Former-commit-id: 8c85106d7bb6c82ab3dad583031d5e12964d7472
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* [ 修改 ] 内置组件名称统一改为 `d2-` 前缀,统一使用横线连接 (kebab-case) 风格
|
||||
* [ 修改 ] 顶栏 logo 阴影删除
|
||||
* [ 新增 ] 主题系统
|
||||
* [ 新增 ] 三个主题,分别为 `d2admin 经典`,`简约线条`,`流星`
|
||||
* [ 新增 ] 三个主题,分别为 d2admin 经典,简约线条,流星
|
||||
* [ 修改 ] `d2-markdown` 组件 `md` 参数改名为 `source`
|
||||
* [ 修改 ] 删除了 `d2-markdown` 组件中图片的白色背景
|
||||
* [ 修改 ] 删除 `timeago` 插件,更换为更强大的 `dayjs`
|
||||
@@ -23,6 +23,9 @@
|
||||
* [ 新增 ] [vue-bigdata-table](https://github.com/lison16/vue-bigdata-table)组件
|
||||
* [ 修复 ] 侧边栏内容超过一屏后显示错误
|
||||
* [ 新增 ] 自定义滚动条演示页面
|
||||
* [ 新增 ] 流星主题新增背景图片上层的半透明遮罩
|
||||
* [ 修复 ] 主题设置失效bug
|
||||
* [ 修复 ] router守卫验证登陆部分代码修改
|
||||
|
||||
## v1.0.0
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
import Cookies from 'js-cookie'
|
||||
|
||||
const meta = { requiresAuth: true }
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
const routes = [
|
||||
@@ -14,7 +16,7 @@ const routes = [
|
||||
{
|
||||
path: 'index',
|
||||
name: 'index',
|
||||
meta: { requiresAuth: true },
|
||||
meta,
|
||||
component: () => import('@/pages/core/index/index.vue')
|
||||
}
|
||||
]
|
||||
@@ -22,81 +24,81 @@ const routes = [
|
||||
{
|
||||
path: '/demo/components',
|
||||
name: 'demo-components',
|
||||
meta: { requiresAuth: true },
|
||||
meta,
|
||||
redirect: { name: 'demo-components-index' },
|
||||
component: () => import('@/components/core/d2-layout-main/index.vue'),
|
||||
children: (pre => [
|
||||
{ path: 'bigdata-table', name: `${pre}bigdata-table`, component: () => import('@/pages/demo/components/bigdata-table/index.vue') },
|
||||
{ path: 'container/full', name: `${pre}container-full`, component: () => import('@/pages/demo/components/container/full.vue') },
|
||||
{ path: 'container/ghost', name: `${pre}container-ghost`, component: () => import('@/pages/demo/components/container/ghost.vue') },
|
||||
{ path: 'container/card', name: `${pre}container-card`, component: () => import('@/pages/demo/components/container/card.vue') },
|
||||
{ path: 'countup', name: `${pre}countup`, component: () => import('@/pages/demo/components/countup/index.vue') },
|
||||
{ path: 'editor-quill', name: `${pre}editor-quill`, component: () => import('@/pages/demo/components/editor-quill/index.vue') },
|
||||
{ path: 'editor-simpleMDE', name: `${pre}editor-simpleMDE`, component: () => import('@/pages/demo/components/editor-simpleMDE/index.vue') },
|
||||
{ path: 'highlight', name: `${pre}highlight`, component: () => import('@/pages/demo/components/highlight/index.vue') },
|
||||
{ path: 'icon/icon', name: `${pre}icon-icon`, component: () => import('@/pages/demo/components/icon/icon.vue') },
|
||||
{ path: 'icon/list', name: `${pre}icon-list`, component: () => import('@/pages/demo/components/icon/list.vue') },
|
||||
{ path: 'icon/select', name: `${pre}icon-select`, component: () => import('@/pages/demo/components/icon/select.vue') },
|
||||
{ path: 'icon/svg', name: `${pre}icon-svg`, component: () => import('@/pages/demo/components/icon/svg.vue') },
|
||||
{ path: 'index', name: `${pre}index`, component: () => import('@/pages/demo/components/index/index.vue') },
|
||||
{ path: 'layout/grid', name: `${pre}layout-grid`, component: () => import('@/pages/demo/components/layout/grid.vue') },
|
||||
{ path: 'layout/splitpane', name: `${pre}layout-splitpane`, component: () => import('@/pages/demo/components/layout/splitpane.vue') },
|
||||
{ path: 'markdown/source', name: `${pre}markdown-source`, component: () => import('@/pages/demo/components/markdown/source.vue') },
|
||||
{ path: 'markdown/url', name: `${pre}markdown-url`, component: () => import('@/pages/demo/components/markdown/url.vue') },
|
||||
{ path: 'scrollbar', name: `${pre}scrollbar`, component: () => import('@/pages/demo/components/scrollbar/index.vue') }
|
||||
{ path: 'bigdata-table', name: `${pre}bigdata-table`, component: () => import('@/pages/demo/components/bigdata-table/index.vue'), meta },
|
||||
{ path: 'container/full', name: `${pre}container-full`, component: () => import('@/pages/demo/components/container/full.vue'), meta },
|
||||
{ path: 'container/ghost', name: `${pre}container-ghost`, component: () => import('@/pages/demo/components/container/ghost.vue'), meta },
|
||||
{ path: 'container/card', name: `${pre}container-card`, component: () => import('@/pages/demo/components/container/card.vue'), meta },
|
||||
{ path: 'countup', name: `${pre}countup`, component: () => import('@/pages/demo/components/countup/index.vue'), meta },
|
||||
{ path: 'editor-quill', name: `${pre}editor-quill`, component: () => import('@/pages/demo/components/editor-quill/index.vue'), meta },
|
||||
{ path: 'editor-simpleMDE', name: `${pre}editor-simpleMDE`, component: () => import('@/pages/demo/components/editor-simpleMDE/index.vue'), meta },
|
||||
{ path: 'highlight', name: `${pre}highlight`, component: () => import('@/pages/demo/components/highlight/index.vue'), meta },
|
||||
{ path: 'icon/icon', name: `${pre}icon-icon`, component: () => import('@/pages/demo/components/icon/icon.vue'), meta },
|
||||
{ path: 'icon/list', name: `${pre}icon-list`, component: () => import('@/pages/demo/components/icon/list.vue'), meta },
|
||||
{ path: 'icon/select', name: `${pre}icon-select`, component: () => import('@/pages/demo/components/icon/select.vue'), meta },
|
||||
{ path: 'icon/svg', name: `${pre}icon-svg`, component: () => import('@/pages/demo/components/icon/svg.vue'), meta },
|
||||
{ path: 'index', name: `${pre}index`, component: () => import('@/pages/demo/components/index/index.vue'), meta },
|
||||
{ path: 'layout/grid', name: `${pre}layout-grid`, component: () => import('@/pages/demo/components/layout/grid.vue'), meta },
|
||||
{ path: 'layout/splitpane', name: `${pre}layout-splitpane`, component: () => import('@/pages/demo/components/layout/splitpane.vue'), meta },
|
||||
{ path: 'markdown/source', name: `${pre}markdown-source`, component: () => import('@/pages/demo/components/markdown/source.vue'), meta },
|
||||
{ path: 'markdown/url', name: `${pre}markdown-url`, component: () => import('@/pages/demo/components/markdown/url.vue'), meta },
|
||||
{ path: 'scrollbar', name: `${pre}scrollbar`, component: () => import('@/pages/demo/components/scrollbar/index.vue'), meta }
|
||||
])('demo-components-')
|
||||
},
|
||||
{
|
||||
path: '/demo/plugins',
|
||||
name: 'demo-plugins',
|
||||
meta: { requiresAuth: true },
|
||||
meta,
|
||||
redirect: { name: 'demo-plugins-index' },
|
||||
component: () => import('@/components/core/d2-layout-main/index.vue'),
|
||||
children: (pre => [
|
||||
{ path: 'build', name: `${pre}build`, component: () => import('@/pages/demo/plugins/build/index.vue') },
|
||||
{ path: 'clipboard-polyfill', name: `${pre}clipboard-polyfill`, component: () => import('@/pages/demo/plugins/clipboard-polyfill/index.vue') },
|
||||
{ path: 'day', name: `${pre}day`, component: () => import('@/pages/demo/plugins/day/index.vue') },
|
||||
{ path: 'export/table', name: `${pre}export-table`, component: () => import('@/pages/demo/plugins/export/table.vue') },
|
||||
{ path: 'export/txt', name: `${pre}export-txt`, component: () => import('@/pages/demo/plugins/export/txt.vue') },
|
||||
{ path: 'i18n/demo1', name: `${pre}i18n-demo1`, component: () => import('@/pages/demo/plugins/i18n/demo1.vue') },
|
||||
{ path: 'i18n/demo2', name: `${pre}i18n-demo2`, component: () => import('@/pages/demo/plugins/i18n/demo2.vue') },
|
||||
{ path: 'import/csv', name: `${pre}import-csv`, component: () => import('@/pages/demo/plugins/import/csv.vue') },
|
||||
{ path: 'import/xlsx', name: `${pre}import-xlsx`, component: () => import('@/pages/demo/plugins/import/xlsx.vue') },
|
||||
{ path: 'index', name: `${pre}index`, component: () => import('@/pages/demo/plugins/index/index.vue') },
|
||||
{ path: 'js-cookie', name: `${pre}js-cookie`, component: () => import('@/pages/demo/plugins/js-cookie/index.vue') },
|
||||
{ path: 'mock/ajax', name: `${pre}mock-ajax`, component: () => import('@/pages/demo/plugins/mock/ajax.vue') },
|
||||
{ path: 'mock/dpd', name: `${pre}mock-dpd`, component: () => import('@/pages/demo/plugins/mock/dpd.vue') },
|
||||
{ path: 'mock/dtd', name: `${pre}mock-dtd`, component: () => import('@/pages/demo/plugins/mock/dtd.vue') }
|
||||
{ path: 'build', name: `${pre}build`, component: () => import('@/pages/demo/plugins/build/index.vue'), meta },
|
||||
{ path: 'clipboard-polyfill', name: `${pre}clipboard-polyfill`, component: () => import('@/pages/demo/plugins/clipboard-polyfill/index.vue'), meta },
|
||||
{ path: 'day', name: `${pre}day`, component: () => import('@/pages/demo/plugins/day/index.vue'), meta },
|
||||
{ path: 'export/table', name: `${pre}export-table`, component: () => import('@/pages/demo/plugins/export/table.vue'), meta },
|
||||
{ path: 'export/txt', name: `${pre}export-txt`, component: () => import('@/pages/demo/plugins/export/txt.vue'), meta },
|
||||
{ path: 'i18n/demo1', name: `${pre}i18n-demo1`, component: () => import('@/pages/demo/plugins/i18n/demo1.vue'), meta },
|
||||
{ path: 'i18n/demo2', name: `${pre}i18n-demo2`, component: () => import('@/pages/demo/plugins/i18n/demo2.vue'), meta },
|
||||
{ path: 'import/csv', name: `${pre}import-csv`, component: () => import('@/pages/demo/plugins/import/csv.vue'), meta },
|
||||
{ path: 'import/xlsx', name: `${pre}import-xlsx`, component: () => import('@/pages/demo/plugins/import/xlsx.vue'), meta },
|
||||
{ path: 'index', name: `${pre}index`, component: () => import('@/pages/demo/plugins/index/index.vue'), meta },
|
||||
{ path: 'js-cookie', name: `${pre}js-cookie`, component: () => import('@/pages/demo/plugins/js-cookie/index.vue'), meta },
|
||||
{ path: 'mock/ajax', name: `${pre}mock-ajax`, component: () => import('@/pages/demo/plugins/mock/ajax.vue'), meta },
|
||||
{ path: 'mock/dpd', name: `${pre}mock-dpd`, component: () => import('@/pages/demo/plugins/mock/dpd.vue'), meta },
|
||||
{ path: 'mock/dtd', name: `${pre}mock-dtd`, component: () => import('@/pages/demo/plugins/mock/dtd.vue'), meta }
|
||||
])('demo-plugins-')
|
||||
},
|
||||
{
|
||||
path: '/demo/chart',
|
||||
name: 'demo-chart',
|
||||
meta: { requiresAuth: true },
|
||||
meta,
|
||||
redirect: { name: 'demo-chart-index' },
|
||||
component: () => import('@/components/core/d2-layout-main/index.vue'),
|
||||
children: (pre => [
|
||||
{ path: 'all', name: `${pre}all`, component: () => import('@/pages/demo/chart/all/index.vue') },
|
||||
{ path: 'demo/areaBase', name: `${pre}demo-areaBase`, component: () => import('@/pages/demo/chart/demo/areaBase.vue') },
|
||||
{ path: 'demo/barBase', name: `${pre}demo-barBase`, component: () => import('@/pages/demo/chart/demo/barBase.vue') },
|
||||
{ path: 'demo/columnBase', name: `${pre}demo-columnBase`, component: () => import('@/pages/demo/chart/demo/columnBase.vue') },
|
||||
{ path: 'demo/lineBase', name: `${pre}demo-lineBase`, component: () => import('@/pages/demo/chart/demo/lineBase.vue') },
|
||||
{ path: 'demo/lineStep', name: `${pre}demo-lineStep`, component: () => import('@/pages/demo/chart/demo/lineStep.vue') },
|
||||
{ path: 'demo/nightingaleRoseBase', name: `${pre}demo-nightingaleRoseBase`, component: () => import('@/pages/demo/chart/demo/nightingaleRoseBase.vue') },
|
||||
{ path: 'demo/PieBase', name: `${pre}demo-PieBase`, component: () => import('@/pages/demo/chart/demo/PieBase.vue') },
|
||||
{ path: 'demo/radarBase', name: `${pre}demo-radarBase`, component: () => import('@/pages/demo/chart/demo/radarBase.vue') },
|
||||
{ path: 'dynamicSize', name: `${pre}dynamicSize`, component: () => import('@/pages/demo/chart/dynamicSize/index.vue') },
|
||||
{ path: 'index', name: `${pre}index`, component: () => import('@/pages/demo/chart/index/index.vue') }
|
||||
{ path: 'all', name: `${pre}all`, component: () => import('@/pages/demo/chart/all/index.vue'), meta },
|
||||
{ path: 'demo/areaBase', name: `${pre}demo-areaBase`, component: () => import('@/pages/demo/chart/demo/areaBase.vue'), meta },
|
||||
{ path: 'demo/barBase', name: `${pre}demo-barBase`, component: () => import('@/pages/demo/chart/demo/barBase.vue'), meta },
|
||||
{ path: 'demo/columnBase', name: `${pre}demo-columnBase`, component: () => import('@/pages/demo/chart/demo/columnBase.vue'), meta },
|
||||
{ path: 'demo/lineBase', name: `${pre}demo-lineBase`, component: () => import('@/pages/demo/chart/demo/lineBase.vue'), meta },
|
||||
{ path: 'demo/lineStep', name: `${pre}demo-lineStep`, component: () => import('@/pages/demo/chart/demo/lineStep.vue'), meta },
|
||||
{ path: 'demo/nightingaleRoseBase', name: `${pre}demo-nightingaleRoseBase`, component: () => import('@/pages/demo/chart/demo/nightingaleRoseBase.vue'), meta },
|
||||
{ path: 'demo/PieBase', name: `${pre}demo-PieBase`, component: () => import('@/pages/demo/chart/demo/PieBase.vue'), meta },
|
||||
{ path: 'demo/radarBase', name: `${pre}demo-radarBase`, component: () => import('@/pages/demo/chart/demo/radarBase.vue'), meta },
|
||||
{ path: 'dynamicSize', name: `${pre}dynamicSize`, component: () => import('@/pages/demo/chart/dynamicSize/index.vue'), meta },
|
||||
{ path: 'index', name: `${pre}index`, component: () => import('@/pages/demo/chart/index/index.vue'), meta }
|
||||
])('demo-chart-')
|
||||
},
|
||||
{
|
||||
path: '/demo/business',
|
||||
name: 'demo-business',
|
||||
meta: { requiresAuth: true },
|
||||
meta,
|
||||
redirect: { name: 'demo-business-index' },
|
||||
component: () => import('@/components/core/d2-layout-main/index.vue'),
|
||||
children: (pre => [
|
||||
{ path: 'index', name: `${pre}index`, component: () => import('@/pages/demo/business/index/index.vue') }
|
||||
{ path: 'index', name: `${pre}index`, component: () => import('@/pages/demo/business/index/index.vue'), meta }
|
||||
])('demo-business-')
|
||||
},
|
||||
// 登陆
|
||||
@@ -114,8 +116,8 @@ const routes = [
|
||||
let router = new VueRouter({ routes })
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
// 需要身份校验
|
||||
if (to.meta.requiresAuth) {
|
||||
// 验证当前路由所有的匹配中是否需要有登陆验证的
|
||||
if (to.matched.some(r => r.meta.requiresAuth)) {
|
||||
// 这里暂时将cookie里是否存有token作为验证是否登陆的条件
|
||||
// 请根据自身业务需要修改
|
||||
if (Cookies.get('token')) {
|
||||
|
||||
@@ -45,7 +45,9 @@ export default {
|
||||
// 设置 store
|
||||
state.name = name
|
||||
// 设置 Cookie
|
||||
Cookies.set('themeName', name)
|
||||
Cookies.set('themeName', name, {
|
||||
expires: 365
|
||||
})
|
||||
// 激活主题
|
||||
this.commit('activeTheme')
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user