Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
fy0 committed Sep 8, 2017
1 parent 018deff commit 457a5ea
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 11 deletions.
9 changes: 7 additions & 2 deletions page/src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<router-link tag="li" :to="{ name: 'tags' }" :class="navActiveClass('tag', 'tags')"><a>印记</a></router-link>
<router-link tag="li" :to="{ name: 'timeline' }" ><a>时光</a></router-link>
<router-link tag="li" :to="{ path: '/signin' }" ><a>用户</a></router-link>
<router-link v-if="state.data.user" tag="li" :to="{ path: '/new' }" :class="navActiveClass('topic_new', 'topic_edit')"><a>撰文</a></router-link>
<router-link v-if="state.data.user" tag="li" :to="{ path: '/manage' }" ><a>管理</a></router-link>
<router-link v-if="user && user.level >= 80" tag="li" :to="{ path: '/new' }" :class="navActiveClass('topic_new', 'topic_edit')"><a>撰文</a></router-link>
<router-link v-if="user && user.level >= 100" tag="li" :to="{ path: '/manage' }" ><a>管理</a></router-link>
<router-link tag="li" :to="{ path: '/about' }" ><a>关于</a></router-link>
</ul>
</div>
Expand Down Expand Up @@ -84,6 +84,11 @@ export default {
config,
}
},
computed: {
user: function () {
return this.state.data.user;
}
},
methods: {
navActiveClass: function (...names) {
for (let name of names) {
Expand Down
10 changes: 9 additions & 1 deletion page/src/components/manage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</style>

<script>
import state from "../state.js"
import UserManage from "./manage/user.vue"
import TopicManage from "./manage/topic.vue"
Expand All @@ -35,7 +36,14 @@ export default {
handleClick (tab, event) {
;
}
}
},
beforeRouteEnter: async (to, from, next) => {
if (state.data.user.level < 100) {
$.message_error(`无权限`);
return next('/');
}
next();
},
}
</script>

Expand Down
2 changes: 1 addition & 1 deletion page/src/components/topic_new.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import api from "../netapi.js"
import state from "../state.js"
import SimpleMDE from "simplemde"
//const SimpleMDE = () => import('simplemde')
import 'simplemde/dist/simplemde.min.css'
import Prism from "prismjs"
export default {
Expand Down
2 changes: 1 addition & 1 deletion page/src/components/utils/msgbox.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<transition-group class="tipbox" tag="div" enter-active-class="animated fadeInLeft"
leave-active-class="animated fadeOutLeft">
<div class="am-alert item" :class="item.class" :key="item" v-for="item in state.data.msgs">
<div class="am-alert item" :class="item.class" :key="item.text" v-for="item in state.data.msgs">
<a>{{item.text}}</a><br />
</div>
</transition-group>
Expand Down
2 changes: 1 addition & 1 deletion page/src/components/utils/paginator.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<ul class="ic-pages" v-if="pageInfo && pageInfo.last_page != pageInfo.first_page">
<ul class="ic-pages" v-if="pageInfo && pageInfo.page_count > 1">
<li v-if="pageInfo.first_page">
<router-link :to="toInfo(pageInfo.first_page)" class="slim">«</router-link>
</li>
Expand Down
6 changes: 2 additions & 4 deletions page/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import nprogress from 'nprogress/nprogress.js'
import 'lodash'
import 'purecss'
import 'animate.css'
import 'font-awesome/css/font-awesome.css'
import 'simplemde/dist/simplemde.min.css'
import 'nprogress/nprogress.css'
import 'font-awesome/css/font-awesome.css'

import './assets/css/base.css'
import tools from './tools.js'
Expand All @@ -19,8 +18,7 @@ import App from './app.vue'
import Index from './components/index.vue'
import Timeline from './components/timeline.vue'
import TopicPage from './components/topic.vue'
// const TopicNew = () => import('./components/topic_new.vue')
import TopicNew from './components/topic_new.vue'
const TopicNew = () => import('./components/topic_new.vue')
import Tags from './components/tags.vue'
import TagPage from './components/tag.vue'
import SignIn from './components/user/signin.vue'
Expand Down
1 change: 1 addition & 0 deletions page/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var path = require('path')
var webpack = require('webpack')
var HtmlWebpackPlugin = require('html-webpack-plugin')
// 备注一下,警告来自 core-js(应该是cash带来的)

module.exports = {
entry: './src/main.js',
Expand Down
5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@

* 向新版 webpack 迁移

* 修正了低权限用户左侧边栏上仍有撰文和管理导航的问题

* 优化:编辑器按需加载,体积减小1/3


### ver 1.0.1 update 2017.09.07

Expand All @@ -30,6 +34,7 @@

* 破坏性改动:无


### ver 1.0.0 update 2017.09.06

* 初版
2 changes: 1 addition & 1 deletion todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* 标签管理
* 文章编辑大量细节,例如自动保存提示(精确到秒),加载自动保存时也给与提示等
* 管理页面真正换页
* fpage app.py 全端口开放问题
* ~~fpage app.py 全端口开放问题~~
* 非注册评论
* 引用文章功能
* 百度统计

0 comments on commit 457a5ea

Please sign in to comment.