mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-15 05:46:43 +08:00
添加测试环境跳转名单
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
<div style="margin-top:10px">
|
||||
<router-link to="/study/index"><span :class="{identity:true,active:curIdentity==1}" @click="setCurIdentity(1)">学员</span></router-link>
|
||||
<router-link to="/teacher/index"><span v-if="identity == 2 || identity == 5" :class="{identity:true,active:curIdentity==2}" @click="setCurIdentity(2)">教师</span></router-link>
|
||||
<router-link to="/manager/index"><span v-if="identity == 3 || identity == 5" :class="{identity:true,active:curIdentity==3}" @click="setCurIdentity(3)">管理员</span></router-link>
|
||||
<span v-if="identity == 3 || identity == 5" :class="{identity:true,active:curIdentity==3}" @click="setCurIdentity(3)">管理员</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -92,6 +92,7 @@
|
||||
import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
||||
import { mapGetters } from 'vuex'
|
||||
import apiStart from '@/api/phase2/stat.js'
|
||||
import testUser from '@/utils/testUsers.js'
|
||||
export default {
|
||||
name: 'UcHeader',
|
||||
computed:{
|
||||
@@ -103,6 +104,7 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
||||
data(){
|
||||
return {
|
||||
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
isTest:false,
|
||||
statData:{
|
||||
evalue: 0,//经验值
|
||||
level: "LV1",//级别
|
||||
@@ -131,7 +133,10 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
||||
this.$bus.$on('u-Currency',(num)=>{
|
||||
this.statData.uvalue = num;
|
||||
})
|
||||
|
||||
//console.log(this.userInfo.loginName,'this.userInfo.loginName')
|
||||
if(testUser.isTest(this.userInfo.loginName)){
|
||||
this.isTest=true;
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
loadUserStat(){//获取经验值和等级
|
||||
@@ -157,6 +162,13 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
||||
|
||||
setCurIdentity(iden){
|
||||
this.$store.dispatch('SetCurIdentity',iden);
|
||||
|
||||
if(this.isTest){
|
||||
//this.$router.push('/manage/learningpath');
|
||||
location.href=process.env.BASE_URL+'manage/learningpath';
|
||||
}else{
|
||||
this.$router.push('/manager/index');
|
||||
}
|
||||
},
|
||||
jumrank(){
|
||||
this.$router.push('/user/ranking');
|
||||
|
||||
23
src/utils/testUsers.js
Normal file
23
src/utils/testUsers.js
Normal file
@@ -0,0 +1,23 @@
|
||||
/**测试人员名单*/
|
||||
|
||||
const userCodes=[
|
||||
'00004409'
|
||||
]
|
||||
|
||||
/**是否是测试人员*/
|
||||
const isTest=function(code){
|
||||
var testUser=false;
|
||||
userCodes.some(item=>{
|
||||
if(item===code){
|
||||
testUser=true;
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
})
|
||||
return testUser;
|
||||
}
|
||||
|
||||
export default {
|
||||
isTest
|
||||
}
|
||||
Reference in New Issue
Block a user