Newer
Older
import {HttpClient} from '@angular/common/http';
import {Observable} from 'rxjs/Rx';
import {Injectable} from '@angular/core';
import {SERVER_API_URL, SERVER_API_URL_COMS} from '../app.constants';
import {CommonService} from '../shared/common/common.service';
import {LocalStorageService, SessionStorageService} from 'ngx-webstorage';
import {Http, RequestOptions, ResponseContentType, ResponseOptions} from '@angular/http';
constructor(private http: HttpClient, private commonSer: CommonService, private http1: Http,
private localStorage: LocalStorageService, private sessionStorage: SessionStorageService) {
getRole(params): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/role/' + params);
editRole(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/role/updateRole', data);
addRole(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/role/createRole', data);
return this.http.get(SERVER_API_URL_COMS + '/role/deleteRoleById/' + params);
user(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/user/getUserList', data);
adduser(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/user/createUser', data);
updateUser(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/user/updateUser', data);
getUser(params): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/user/getUserById/' + params);
getRoleByUserId(params): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/user/getRoleByUserId/' + params);
deleteUser(params): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/user/deleteUser/' + params);
batchDeleteUser(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/user/batchDeleteUser', data);
return this.http.get(SERVER_API_URL_COMS + '/organization/getAll',);
deleteOrg(params): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/organization/deleteOrganizationById/' + params);
updateOrganization(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/organization/updateOrganization', data);
createOrg(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/organization/createOrganization', data);
return this.http.get(SERVER_API_URL_COMS + '/separationConfig/getSeparationConfig',);
logList(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/log/getLog', data);
batchAuthRoleToUser(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/role/batchAuthRoleToUser', data);
aloneUserToAuth(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/user/auth', data);
batchUserToAuth(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/user/batchAuth', data);
getUserByOrgIdAboutRole(data): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/user/getUserByOrgIdAboutRole?' + this.commonSer.toQuery(data));
return this.http.get(SERVER_API_URL_COMS + '/approval/separationPowerStatus');
updateValue(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/separationConfig/updateValue', data);
getApproveOfDone(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/approve/getApproveOfDone', data);
getUnApprove(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/approve/getUnApprove', data);
approvalPass(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/approve/pass', data);
return this.http.post(SERVER_API_URL_COMS + '/approve/unPass', data);
}
//审批取消
return this.http.post(SERVER_API_URL_COMS + '/approve/cancle', data);
return this.http.post(SERVER_API_URL_COMS + '/approval/remove', data);
return this.http.get(SERVER_API_URL_COMS + '/approval/approveList');
unApproveList(): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/approval/unApproveList');
modifyPassword(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/modifyPassword', data);
separationConfigOpen(): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/separationConfig/open');
separationConfigClose(): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/separationConfig/close');
closeSystem(): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/separationConfig/closeSystem');
openSystem(): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/separationConfig/openSystem');
openAuth(): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/separationConfig/openAuth');
closeAuth(): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/separationConfig/closeAuth');
getMenuBySeparation(): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/resources/getMenuBySeparation');
importUser(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/user/importUser', data);
createMenu(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/resources/createMenu', data);
deleteMenu(params): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/resources/deleteMenu/' + params);
importOrg(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/organization/importOrg', data);
getAllOutOfMine(params): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/organization/getAllOutOfMine/' + params);
}
//获取登录信息
getUserInfo(data): Observable<any> {
return this.http.post(SERVER_API_URL_COMS + '/check', data);
}
//获取根据userId部门信息
findOrganizationByUserId(params): Observable<any> {
return this.http.get(SERVER_API_URL_COMS + '/organization/findByUserId/' + params);
* @param pararms 参数
* @param url 地址
* @returns {Observable<any>}
*/
downloadTemplate(pararms, url): Observable<any> {
return this.http.get(url + pararms, {responseType: 'blob'});