1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
export class MainFrameService{
constructor(public http: Http, public user : User, public myAppErrors : Errors) { }
getInitDataAjax(){
...
let sequence = SequenceData.initDisplay
.replace('#LOGINDOM#', loginDOM )
.replace('#MEMBERSHIPDOM#', memberShipDOM )
.replace('#BRANDDOM#', brandDOM )
return this.http.get(URLData+''+sequence)
.toPromise()
.then(response => {
// Une fois que l'on a les informations, on créé un objet user de façon compléte
let doc = response.json().document ;
let status = doc.Statut;
let profil = doc.profil;
if (profil != undefined){
this.user = {
login : profil.Login,
civilite : profil.Civilite,
nom : profil.Nom,
prenom : profil.Prenom,
mail : profil.Email,
type : profil.Type,
ctree : profil.CTREE,
rtree : profil.RTREE,
raisonsociale : $.trim(profil.RaisonSociale),
tdb : profil.DefaultDashboard,
isInSubstition : '',
substitedlogin : '' ,
substitednomPrenom :'',
substitedTDB : ""
}
statut = "OK";
return { user : this.user, exceptionError: exceptionError, idWidgetCallError : idWidgetCallError, messageError : messageError, status : statut } |
Partager