refine
This commit is contained in:
parent
b3e1b6c824
commit
3fe2a376dd
|
@ -5,6 +5,8 @@ vue+element+axios 的管理后台 [线上地址](http://panjiachen.github.io/vue
|
|||
###功能
|
||||
- [x] 登录/注销
|
||||
- [x] 权限验证
|
||||
- [x] 侧边栏
|
||||
- [x] 面包屑
|
||||
- [x] 富文本编辑器
|
||||
- [x] Markdown编辑器
|
||||
- [x] JSON编辑器
|
||||
|
@ -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
|
||||
|
|
|
@ -26,23 +26,30 @@ const userMap = {
|
|||
export default {
|
||||
loginByEmail: config => {
|
||||
const { email } = config.params;
|
||||
return new Promise(resolve => {
|
||||
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 => {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (userMap[token]) {
|
||||
setTimeout(() => {
|
||||
resolve([200, {
|
||||
data: userMap[token]
|
||||
}]);
|
||||
}, 100);
|
||||
} else {
|
||||
reject('获取失败')
|
||||
}
|
||||
})
|
||||
},
|
||||
logout: () => new Promise(resolve => {
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -61,7 +61,7 @@ export function fetch(options) {
|
|||
})
|
||||
.catch(error => {
|
||||
Message({
|
||||
message: '发生异常错误,请刷新页面重试,或联系程序员',
|
||||
message: error,
|
||||
type: 'error',
|
||||
duration: 5 * 1000
|
||||
});
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -29,10 +29,11 @@
|
|||
if (this.roles.indexOf('admin') >= 0) {
|
||||
return;
|
||||
}
|
||||
const isEditor = this.roles.some(v => v.indexOf('editor') >= 0)
|
||||
if (!isEditor) {
|
||||
// const isEditor = this.roles.some(v => v.indexOf('editor') >= 0)
|
||||
// if (!isEditor) {
|
||||
// this.currentRole = 'DefaultDashboard';
|
||||
// }
|
||||
this.currentRole = 'DefaultDashboard';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -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>
|
||||
|
@ -56,7 +58,7 @@
|
|||
};
|
||||
return {
|
||||
loginForm: {
|
||||
email: '',
|
||||
email: 'admin@wallstreetcn.com',
|
||||
password: ''
|
||||
},
|
||||
loginRules: {
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue