|
@@ -23,7 +23,7 @@
|
|
|
</div>
|
|
|
</el-header>
|
|
|
<el-main>
|
|
|
- <router-view v-if="ok" v-on:status-change="changeStatus" v-on:redirect-page="redirectPage" :hasConcole="hasConcole"></router-view>
|
|
|
+ <router-view v-if="ok" v-on:status-change="changeStatus"></router-view>
|
|
|
</el-main>
|
|
|
</el-container>
|
|
|
</el-container>
|
|
@@ -51,7 +51,6 @@
|
|
|
authStatus: null,
|
|
|
authStatusName:'',
|
|
|
ok:false, //是否已获取到菜单
|
|
|
- hasConcole:true //是否有控制台权限,登录后跳转用
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -61,28 +60,45 @@
|
|
|
},
|
|
|
created () {
|
|
|
//获取菜单
|
|
|
- api.getAccessdMenu().then((res) => {
|
|
|
- if (res.data.code == '0') {
|
|
|
- const data = res.data.data;
|
|
|
- this.ok = true;
|
|
|
- const hasConcole=data.menuWrappers.findIndex((it)=>{
|
|
|
- return it.code == 'LT-KZT'
|
|
|
- });
|
|
|
- this.hasConcole = hasConcole!=-1;
|
|
|
- this.menuWrappers = data.menuWrappers;
|
|
|
- this.organization = data.organization;
|
|
|
- this.userLoginDTO = data.userLoginDTO;
|
|
|
- data.userLoginDTO && data.userLoginDTO.type == '0' && this.getAuthStatus();
|
|
|
+ this.getMenuList();
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ '$route': function(to,from){
|
|
|
+ if(from.name=='login'){
|
|
|
+ this.getMenuList();
|
|
|
+ }
|
|
|
+ if(to.path=='/'){ // 退出时清空菜单
|
|
|
+ this.menuWrappers=[];
|
|
|
+ }
|
|
|
}
|
|
|
- }).catch((error) => {
|
|
|
- console.log(error);
|
|
|
- });
|
|
|
},
|
|
|
methods: {
|
|
|
- redirectPage(){
|
|
|
+ getMenuList(){
|
|
|
+ api.getAccessdMenu().then((res) => {
|
|
|
+ if (res.data.code == '0') {
|
|
|
+ const data = res.data.data;
|
|
|
+ this.ok = true;
|
|
|
+ const hasConcole=data.menuWrappers.find((it)=>{
|
|
|
+ return it.code.indexOf('-KZT')>-1;
|
|
|
+ });
|
|
|
+ //this.hasConcole = hasConcole!=-1;
|
|
|
+ this.menuWrappers = data.menuWrappers;
|
|
|
+ this.organization = data.organization;
|
|
|
+ this.userLoginDTO = data.userLoginDTO;
|
|
|
+ this.getRole=='user' && this.getAuthStatus();
|
|
|
+ if(hasConcole){
|
|
|
+ const url = this.getRole=='user'?'/user/YH-KZT':'/admin/LT-KZT';
|
|
|
+ this.$router.push({path:url});
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch((error) => {
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /*redirectPage(){
|
|
|
const url = this.getRole=='user'?'/user':'/admin';
|
|
|
this.$router.push({path:url});
|
|
|
- },
|
|
|
+ },*/
|
|
|
changeStatus(text){ //账号信息中提交认证后修改状态
|
|
|
this.authStatus = 2;
|
|
|
this.authStatusName = text;
|