mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-14 21:36:42 +08:00
添加测试环境跳转名单
This commit is contained in:
@@ -48,7 +48,7 @@
|
|||||||
<div style="margin-top:10px">
|
<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="/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="/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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -78,9 +78,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="learning-info">
|
<div class="learning-info">
|
||||||
|
|
||||||
<div @click="jumrank" style="cursor: pointer;" class="ranking-link"> BOE 排行榜 >></div>
|
<div @click="jumrank" style="cursor: pointer;" class="ranking-link"> BOE 排行榜 >></div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -92,6 +92,7 @@
|
|||||||
import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
import apiStart from '@/api/phase2/stat.js'
|
import apiStart from '@/api/phase2/stat.js'
|
||||||
|
import testUser from '@/utils/testUsers.js'
|
||||||
export default {
|
export default {
|
||||||
name: 'UcHeader',
|
name: 'UcHeader',
|
||||||
computed:{
|
computed:{
|
||||||
@@ -103,6 +104,7 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
|||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||||
|
isTest:false,
|
||||||
statData:{
|
statData:{
|
||||||
evalue: 0,//经验值
|
evalue: 0,//经验值
|
||||||
level: "LV1",//级别
|
level: "LV1",//级别
|
||||||
@@ -130,8 +132,11 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
|||||||
this.loadUserStat();
|
this.loadUserStat();
|
||||||
this.$bus.$on('u-Currency',(num)=>{
|
this.$bus.$on('u-Currency',(num)=>{
|
||||||
this.statData.uvalue = num;
|
this.statData.uvalue = num;
|
||||||
})
|
})
|
||||||
|
//console.log(this.userInfo.loginName,'this.userInfo.loginName')
|
||||||
|
if(testUser.isTest(this.userInfo.loginName)){
|
||||||
|
this.isTest=true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
loadUserStat(){//获取经验值和等级
|
loadUserStat(){//获取经验值和等级
|
||||||
@@ -157,6 +162,13 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
|||||||
|
|
||||||
setCurIdentity(iden){
|
setCurIdentity(iden){
|
||||||
this.$store.dispatch('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(){
|
jumrank(){
|
||||||
this.$router.push('/user/ranking');
|
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