mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-13 04:46:44 +08:00
119 lines
2.7 KiB
JavaScript
119 lines
2.7 KiB
JavaScript
/**对应用户中心新的接口*/
|
||
import ajax from './boeAjax';
|
||
//const baseURL = process.env.VUE_APP_CESOURCE_BASE_API;
|
||
const baseURL ="/userbasic";
|
||
|
||
/**用于本地测试*/
|
||
const login = function() {
|
||
return ajax.post(baseURL,'/org/userParentOrg',{});
|
||
}
|
||
|
||
/**退出*/
|
||
const logout = function() {
|
||
return ajax.postJson(baseURL,'/logout',{from:'pc'});
|
||
}
|
||
|
||
|
||
|
||
/**
|
||
* 获取用户的组织机构
|
||
* organization_id
|
||
*/
|
||
const userParentOrg = function() {
|
||
return ajax.post(baseURL,'/org/userParentOrg',{});
|
||
}
|
||
|
||
//https://u-pre.boe.com/userbasic/org/list
|
||
/**
|
||
* 根据关键字查询机构
|
||
*/
|
||
const findOrgsByKeyword = function(keyword) {
|
||
return ajax.postJson(baseURL,'/org/list',{keyword});
|
||
}
|
||
|
||
/**
|
||
* 此接口已经不再使用
|
||
*/
|
||
const findOrgTreeByOrgId = function(orgId) {
|
||
return ajax.postJson(baseURL,'/org/childOrgs',{orgId});
|
||
}
|
||
|
||
const getOrgInfo = function(orgId) {
|
||
return ajax.postJson(baseURL,'/org/info',{orgId});
|
||
}
|
||
|
||
/**根据用户id获取用户的信息*/
|
||
const getUserInfoById = function(id) {
|
||
return ajax.postJson(baseURL,'/user/list',{id});
|
||
}
|
||
|
||
/**
|
||
* https://u-pre.boe.com/userbasic/audience/userAudiences
|
||
* 获取当前用户受众信息
|
||
*/
|
||
const getUserCrowds = function() {
|
||
return ajax.postJson(baseURL,'/audience/userAudiences',{});
|
||
}
|
||
|
||
/**
|
||
* 获取用户过滤后的受众,只是查询已发布的
|
||
* {"page":1,pageSize:100,"keyword":""}
|
||
*/
|
||
const getUserAudiences = function(data) {
|
||
return ajax.postJson(baseURL,'/audience/userAudiencesFilter',data);
|
||
}
|
||
|
||
/**
|
||
* 获取hrbp数据
|
||
*/
|
||
const getOrgHrbpInfo = function(orgId) {
|
||
return ajax.postJson(baseURL,'/org/orgHrbpInfo',{orgId});
|
||
}
|
||
|
||
/**
|
||
* 修改密码,不再使用,已转化为userbasic接口
|
||
* {newPassword:'',oldPassword:''}
|
||
*/
|
||
const modifyPassword = function(data) {
|
||
return ajax.postJson(baseURL,'/user/resetPassword',data);
|
||
}
|
||
|
||
/**获取加入的受众的id集合*/
|
||
const getInAudienceIds = function() {
|
||
return ajax.post(baseURL,'/audience/audienceByUser',{});
|
||
}
|
||
|
||
/**
|
||
* 更新用户信息,当前只是列新三个信息,根据aid来更新
|
||
* aid
|
||
* avatar
|
||
* sign
|
||
*/
|
||
const updateUser = function(data) {
|
||
return ajax.postJson(baseURL,'/user/updateUserMessage',data);
|
||
}
|
||
|
||
/**
|
||
* 根据用户的id集合,获取用户的姓名,工号,头像,组织机构,签名等信息
|
||
* ids: 用户的id数组集合
|
||
*/
|
||
const getUsersByIds = function(ids) {
|
||
return ajax.postJson(baseURL,'/user/getUserMessageToDai',ids);
|
||
}
|
||
|
||
export default {
|
||
userParentOrg,
|
||
findOrgsByKeyword,
|
||
getOrgInfo,
|
||
findOrgTreeByOrgId,
|
||
getUserInfoById,
|
||
getUserCrowds,
|
||
getUserAudiences,
|
||
getOrgHrbpInfo,
|
||
modifyPassword,
|
||
getInAudienceIds,
|
||
getUsersByIds,
|
||
updateUser,
|
||
logout
|
||
}
|