限制只有教师角色才显示做市商角色切换下拉框

master
Qian 4 years ago
parent f1bc15c42d
commit 4ea9391e3d
  1. 8
      src/components/common/header.vue
  2. 5
      src/pages/yyyflogin.vue

@ -184,7 +184,10 @@
</el-dropdown> </el-dropdown>
</li> </li>
<!-- 角色切换--> <!-- 角色切换-->
<li class="menu-item" v-if="userData != '' && userData != undefined"> <li
class="menu-item"
v-if="userData != '' && userData != undefined && isTeacher == true"
>
<el-dropdown <el-dropdown
@command="switchRole" @command="switchRole"
trigger="click" trigger="click"
@ -337,6 +340,8 @@ export default {
mins: 0, mins: 0,
sec: 0, sec: 0,
setIntervalInt: 0, setIntervalInt: 0,
//
isTeacher: false,
}; };
}, },
@ -364,6 +369,7 @@ export default {
}, },
}); });
} else { } else {
this.isTeacher = localStorage.getItem('userType') == 1 ? true : false;
// //
this.reqType = localStorage.getItem('reqType'); this.reqType = localStorage.getItem('reqType');
// //

@ -21,6 +21,8 @@ export default {
pass: null, pass: null,
//0 1 2 //0 1 2
reqType: null, reqType: null,
//:012
userType: null,
}; };
}, },
@ -29,6 +31,7 @@ export default {
this.startLoading(); this.startLoading();
let params = this.parseUrl(); let params = this.parseUrl();
this.reqType = params.reqType; this.reqType = params.reqType;
this.userType = params.userType;
// //
if ( if (
!$.isEmptyObject(params) && !$.isEmptyObject(params) &&
@ -144,6 +147,8 @@ export default {
//0 1 2 //0 1 2
localStorage.setItem('reqType', self.reqType); localStorage.setItem('reqType', self.reqType);
//
localStorage.setItem('userType', self.userType);
if (self.reqType == 0) { if (self.reqType == 0) {
// //
localStorage.setItem('remainingTime', res.data.data.remainingTime); localStorage.setItem('remainingTime', res.data.data.remainingTime);

Loading…
Cancel
Save