动态获取访问人数

chengdu
liangliang.Li 4 years ago
parent 64d5e6ffbe
commit 55782907b9
  1. 12
      src/components/page/ClientLogin.vue
  2. 20
      src/components/page/Login.vue
  3. 2
      src/utils/api.js

@ -1,5 +1,6 @@
<template>
<div class="wrap">
<el-button type="primary" class="back_index" round @click="backIndex">返回主页</el-button>
<div class="left">
<img src="../../assets/img/logo.png" alt="">
<div class="text">
@ -200,6 +201,9 @@ export default {
})
},
methods: {
backIndex(){
this.$router.go(-1);
},
getSchool(form) {
this.$refs[form].validate(valid => {
if (valid) {
@ -572,4 +576,12 @@ export default {
color: #ffa94e;
font-size: 14px;
}
.back_index{
position: fixed;
width: 150px;
height: 60px;
// z-index: 200;
bottom: 80px;
right: 80px;
}
</style>

@ -27,9 +27,9 @@
<div class="count_wrap">
<div class="count_title">访问统计</div>
<div>
<div class="count_current">当前访问&nbsp;87</div>
<div class="count_history">历史访问&nbsp;468427</div>
<div class="count_people">实验人数&nbsp;1059</div>
<div class="count_current">当前访问&nbsp;{{proAccessNum.currentNum}}</div>
<div class="count_history">历史访问&nbsp;{{proAccessNum.historyNUm}}</div>
<div class="count_people">实验人数&nbsp;{{proAccessNum.testNum}}</div>
</div>
</div>
</div>
@ -40,6 +40,11 @@ import { Loading } from 'element-ui'
export default {
data() {
return {
proAccessNum:{
currentNum:'',
historyNum:'',
testNum:''
},
userId: '',
studentId: '',
schoolId: '',
@ -48,9 +53,16 @@ export default {
}
},
mounted(){
this.accessNum()
},
methods:{
accessNum(){
this.$get(this.api.getAccessNum).then(res =>{
this.proAccessNum.currentNum = res.currentNum,
this.proAccessNum.historyNUm = res.historyNUm,
this.proAccessNum.testNum = res.experimentNum
}).catch(err=>{})
},
toClient(){
location.href = location.host.includes('116.63.168.79') ? 'http://116.63.168.79/kdclient/#/clientLogin' : 'http://122.9.154.146/kdclient/#/clientLogin'
},

@ -34,6 +34,8 @@ export default {
checkCode: `${host}/evaluation/tms/userInfo/checkCode`,
getCoursevideo:`${host}/evaluation/tms/classTech/simulationPlayList`,//开始课程-课程视频
queryPersonalCenter:`${host}/evaluation/personalCenter/queryPersonalCenter`,
getAccessNum:`${host}/evaluation/tms/userInfo/getAccessNum`,//获取项目访问量
examinePassword:`${host}/evaluation/tms/user/examinePassword`,//更换密码
userinfoUpdate:`${host}/evaluation/tms/user/update`,//个人中心信息修改

Loading…
Cancel
Save