mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 03:16:42 +08:00
放开引导页检查
This commit is contained in:
@@ -531,41 +531,38 @@
|
||||
|
||||
//检查兴趣爱好是否已填报,
|
||||
//先检查本地session和 local 15天, 这两个值是在组件中设置的
|
||||
// let sessionHobby=sessionStorage.getItem('user-hobby-'+this.userInfo.aid);
|
||||
// let localHobbyTime=localStorage.getItem('notYet'+this.userInfo.aid);
|
||||
// if(!sessionHobby){ //只有session中不存在,才会验证
|
||||
// //本地15天验证,localHobby,后续完善
|
||||
// let flag=true;//请求检查
|
||||
// if(localHobbyTime) {
|
||||
// let day = (new Date() - new Date(localHobbyTime))/(1000*60*60*24);
|
||||
// if(day< 15){
|
||||
// flag = false;
|
||||
// }
|
||||
// }
|
||||
// if(flag){
|
||||
// apiUserhobby.has().then(res=>{
|
||||
// if(res.status == 200) {
|
||||
// if(!res.result){
|
||||
// //设置需要显示兴趣爱好收集窗口
|
||||
// this.userHobby.needShow=true;
|
||||
// }
|
||||
// }else{
|
||||
// console.log('兴趣爱好检查失败'+res.message);
|
||||
// }
|
||||
// //检查引导页
|
||||
// this.checkAndShowGuide();
|
||||
// });
|
||||
// }else{
|
||||
// this.checkAndShowGuide();
|
||||
// }
|
||||
// }else{
|
||||
// //不用检查引导页
|
||||
// //this.checkAndShowGuide();
|
||||
// }
|
||||
|
||||
//测试环境中
|
||||
this.userHobby.needShow=true;
|
||||
this.checkAndShowGuide();
|
||||
let sessionHobby=sessionStorage.getItem('user-hobby-'+this.userInfo.aid);
|
||||
let localHobbyTime=localStorage.getItem('notYet'+this.userInfo.aid);
|
||||
console.log("sessionHobby:"+sessionHobby);
|
||||
if(!sessionHobby){ //只有session中不存在,才会验证
|
||||
//本地15天验证,localHobby,后续完善
|
||||
let flag=true;//请求检查
|
||||
if(localHobbyTime) {
|
||||
let day = (new Date() - new Date(localHobbyTime))/(1000*60*60*24);
|
||||
if(day< 15){
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
if(flag){
|
||||
apiUserhobby.has().then(res=>{
|
||||
if(res.status == 200) {
|
||||
if(!res.result){
|
||||
//设置需要显示兴趣爱好收集窗口
|
||||
this.userHobby.needShow=true;
|
||||
}
|
||||
}else{
|
||||
console.log('兴趣爱好检查失败'+res.message);
|
||||
}
|
||||
//检查引导页
|
||||
this.checkAndShowGuide();
|
||||
});
|
||||
}else{
|
||||
this.checkAndShowGuide();
|
||||
}
|
||||
}else{
|
||||
//检查引导页
|
||||
this.checkAndShowGuide();
|
||||
}
|
||||
|
||||
},
|
||||
computed: {
|
||||
@@ -579,28 +576,29 @@
|
||||
checkAndShowGuide(){
|
||||
//引导页弹框是否显示
|
||||
//检查本地,减少服务器请求的次数
|
||||
// let localGuide=localStorage.getItem('user-guide-'+this.userInfo.aid);
|
||||
// if(!localGuide){
|
||||
// apiGuide.hasUser().then(res=>{
|
||||
// if(res.status==200){
|
||||
// if(!res.result){
|
||||
// this.$refs.guide.show();
|
||||
// }else{
|
||||
// if(this.userHobby.needShow){ this.$refs.userCollection.show();}
|
||||
// }
|
||||
// localStorage.setItem('user-guide-'+this.userInfo.aid,1);
|
||||
// }else{
|
||||
// console.log('获取引导页检查失败'+res.message);
|
||||
// //this.$message.error('')
|
||||
// if(this.userHobby.needShow){this.$refs.userCollection.show();}
|
||||
// }
|
||||
// });
|
||||
// }else {
|
||||
// if(this.userHobby.needShow){ this.$refs.userCollection.show();}
|
||||
// }
|
||||
let localGuide=localStorage.getItem('user-guide-'+this.userInfo.aid);
|
||||
console.log("=== "+localGuide);
|
||||
if(!localGuide){
|
||||
apiGuide.hasUser().then(res=>{
|
||||
if(res.status==200){
|
||||
if(!res.result){
|
||||
this.$refs.guide.show();
|
||||
}else{
|
||||
if(this.userHobby.needShow){ this.$refs.userCollection.show();}
|
||||
}
|
||||
localStorage.setItem('user-guide-'+this.userInfo.aid,1);
|
||||
}else{
|
||||
console.log('获取引导页检查失败'+res.message);
|
||||
//this.$message.error('')
|
||||
if(this.userHobby.needShow){this.$refs.userCollection.show();}
|
||||
}
|
||||
});
|
||||
}else {
|
||||
if(this.userHobby.needShow){ this.$refs.userCollection.show();}
|
||||
}
|
||||
|
||||
//测试情况下
|
||||
this.$refs.guide.show();
|
||||
// this.$refs.guide.show();
|
||||
},
|
||||
closeGuide(){ //关闭引导页
|
||||
if(this.userHobby.needShow){
|
||||
|
||||
Reference in New Issue
Block a user