Commit ad552bac by 潘建波

提交login

1 parent 64cfe7f1
......@@ -50,15 +50,12 @@ import types from '../store/types.js'
"user_type": "user"
}).then(res => {
if(!res.ecode){
this.$store.commit(types.ATOKEN,res.token);
this.$store.commit(types.ATOKEN,res.atoken);
// localStorage.setItem('rtoken',m.data.rtoken)
// localStorage.setItem('user_unid',m.data.role_unid)
// localStorage.setItem('uid',m.data.unid)
localStorage.setItem('menu', JSON.stringify(res.menu_list))
sessionStorage.setItem('user_unid',res.user_unid)
//本系统可以直接用本地缓存做
this.$store.dispatch('GetMenuRole',res.menu_list).then(res => {
this.$router.push('/')
}) //获
this.getMenu(res.user_unid)
// localStorage.setItem('user_name',this.username)
// 处理登录用户权限菜单显示问题;
//算法配置列表
......@@ -67,7 +64,9 @@ import types from '../store/types.js'
this.storeConfList();
//code列表
this.getCodeList();
this.getCustomCode();
this.getEventList();
this.getDev();
}
}).catch((err) => {
......@@ -123,6 +122,22 @@ import types from '../store/types.js'
}).catch((err) => {
})
},
getCustomCode(){
this.$api.login.customCode().then(res => {
if(res.list_data.length > 0) {
res.list_data.forEach((item) => {
window.localStorage.setItem(item.name + '-' + item.cate, item.unid);
})
} else {
this.$message({
type: 'warning',
message: '获取自定义编码失败!'
})
}
}).catch((err) => {
})
},
getEventList(){
this.$api.search.eventTypes({}).then(res=>{
// 存储code列表
......@@ -133,6 +148,11 @@ import types from '../store/types.js'
})
})
},
getDev() {
this.$api.resource.devs().then(res => {
sessionStorage.setItem('dev_unid',res[0].dev_unid)
})
},
},
watch: {},
mounted() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!