Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refine
  • Loading branch information
PanJiaChen committed Apr 24, 2017
commit 3fe2a376dd2240a6578013238fa0285a4c09f95d
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ vue+element+axios 的管理后台 [线上地址](http://panjiachen.github.io/vue
###功能
- [x] 登录/注销
- [x] 权限验证
- [x] 侧边栏
- [x] 面包屑
- [x] 富文本编辑器
- [x] Markdown编辑器
- [x] JSON编辑器
Expand All @@ -20,6 +22,10 @@ vue+element+axios 的管理后台 [线上地址](http://panjiachen.github.io/vue
- [x] table example
- [x] form example
- [x] 多环境发布
- [x] dashboard
- [x] 二次登录
- [x] 动态侧边栏


###How to use?
```bash
Expand Down
33 changes: 20 additions & 13 deletions src/mock/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,30 @@ const userMap = {
export default {
loginByEmail: config => {
const { email } = config.params;
return new Promise(resolve => {
setTimeout(() => {
resolve([200, {
data: userMap[email.split('@')[0]]
}]);
}, 500);
return new Promise((resolve, reject) => {
if (userMap[email.split('@')[0]]) {
setTimeout(() => {
resolve([200, {
data: userMap[email.split('@')[0]]
}]);
}, 500);
} else {
reject('账号不正确')
}
})
},
getInfo: config => {
const { token } = config.params;
console.log(userMap[token])
return new Promise(resolve => {
setTimeout(() => {
resolve([200, {
data: userMap[token]
}]);
}, 100);
return new Promise((resolve, reject) => {
if (userMap[token]) {
setTimeout(() => {
resolve([200, {
data: userMap[token]
}]);
}, 100);
} else {
reject('获取失败')
}
})
},
logout: () => new Promise(resolve => {
Expand Down
1 change: 1 addition & 0 deletions src/store/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ const user = {
return new Promise((resolve, reject) => {
logout(state.token).then(() => {
commit('SET_TOKEN', '');
commit('SET_ROLES', []);
Cookies.remove('X-Ivanka-Token');
resolve();
}).catch(error => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function fetch(options) {
})
.catch(error => {
Message({
message: '发生异常错误,请刷新页面重试,或联系程序员',
message: error,
type: 'error',
duration: 5 * 1000
});
Expand Down
3 changes: 1 addition & 2 deletions src/views/dashboard/default/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
</PanThumb>
<div class="info-container">
<span class="display_name">{{name}}</span>
<span style='font-size:20px;padding-top:20px;display:inline-block;'>赶紧把你们想要的快捷键报给产品锦鲤!</span>
<span style='font-size:20px;padding-top:20px;display:inline-block;'>普通编辑dashboard</span>
</div>
</div>
<div>
<img class='emptyGif' :src="emptyGif" >
</div>

</div>
</template>

Expand Down
8 changes: 4 additions & 4 deletions src/views/dashboard/editor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
</div>

<div class="btn-group">
<router-link class="pan-btn blue-btn" to="/components/index">组价</router-link>
<router-link class="pan-btn blue-btn" to="/components/index">组件</router-link>
<router-link class="pan-btn light-blue-btn" to="/charts/index">图表</router-link>
<router-link class="pan-btn red-btn" to="/errorpage/404">错误页面</router-link>
<router-link class="pan-btn pink-btn" to="/errlog/log">错误日志</router-link>
<router-link class="pan-btn green-btn" to="/article/wscnlist">导出excel</router-link>
<router-link class="pan-btn tiffany-btn" to="/excel/download">实时列表</router-link>
<router-link class="pan-btn pink-btn" to="/excel/download">导出excel</router-link>
<router-link class="pan-btn green-btn" to="/example/table">table</router-link>
<router-link class="pan-btn tiffany-btn" to="/example/form1">form</router-link>
</div>

<div class="clearfix main-dashboard-container">
Expand Down
9 changes: 5 additions & 4 deletions src/views/dashboard/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
if (this.roles.indexOf('admin') >= 0) {
return;
}
const isEditor = this.roles.some(v => v.indexOf('editor') >= 0)
if (!isEditor) {
this.currentRole = 'DefaultDashboard';
}
// const isEditor = this.roles.some(v => v.indexOf('editor') >= 0)
// if (!isEditor) {
// this.currentRole = 'DefaultDashboard';
// }
this.currentRole = 'DefaultDashboard';
}
}
</script>
10 changes: 8 additions & 2 deletions src/views/login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
登录
</el-button>
</el-form-item>
<div class='tips'>admin账号为:admin@wallstreetcn 密码随便填</div>
<div class='tips'>editor账号:editor@wallstreetcn 密码随便填</div>
<router-link to="/sendpwd" class="forget-pwd">
忘记密码?(或首次登录)
</router-link>
Expand Down Expand Up @@ -56,7 +58,7 @@
};
return {
loginForm: {
email: '',
email: '[email protected]',
password: ''
},
loginRules: {
Expand Down Expand Up @@ -125,7 +127,11 @@

<style rel="stylesheet/scss" lang="scss" scoprd>
@import "src/styles/mixin.scss";

.tips{
font-size: 14px;
color: #fff;
margin-bottom: 5px;
}
.login-container {
@include relative;
height: 100vh;
Expand Down