mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-09 02:46:46 +08:00
课程查询受众权限接口修改
This commit is contained in:
@@ -36,9 +36,11 @@ const getUserInfoById = function(id) {
|
||||
* 获取当前用户受众信息
|
||||
*/
|
||||
const getUserCrowds = function() {
|
||||
return ajax.postJson('/audience/userAudiences',{});
|
||||
}
|
||||
return new Promise(function(resolve, reject){
|
||||
|
||||
});
|
||||
//return ajax.postJson('/audience/userAudiences',{});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取hrbp数据
|
||||
@@ -56,8 +58,21 @@ const modifyPassword = function(data) {
|
||||
}
|
||||
|
||||
/**获取加入的受众的id集合*/
|
||||
const getInAudienceIds = function() {
|
||||
return ajax.post(baseURL,'/audience/audienceByUser',{});
|
||||
const getInAudienceIds = function(userId) {
|
||||
//加入缓存处理
|
||||
let localKey="user_"+userId+"_gids";
|
||||
//let hasIds=sessionStorage.getItem(localKey);
|
||||
return new Promise(function(resolve, reject){
|
||||
ajax.post('/audience/audienceByUser',{}).then(res=>{
|
||||
if(res.status==200){
|
||||
resolve(res.result);
|
||||
}else{
|
||||
console.log('未获取人员的受众权限id');
|
||||
reject([]);
|
||||
}
|
||||
});
|
||||
});
|
||||
// return ajax.post(baseURL,'/audience/audienceByUser',{});
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
@@ -180,6 +180,7 @@
|
||||
import {toScore} from '@/utils/tools.js'
|
||||
import apiBoeCourse from '@/api/boe/course.js'
|
||||
import apiUserGroup from "@/api/modules/usergroup.js";
|
||||
import apiUserbasic from '@/api/boe/userbasic.js'
|
||||
import apiOnceMedal from '@/api/phase2/onceMedal.js'
|
||||
import { mapGetters,mapActions} from 'vuex';
|
||||
export default {
|
||||
@@ -281,8 +282,16 @@
|
||||
//this.signInShow = true;//显示
|
||||
}
|
||||
this.getSysTypeTree();
|
||||
this.findCourseData();
|
||||
this.loadSysTypes();
|
||||
if(this.audiences.length==0){
|
||||
apiUserbasic.getInAudienceIds(this.userInfo.aid).then(rs=>{
|
||||
this.audiences=rs;
|
||||
this.findCourseData();
|
||||
});
|
||||
}else{
|
||||
this.findCourseData();
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
...mapActions({
|
||||
@@ -426,8 +435,10 @@
|
||||
sysType2:'',
|
||||
sysType3:'',
|
||||
scenes:'',
|
||||
audiences:this.audiences.join(','),
|
||||
type:''
|
||||
}
|
||||
|
||||
query.type=this.dataFilter.courseParams.type;
|
||||
// if(this.tabIndex==0){
|
||||
// query.orderField='publishTime';
|
||||
|
||||
@@ -277,6 +277,7 @@
|
||||
import {toScore} from '@/utils/tools.js'
|
||||
import apiArticle from '@/api/modules/article.js'
|
||||
import apiBoeCourse from '@/api/boe/course.js'
|
||||
import apiUserbasic from '@/api/boe/userbasic.js'
|
||||
import apiUserGroup from "@/api/modules/usergroup.js";
|
||||
import { mapGetters } from 'vuex'
|
||||
export default{
|
||||
@@ -339,26 +340,22 @@
|
||||
}
|
||||
this.loadSeachWords();
|
||||
if(this.audiences.length==0){
|
||||
//let hasIds;
|
||||
// let hasIds=sessionStorage.getItem(localKey);
|
||||
// if(hasIds && hasIds.length>0){
|
||||
// this.audiences=hasIds.split(",");
|
||||
// this.search();
|
||||
// }else{
|
||||
//console.log(this.userInfo,'this.userInfo')
|
||||
Promise.all([apiBoeCourse.audience(this.userInfo.sysId),apiUserGroup.userGroupIds()]).then(rs=>{
|
||||
//console.log(rs,'rs');
|
||||
let aids=[];
|
||||
if(rs[0].status==200){
|
||||
aids.push(rs[0].result);
|
||||
}
|
||||
if(rs[1].status==200){
|
||||
aids.push(rs[1].result);
|
||||
}
|
||||
this.audiences=aids;
|
||||
//sessionStorage.setItem(localKey,this.audiences);
|
||||
//this.search();
|
||||
})
|
||||
apiUserbasic.getInAudienceIds(this.userInfo.aid).then(rs=>{
|
||||
this.audiences=rs;
|
||||
});
|
||||
// Promise.all([apiBoeCourse.audience(this.userInfo.sysId),apiUserGroup.userGroupIds()]).then(rs=>{
|
||||
// //console.log(rs,'rs');
|
||||
// let aids=[];
|
||||
// if(rs[0].status==200){
|
||||
// aids.push(rs[0].result);
|
||||
// }
|
||||
// if(rs[1].status==200){
|
||||
// aids.push(rs[1].result);
|
||||
// }
|
||||
// this.audiences=aids;
|
||||
// //sessionStorage.setItem(localKey,this.audiences);
|
||||
// //this.search();
|
||||
// })
|
||||
//}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user