File tree Expand file tree Collapse file tree 8 files changed +46
-26
lines changed Expand file tree Collapse file tree 8 files changed +46
-26
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ vue+element+axios 的管理后台 [线上地址](http://panjiachen.github.io/vue
55###功能
66- [x] 登录/注销
77- [x] 权限验证
8+ - [x] 侧边栏
9+ - [x] 面包屑
810- [x] 富文本编辑器
911- [x] Markdown编辑器
1012- [x] JSON编辑器
@@ -20,6 +22,10 @@ vue+element+axios 的管理后台 [线上地址](http://panjiachen.github.io/vue
2022- [x] table example
2123- [x] form example
2224- [x] 多环境发布
25+ - [x] dashboard
26+ - [x] 二次登录
27+ - [x] 动态侧边栏
28+
2329
2430###How to use?
2531``` bash
Original file line number Diff line number Diff line change @@ -26,23 +26,30 @@ const userMap = {
2626export default {
2727 loginByEmail : config => {
2828 const { email } = config . params ;
29- return new Promise ( resolve => {
30- setTimeout ( ( ) => {
31- resolve ( [ 200 , {
32- data : userMap [ email . split ( '@' ) [ 0 ] ]
33- } ] ) ;
34- } , 500 ) ;
29+ return new Promise ( ( resolve , reject ) => {
30+ if ( userMap [ email . split ( '@' ) [ 0 ] ] ) {
31+ setTimeout ( ( ) => {
32+ resolve ( [ 200 , {
33+ data : userMap [ email . split ( '@' ) [ 0 ] ]
34+ } ] ) ;
35+ } , 500 ) ;
36+ } else {
37+ reject ( '账号不正确' )
38+ }
3539 } )
3640 } ,
3741 getInfo : config => {
3842 const { token } = config . params ;
39- console . log ( userMap [ token ] )
40- return new Promise ( resolve => {
41- setTimeout ( ( ) => {
42- resolve ( [ 200 , {
43- data : userMap [ token ]
44- } ] ) ;
45- } , 100 ) ;
43+ return new Promise ( ( resolve , reject ) => {
44+ if ( userMap [ token ] ) {
45+ setTimeout ( ( ) => {
46+ resolve ( [ 200 , {
47+ data : userMap [ token ]
48+ } ] ) ;
49+ } , 100 ) ;
50+ } else {
51+ reject ( '获取失败' )
52+ }
4653 } )
4754 } ,
4855 logout : ( ) => new Promise ( resolve => {
Original file line number Diff line number Diff line change @@ -114,6 +114,7 @@ const user = {
114114 return new Promise ( ( resolve , reject ) => {
115115 logout ( state . token ) . then ( ( ) => {
116116 commit ( 'SET_TOKEN' , '' ) ;
117+ commit ( 'SET_ROLES' , [ ] ) ;
117118 Cookies . remove ( 'X-Ivanka-Token' ) ;
118119 resolve ( ) ;
119120 } ) . catch ( error => {
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ export function fetch(options) {
6161 } )
6262 . catch ( error => {
6363 Message ( {
64- message : '发生异常错误,请刷新页面重试,或联系程序员' ,
64+ message : error ,
6565 type : 'error' ,
6666 duration : 5 * 1000
6767 } ) ;
Original file line number Diff line number Diff line change 66 </PanThumb >
77 <div class =" info-container" >
88 <span class =" display_name" >{{name}}</span >
9- <span style =' font-size :20px ;padding-top :20px ;display :inline-block ;' >赶紧把你们想要的快捷键报给产品锦鲤! </span >
9+ <span style =' font-size :20px ;padding-top :20px ;display :inline-block ;' >普通编辑dashboard </span >
1010 </div >
1111 </div >
1212 <div >
1313 <img class =' emptyGif' :src =" emptyGif" >
1414 </div >
15-
1615 </div >
1716</template >
1817
Original file line number Diff line number Diff line change 2727 </div >
2828
2929 <div class =" btn-group" >
30- <router-link class =" pan-btn blue-btn" to =" /components/index" >组价 </router-link >
30+ <router-link class =" pan-btn blue-btn" to =" /components/index" >组件 </router-link >
3131 <router-link class =" pan-btn light-blue-btn" to =" /charts/index" >图表</router-link >
3232 <router-link class =" pan-btn red-btn" to =" /errorpage/404" >错误页面</router-link >
33- <router-link class =" pan-btn pink-btn" to =" /errlog/log " >错误日志 </router-link >
34- <router-link class =" pan-btn green-btn" to =" /article/wscnlist " >导出excel </router-link >
35- <router-link class =" pan-btn tiffany-btn" to =" /excel/download " >实时列表 </router-link >
33+ <router-link class =" pan-btn pink-btn" to =" /excel/download " >导出excel </router-link >
34+ <router-link class =" pan-btn green-btn" to =" /example/table " >table </router-link >
35+ <router-link class =" pan-btn tiffany-btn" to =" /example/form1 " >form </router-link >
3636 </div >
3737
3838 <div class =" clearfix main-dashboard-container" >
Original file line number Diff line number Diff line change 2929 if (this .roles .indexOf (' admin' ) >= 0 ) {
3030 return ;
3131 }
32- const isEditor = this .roles .some (v => v .indexOf (' editor' ) >= 0 )
33- if (! isEditor) {
34- this .currentRole = ' DefaultDashboard' ;
35- }
32+ // const isEditor = this.roles.some(v => v.indexOf('editor') >= 0)
33+ // if (!isEditor) {
34+ // this.currentRole = 'DefaultDashboard';
35+ // }
36+ this .currentRole = ' DefaultDashboard' ;
3637 }
3738 }
3839 </script >
Original file line number Diff line number Diff line change 1919 登录
2020 </el-button >
2121 </el-form-item >
22+ <div class =' tips' >admin账号为:admin@wallstreetcn 密码随便填</div >
23+ <div class =' tips' >editor账号:editor@wallstreetcn 密码随便填</div >
2224 <router-link to =" /sendpwd" class =" forget-pwd" >
2325 忘记密码?(或首次登录)
2426 </router-link >
5658 };
5759 return {
5860 loginForm: {
59- email: ' ' ,
61+ 6062 password: ' '
6163 },
6264 loginRules: {
125127
126128<style rel="stylesheet/scss" lang="scss" scoprd>
127129 @import " src/styles/mixin.scss" ;
128-
130+ .tips {
131+ font-size : 14px ;
132+ color : #fff ;
133+ margin-bottom : 5px ;
134+ }
129135 .login-container {
130136 @include relative ;
131137 height : 100vh ;
You can’t perform that action at this time.
0 commit comments