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,10 +36,12 @@ const getUserInfoById = function(id) {
|
|||||||
* 获取当前用户受众信息
|
* 获取当前用户受众信息
|
||||||
*/
|
*/
|
||||||
const getUserCrowds = function() {
|
const getUserCrowds = function() {
|
||||||
return ajax.postJson('/audience/userAudiences',{});
|
return new Promise(function(resolve, reject){
|
||||||
|
|
||||||
|
});
|
||||||
|
//return ajax.postJson('/audience/userAudiences',{});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取hrbp数据
|
* 获取hrbp数据
|
||||||
*/
|
*/
|
||||||
@@ -56,8 +58,21 @@ const modifyPassword = function(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**获取加入的受众的id集合*/
|
/**获取加入的受众的id集合*/
|
||||||
const getInAudienceIds = function() {
|
const getInAudienceIds = function(userId) {
|
||||||
return ajax.post(baseURL,'/audience/audienceByUser',{});
|
//加入缓存处理
|
||||||
|
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 {
|
export default {
|
||||||
|
|||||||
@@ -180,6 +180,7 @@
|
|||||||
import {toScore} from '@/utils/tools.js'
|
import {toScore} from '@/utils/tools.js'
|
||||||
import apiBoeCourse from '@/api/boe/course.js'
|
import apiBoeCourse from '@/api/boe/course.js'
|
||||||
import apiUserGroup from "@/api/modules/usergroup.js";
|
import apiUserGroup from "@/api/modules/usergroup.js";
|
||||||
|
import apiUserbasic from '@/api/boe/userbasic.js'
|
||||||
import apiOnceMedal from '@/api/phase2/onceMedal.js'
|
import apiOnceMedal from '@/api/phase2/onceMedal.js'
|
||||||
import { mapGetters,mapActions} from 'vuex';
|
import { mapGetters,mapActions} from 'vuex';
|
||||||
export default {
|
export default {
|
||||||
@@ -281,8 +282,16 @@
|
|||||||
//this.signInShow = true;//显示
|
//this.signInShow = true;//显示
|
||||||
}
|
}
|
||||||
this.getSysTypeTree();
|
this.getSysTypeTree();
|
||||||
this.findCourseData();
|
|
||||||
this.loadSysTypes();
|
this.loadSysTypes();
|
||||||
|
if(this.audiences.length==0){
|
||||||
|
apiUserbasic.getInAudienceIds(this.userInfo.aid).then(rs=>{
|
||||||
|
this.audiences=rs;
|
||||||
|
this.findCourseData();
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
this.findCourseData();
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions({
|
...mapActions({
|
||||||
@@ -426,8 +435,10 @@
|
|||||||
sysType2:'',
|
sysType2:'',
|
||||||
sysType3:'',
|
sysType3:'',
|
||||||
scenes:'',
|
scenes:'',
|
||||||
|
audiences:this.audiences.join(','),
|
||||||
type:''
|
type:''
|
||||||
}
|
}
|
||||||
|
|
||||||
query.type=this.dataFilter.courseParams.type;
|
query.type=this.dataFilter.courseParams.type;
|
||||||
// if(this.tabIndex==0){
|
// if(this.tabIndex==0){
|
||||||
// query.orderField='publishTime';
|
// query.orderField='publishTime';
|
||||||
|
|||||||
@@ -277,6 +277,7 @@
|
|||||||
import {toScore} from '@/utils/tools.js'
|
import {toScore} from '@/utils/tools.js'
|
||||||
import apiArticle from '@/api/modules/article.js'
|
import apiArticle from '@/api/modules/article.js'
|
||||||
import apiBoeCourse from '@/api/boe/course.js'
|
import apiBoeCourse from '@/api/boe/course.js'
|
||||||
|
import apiUserbasic from '@/api/boe/userbasic.js'
|
||||||
import apiUserGroup from "@/api/modules/usergroup.js";
|
import apiUserGroup from "@/api/modules/usergroup.js";
|
||||||
import { mapGetters } from 'vuex'
|
import { mapGetters } from 'vuex'
|
||||||
export default{
|
export default{
|
||||||
@@ -339,26 +340,22 @@
|
|||||||
}
|
}
|
||||||
this.loadSeachWords();
|
this.loadSeachWords();
|
||||||
if(this.audiences.length==0){
|
if(this.audiences.length==0){
|
||||||
//let hasIds;
|
apiUserbasic.getInAudienceIds(this.userInfo.aid).then(rs=>{
|
||||||
// let hasIds=sessionStorage.getItem(localKey);
|
this.audiences=rs;
|
||||||
// if(hasIds && hasIds.length>0){
|
});
|
||||||
// this.audiences=hasIds.split(",");
|
// Promise.all([apiBoeCourse.audience(this.userInfo.sysId),apiUserGroup.userGroupIds()]).then(rs=>{
|
||||||
// this.search();
|
// //console.log(rs,'rs');
|
||||||
// }else{
|
// let aids=[];
|
||||||
//console.log(this.userInfo,'this.userInfo')
|
// if(rs[0].status==200){
|
||||||
Promise.all([apiBoeCourse.audience(this.userInfo.sysId),apiUserGroup.userGroupIds()]).then(rs=>{
|
// aids.push(rs[0].result);
|
||||||
//console.log(rs,'rs');
|
// }
|
||||||
let aids=[];
|
// if(rs[1].status==200){
|
||||||
if(rs[0].status==200){
|
// aids.push(rs[1].result);
|
||||||
aids.push(rs[0].result);
|
// }
|
||||||
}
|
// this.audiences=aids;
|
||||||
if(rs[1].status==200){
|
// //sessionStorage.setItem(localKey,this.audiences);
|
||||||
aids.push(rs[1].result);
|
// //this.search();
|
||||||
}
|
// })
|
||||||
this.audiences=aids;
|
|
||||||
//sessionStorage.setItem(localKey,this.audiences);
|
|
||||||
//this.search();
|
|
||||||
})
|
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user