Commit ad552bac by 潘建波

提交login

1 parent 64cfe7f1
...@@ -50,15 +50,12 @@ import types from '../store/types.js' ...@@ -50,15 +50,12 @@ import types from '../store/types.js'
"user_type": "user" "user_type": "user"
}).then(res => { }).then(res => {
if(!res.ecode){ 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('rtoken',m.data.rtoken)
// localStorage.setItem('user_unid',m.data.role_unid) sessionStorage.setItem('user_unid',res.user_unid)
// localStorage.setItem('uid',m.data.unid)
localStorage.setItem('menu', JSON.stringify(res.menu_list))
//本系统可以直接用本地缓存做 //本系统可以直接用本地缓存做
this.$store.dispatch('GetMenuRole',res.menu_list).then(res => {
this.$router.push('/') this.getMenu(res.user_unid)
}) //获
// localStorage.setItem('user_name',this.username) // localStorage.setItem('user_name',this.username)
// 处理登录用户权限菜单显示问题; // 处理登录用户权限菜单显示问题;
//算法配置列表 //算法配置列表
...@@ -67,7 +64,9 @@ import types from '../store/types.js' ...@@ -67,7 +64,9 @@ import types from '../store/types.js'
this.storeConfList(); this.storeConfList();
//code列表 //code列表
this.getCodeList(); this.getCodeList();
this.getCustomCode();
this.getEventList(); this.getEventList();
this.getDev();
} }
}).catch((err) => { }).catch((err) => {
...@@ -123,6 +122,22 @@ import types from '../store/types.js' ...@@ -123,6 +122,22 @@ import types from '../store/types.js'
}).catch((err) => { }).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(){ getEventList(){
this.$api.search.eventTypes({}).then(res=>{ this.$api.search.eventTypes({}).then(res=>{
// 存储code列表 // 存储code列表
...@@ -133,6 +148,11 @@ import types from '../store/types.js' ...@@ -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: {}, watch: {},
mounted() { mounted() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!