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';
headers;
options;
constructor(private http: HttpClient,private commonSer:CommonService,private http1:Http,
private localStorage:LocalStorageService,private sessionStorage:SessionStorageService) {
return this.http.post(SERVER_API_URL_COMS + '/role/updateRole',data);
return this.http.post(SERVER_API_URL_COMS + '/role/createRole',data);
return this.http.get(SERVER_API_URL_COMS + '/role/deleteRoleById/' + params);
return this.http.post(SERVER_API_URL_COMS + '/user/getUserList',data);
return this.http.post(SERVER_API_URL_COMS + '/user/createUser',data);
return this.http.post(SERVER_API_URL_COMS + '/user/updateUser',data);
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);
return this.http.post(SERVER_API_URL_COMS + '/user/batchDeleteUser' ,data);
return this.http.get(SERVER_API_URL_COMS + '/organization/getAll',);
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);
return this.http.post(SERVER_API_URL_COMS + '/organization/createOrganization',data);
return this.http.get(SERVER_API_URL_COMS + '/separationConfig/getSeparationConfig',);
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');
return this.http.post(SERVER_API_URL_COMS + '/separationConfig/updateValue',data);
checkRole(): Observable<any>{
return this.http.get(SERVER_API_URL_COMS + '/role/checkRole');
//获取当前已审批记录
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 );
return this.http.post(SERVER_API_URL_COMS + '/approve/pass', data );
//审批不通过
approvUnPass(data): Observable<any>{
return this.http.post(SERVER_API_URL_COMS + '/approve/unPass', data);
}
//审批取消
approvCancle(data): Observable<any>{
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');
return this.http.get(SERVER_API_URL_COMS + '/approval/unApproveList' );
return this.http.post(SERVER_API_URL_COMS + '/modifyPassword',data );
return this.http.get(SERVER_API_URL_COMS + '/separationConfig/open' );
return this.http.get(SERVER_API_URL_COMS + '/separationConfig/close' );
return this.http.get(SERVER_API_URL_COMS + '/separationConfig/closeSystem' );
return this.http.get(SERVER_API_URL_COMS + '/separationConfig/openSystem' );
return this.http.get(SERVER_API_URL_COMS + '/separationConfig/openAuth' );
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);
}
//组织导入
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 );
}
/**
* 下载文件
* @param pararms 参数
* @param url 地址
* @returns {Observable<any>}
*/
downloadTemplate(pararms,url): Observable<any>{
return this.http.get( url +pararms,{responseType: 'blob'});
}