mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
save
This commit is contained in:
+17
@@ -2759,6 +2759,7 @@ class AuthConnstants {
|
||||
/* My reference key */
|
||||
AuthConnstants.AUTH = 'userDataKey';
|
||||
AuthConnstants.PROFILE = 'profile';
|
||||
AuthConnstants.USER = 'userId';
|
||||
|
||||
|
||||
/***/ }),
|
||||
@@ -2798,14 +2799,24 @@ let AuthService = class AuthService {
|
||||
this.storageService = storageService;
|
||||
this.router = router;
|
||||
this.userData$ = new rxjs__WEBPACK_IMPORTED_MODULE_7__["BehaviorSubject"]('');
|
||||
this.userId$ = new rxjs__WEBPACK_IMPORTED_MODULE_7__["BehaviorSubject"]('');
|
||||
this.headers = new _angular_common_http__WEBPACK_IMPORTED_MODULE_4__["HttpHeaders"]();
|
||||
}
|
||||
login(user) {
|
||||
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
|
||||
user.BasicAuthKey = 'Basic ' + btoa(user.domainName + '\\' + user.username + ':' + user.password); //conversão em base64 das credenciais inseridas
|
||||
const options = { headers: { 'Authorization': user.BasicAuthKey } };
|
||||
this.headers = this.headers.set('Authorization', user.BasicAuthKey);
|
||||
this.opts = {
|
||||
headers: this.headers,
|
||||
};
|
||||
const service = src_environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].apiURL + "userauthentication/GetValidateAuth";
|
||||
let result;
|
||||
let response;
|
||||
result = yield this.http.get(service, options).toPromise();
|
||||
this.http.post(src_environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].apiURL + "UserAuthentication/Login", '', this.opts).subscribe(res => {
|
||||
this.storageService.store(_config_auth_constants__WEBPACK_IMPORTED_MODULE_8__["AuthConnstants"].USER, res);
|
||||
});
|
||||
if (result) {
|
||||
this.ValidatedUser = user;
|
||||
}
|
||||
@@ -2825,6 +2836,12 @@ let AuthService = class AuthService {
|
||||
this.userData$.next(res);
|
||||
});
|
||||
}
|
||||
//Get user Id | global object
|
||||
getUserId() {
|
||||
this.storageService.get(_config_auth_constants__WEBPACK_IMPORTED_MODULE_8__["AuthConnstants"].USER).then(res => {
|
||||
this.userId$.next(res);
|
||||
});
|
||||
}
|
||||
getProfile() {
|
||||
this.storageService.get(_config_auth_constants__WEBPACK_IMPORTED_MODULE_8__["AuthConnstants"].PROFILE).then(res => {
|
||||
return res;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+31
-9
@@ -4659,6 +4659,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||
|
||||
AuthConnstants.AUTH = 'userDataKey';
|
||||
AuthConnstants.PROFILE = 'profile';
|
||||
AuthConnstants.USER = 'userId';
|
||||
/***/
|
||||
},
|
||||
|
||||
@@ -4745,13 +4746,17 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||
this.storageService = storageService;
|
||||
this.router = router;
|
||||
this.userData$ = new rxjs__WEBPACK_IMPORTED_MODULE_7__["BehaviorSubject"]('');
|
||||
this.userId$ = new rxjs__WEBPACK_IMPORTED_MODULE_7__["BehaviorSubject"]('');
|
||||
this.headers = new _angular_common_http__WEBPACK_IMPORTED_MODULE_4__["HttpHeaders"]();
|
||||
}
|
||||
|
||||
_createClass(AuthService, [{
|
||||
key: "login",
|
||||
value: function login(user) {
|
||||
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
||||
var options, service, result;
|
||||
var _this2 = this;
|
||||
|
||||
var options, service, result, response;
|
||||
return regeneratorRuntime.wrap(function _callee$(_context) {
|
||||
while (1) {
|
||||
switch (_context.prev = _context.next) {
|
||||
@@ -4763,12 +4768,19 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||
'Authorization': user.BasicAuthKey
|
||||
}
|
||||
};
|
||||
this.headers = this.headers.set('Authorization', user.BasicAuthKey);
|
||||
this.opts = {
|
||||
headers: this.headers
|
||||
};
|
||||
service = src_environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].apiURL + "userauthentication/GetValidateAuth";
|
||||
_context.next = 5;
|
||||
_context.next = 7;
|
||||
return this.http.get(service, options).toPromise();
|
||||
|
||||
case 5:
|
||||
case 7:
|
||||
result = _context.sent;
|
||||
this.http.post(src_environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].apiURL + "UserAuthentication/Login", '', this.opts).subscribe(function (res) {
|
||||
_this2.storageService.store(_config_auth_constants__WEBPACK_IMPORTED_MODULE_8__["AuthConnstants"].USER, res);
|
||||
});
|
||||
|
||||
if (result) {
|
||||
this.ValidatedUser = user;
|
||||
@@ -4776,7 +4788,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||
|
||||
return _context.abrupt("return", result);
|
||||
|
||||
case 8:
|
||||
case 11:
|
||||
case "end":
|
||||
return _context.stop();
|
||||
}
|
||||
@@ -4799,10 +4811,20 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||
}, {
|
||||
key: "getUserData",
|
||||
value: function getUserData() {
|
||||
var _this2 = this;
|
||||
var _this3 = this;
|
||||
|
||||
this.storageService.get(_config_auth_constants__WEBPACK_IMPORTED_MODULE_8__["AuthConnstants"].AUTH).then(function (res) {
|
||||
_this2.userData$.next(res);
|
||||
_this3.userData$.next(res);
|
||||
});
|
||||
} //Get user Id | global object
|
||||
|
||||
}, {
|
||||
key: "getUserId",
|
||||
value: function getUserId() {
|
||||
var _this4 = this;
|
||||
|
||||
this.storageService.get(_config_auth_constants__WEBPACK_IMPORTED_MODULE_8__["AuthConnstants"].USER).then(function (res) {
|
||||
_this4.userId$.next(res);
|
||||
});
|
||||
}
|
||||
}, {
|
||||
@@ -4815,13 +4837,13 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||
}, {
|
||||
key: "logoutChat",
|
||||
value: function logoutChat() {
|
||||
var _this3 = this;
|
||||
var _this5 = this;
|
||||
|
||||
//this.storageService.clear();
|
||||
this.storageService.removeStorageItem(_config_auth_constants__WEBPACK_IMPORTED_MODULE_8__["AuthConnstants"].AUTH).then(function (res) {
|
||||
_this3.userData$.next('');
|
||||
_this5.userData$.next('');
|
||||
|
||||
_this3.router.navigate(['']);
|
||||
_this5.router.navigate(['']);
|
||||
});
|
||||
}
|
||||
}]);
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -634,7 +634,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||
// The list of file replacements can be found in `angular.json`.
|
||||
const environment = {
|
||||
production: false,
|
||||
apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V3/api/',
|
||||
apiURL: 'https://equilibrium.dyndns.info/GabineteDigital.Services/V4/api/',
|
||||
apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/',
|
||||
domain: 'gabinetedigital.local',
|
||||
defaultuser: 'paulo.pinto',
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -775,7 +775,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||
|
||||
var environment = {
|
||||
production: false,
|
||||
apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V3/api/',
|
||||
apiURL: 'https://equilibrium.dyndns.info/GabineteDigital.Services/V4/api/',
|
||||
apiChatUrl: 'http://chat.gabinetedigital.local:3000/api/v1/',
|
||||
domain: 'gabinetedigital.local',
|
||||
defaultuser: 'paulo.pinto',
|
||||
|
||||
File diff suppressed because one or more lines are too long
+9
-3
@@ -324,9 +324,15 @@ let ChatPage = class ChatPage {
|
||||
}
|
||||
getDirectMessages() {
|
||||
this.showLoader = true;
|
||||
this.result = this.chatService.getAllDirectMessages().subscribe((res) => {
|
||||
this.userDirectMessages = res.ims;
|
||||
console.log(res);
|
||||
/* this.result = */
|
||||
this.chatService.getAllDirectMessages().subscribe((res) => {
|
||||
console.log(res.ims);
|
||||
this.userDirectMessages = res.ims.sort((a, b) => {
|
||||
var dateA = new Date(a.lastMessage._updatedAt).getTime();
|
||||
var dateB = new Date(b.lastMessage._updatedAt).getTime();
|
||||
return dateB - dateB;
|
||||
});
|
||||
console.log(this.userDirectMessages);
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+10
-3
@@ -576,9 +576,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||
var _this4 = this;
|
||||
|
||||
this.showLoader = true;
|
||||
this.result = this.chatService.getAllDirectMessages().subscribe(function (res) {
|
||||
_this4.userDirectMessages = res.ims;
|
||||
console.log(res);
|
||||
/* this.result = */
|
||||
|
||||
this.chatService.getAllDirectMessages().subscribe(function (res) {
|
||||
console.log(res.ims);
|
||||
_this4.userDirectMessages = res.ims.sort(function (a, b) {
|
||||
var dateA = new Date(a.lastMessage._updatedAt).getTime();
|
||||
var dateB = new Date(b.lastMessage._updatedAt).getTime();
|
||||
return dateB - dateB;
|
||||
});
|
||||
console.log(_this4.userDirectMessages);
|
||||
_this4.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+13
-8
@@ -397,10 +397,12 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var src_app_services_alert_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! src/app/services/alert.service */ "./src/app/services/alert.service.ts");
|
||||
/* harmony import */ var src_app_services_auth_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! src/app/services/auth.service */ "./src/app/services/auth.service.ts");
|
||||
/* harmony import */ var src_app_services_storage_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/services/storage.service */ "./src/app/services/storage.service.ts");
|
||||
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @ionic/angular */ "./node_modules/@ionic/angular/__ivy_ngcc__/fesm2015/ionic-angular.js");
|
||||
/* harmony import */ var _event_detail_event_detail_page__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./event-detail/event-detail.page */ "./src/app/pages/events/event-detail/event-detail.page.ts");
|
||||
/* harmony import */ var _event_detail_modal_event_detail_modal_page__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./event-detail-modal/event-detail-modal.page */ "./src/app/pages/events/event-detail-modal/event-detail-modal.page.ts");
|
||||
/* harmony import */ var _services_processes_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../services/processes.service */ "./src/app/services/processes.service.ts");
|
||||
/* harmony import */ var src_app_config_auth_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! src/app/config/auth-constants */ "./src/app/config/auth-constants.ts");
|
||||
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ionic/angular */ "./node_modules/@ionic/angular/__ivy_ngcc__/fesm2015/ionic-angular.js");
|
||||
/* harmony import */ var _event_detail_event_detail_page__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./event-detail/event-detail.page */ "./src/app/pages/events/event-detail/event-detail.page.ts");
|
||||
/* harmony import */ var _event_detail_modal_event_detail_modal_page__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./event-detail-modal/event-detail-modal.page */ "./src/app/pages/events/event-detail-modal/event-detail-modal.page.ts");
|
||||
/* harmony import */ var _services_processes_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../services/processes.service */ "./src/app/services/processes.service.ts");
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -464,6 +466,9 @@ let EventsPage = class EventsPage {
|
||||
});
|
||||
|
||||
} */
|
||||
this.storageService.get(src_app_config_auth_constants__WEBPACK_IMPORTED_MODULE_8__["AuthConnstants"].USER).then(res => {
|
||||
console.log(res);
|
||||
});
|
||||
this.showGreeting();
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof _angular_router__WEBPACK_IMPORTED_MODULE_3__["NavigationEnd"] && event.url == this.router.url) {
|
||||
@@ -571,7 +576,7 @@ let EventsPage = class EventsPage {
|
||||
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
|
||||
console.log(id);
|
||||
const modal = yield this.modalController.create({
|
||||
component: _event_detail_event_detail_page__WEBPACK_IMPORTED_MODULE_9__["EventDetailPage"],
|
||||
component: _event_detail_event_detail_page__WEBPACK_IMPORTED_MODULE_10__["EventDetailPage"],
|
||||
componentProps: {
|
||||
eventId: id,
|
||||
},
|
||||
@@ -585,7 +590,7 @@ let EventsPage = class EventsPage {
|
||||
openEventDetail(id) {
|
||||
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
|
||||
const modal = yield this.modalController.create({
|
||||
component: _event_detail_modal_event_detail_modal_page__WEBPACK_IMPORTED_MODULE_10__["EventDetailModalPage"],
|
||||
component: _event_detail_modal_event_detail_modal_page__WEBPACK_IMPORTED_MODULE_11__["EventDetailModalPage"],
|
||||
componentProps: {
|
||||
eventId: id,
|
||||
},
|
||||
@@ -623,9 +628,9 @@ EventsPage.ctorParameters = () => [
|
||||
{ type: src_app_services_storage_service__WEBPACK_IMPORTED_MODULE_7__["StorageService"] },
|
||||
{ type: _angular_router__WEBPACK_IMPORTED_MODULE_3__["ActivatedRoute"] },
|
||||
{ type: src_app_services_alert_service__WEBPACK_IMPORTED_MODULE_5__["AlertService"] },
|
||||
{ type: _ionic_angular__WEBPACK_IMPORTED_MODULE_8__["ModalController"] },
|
||||
{ type: _ionic_angular__WEBPACK_IMPORTED_MODULE_9__["ModalController"] },
|
||||
{ type: src_app_services_auth_service__WEBPACK_IMPORTED_MODULE_6__["AuthService"] },
|
||||
{ type: _services_processes_service__WEBPACK_IMPORTED_MODULE_11__["ProcessesService"] }
|
||||
{ type: _services_processes_service__WEBPACK_IMPORTED_MODULE_12__["ProcessesService"] }
|
||||
];
|
||||
EventsPage = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
|
||||
Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Component"])({
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+17
-8
@@ -798,25 +798,31 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
||||
/* harmony import */
|
||||
|
||||
|
||||
var _ionic_angular__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
|
||||
var src_app_config_auth_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
|
||||
/*! src/app/config/auth-constants */
|
||||
"./src/app/config/auth-constants.ts");
|
||||
/* harmony import */
|
||||
|
||||
|
||||
var _ionic_angular__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
|
||||
/*! @ionic/angular */
|
||||
"./node_modules/@ionic/angular/__ivy_ngcc__/fesm2015/ionic-angular.js");
|
||||
/* harmony import */
|
||||
|
||||
|
||||
var _event_detail_event_detail_page__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
|
||||
var _event_detail_event_detail_page__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(
|
||||
/*! ./event-detail/event-detail.page */
|
||||
"./src/app/pages/events/event-detail/event-detail.page.ts");
|
||||
/* harmony import */
|
||||
|
||||
|
||||
var _event_detail_modal_event_detail_modal_page__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(
|
||||
var _event_detail_modal_event_detail_modal_page__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(
|
||||
/*! ./event-detail-modal/event-detail-modal.page */
|
||||
"./src/app/pages/events/event-detail-modal/event-detail-modal.page.ts");
|
||||
/* harmony import */
|
||||
|
||||
|
||||
var _services_processes_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(
|
||||
var _services_processes_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(
|
||||
/*! ../../services/processes.service */
|
||||
"./src/app/services/processes.service.ts");
|
||||
|
||||
@@ -881,6 +887,9 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
||||
});
|
||||
} */
|
||||
|
||||
this.storageService.get(src_app_config_auth_constants__WEBPACK_IMPORTED_MODULE_8__["AuthConnstants"].USER).then(function (res) {
|
||||
console.log(res);
|
||||
});
|
||||
this.showGreeting();
|
||||
this.router.events.forEach(function (event) {
|
||||
if (event instanceof _angular_router__WEBPACK_IMPORTED_MODULE_3__["NavigationEnd"] && event.url == _this8.router.url) {
|
||||
@@ -1026,7 +1035,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
||||
console.log(id);
|
||||
_context7.next = 3;
|
||||
return this.modalController.create({
|
||||
component: _event_detail_event_detail_page__WEBPACK_IMPORTED_MODULE_9__["EventDetailPage"],
|
||||
component: _event_detail_event_detail_page__WEBPACK_IMPORTED_MODULE_10__["EventDetailPage"],
|
||||
componentProps: {
|
||||
eventId: id
|
||||
},
|
||||
@@ -1061,7 +1070,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
||||
case 0:
|
||||
_context8.next = 2;
|
||||
return this.modalController.create({
|
||||
component: _event_detail_modal_event_detail_modal_page__WEBPACK_IMPORTED_MODULE_10__["EventDetailModalPage"],
|
||||
component: _event_detail_modal_event_detail_modal_page__WEBPACK_IMPORTED_MODULE_11__["EventDetailModalPage"],
|
||||
componentProps: {
|
||||
eventId: id
|
||||
},
|
||||
@@ -1131,11 +1140,11 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
||||
}, {
|
||||
type: src_app_services_alert_service__WEBPACK_IMPORTED_MODULE_5__["AlertService"]
|
||||
}, {
|
||||
type: _ionic_angular__WEBPACK_IMPORTED_MODULE_8__["ModalController"]
|
||||
type: _ionic_angular__WEBPACK_IMPORTED_MODULE_9__["ModalController"]
|
||||
}, {
|
||||
type: src_app_services_auth_service__WEBPACK_IMPORTED_MODULE_6__["AuthService"]
|
||||
}, {
|
||||
type: _services_processes_service__WEBPACK_IMPORTED_MODULE_11__["ProcessesService"]
|
||||
type: _services_processes_service__WEBPACK_IMPORTED_MODULE_12__["ProcessesService"]
|
||||
}];
|
||||
};
|
||||
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+11
-13
@@ -124,9 +124,7 @@ __webpack_require__.r(__webpack_exports__);
|
||||
/* harmony import */ var src_environments_environment__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! src/environments/environment */ "./src/environments/environment.ts");
|
||||
/* harmony import */ var _ionic_angular__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ionic/angular */ "./node_modules/@ionic/angular/__ivy_ngcc__/fesm2015/ionic-angular.js");
|
||||
/* harmony import */ var src_app_services_storage_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! src/app/services/storage.service */ "./src/app/services/storage.service.ts");
|
||||
/* harmony import */ var src_app_config_auth_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! src/app/config/auth-constants */ "./src/app/config/auth-constants.ts");
|
||||
/* harmony import */ var src_app_services_photo_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! src/app/services/photo.service */ "./src/app/services/photo.service.ts");
|
||||
|
||||
/* harmony import */ var src_app_services_photo_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! src/app/services/photo.service */ "./src/app/services/photo.service.ts");
|
||||
|
||||
|
||||
|
||||
@@ -167,14 +165,14 @@ let LoginPage = class LoginPage {
|
||||
yield alert.present();
|
||||
});
|
||||
}
|
||||
loginRocketChat() {
|
||||
this.authService.loginChat(this.postData).subscribe((res) => {
|
||||
this.storageService.store(src_app_config_auth_constants__WEBPACK_IMPORTED_MODULE_8__["AuthConnstants"].AUTH, res.data);
|
||||
console.log('Login to Rocket chat OK');
|
||||
}, (error) => {
|
||||
console.log('Network error');
|
||||
});
|
||||
}
|
||||
/* loginRocketChat(){
|
||||
this.authService.loginChat(this.postData).subscribe((res: any) =>{
|
||||
this.storageService.store(AuthConnstants.AUTH, res.data);
|
||||
console.log('Login to Rocket chat OK');
|
||||
},(error:any) =>{
|
||||
console.log('Network error');
|
||||
});
|
||||
} */
|
||||
Login() {
|
||||
return Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__awaiter"])(this, void 0, void 0, function* () {
|
||||
/* try { */
|
||||
@@ -188,7 +186,7 @@ let LoginPage = class LoginPage {
|
||||
BasicAuthKey: ""
|
||||
};
|
||||
if (yield this.authService.login(this.userattempt)) {
|
||||
this.loginRocketChat();
|
||||
/* this.loginRocketChat(); */
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
else {
|
||||
@@ -212,7 +210,7 @@ LoginPage.ctorParameters = () => [
|
||||
{ type: src_app_services_auth_service__WEBPACK_IMPORTED_MODULE_3__["AuthService"] },
|
||||
{ type: src_app_services_storage_service__WEBPACK_IMPORTED_MODULE_7__["StorageService"] },
|
||||
{ type: src_app_services_toast_service__WEBPACK_IMPORTED_MODULE_4__["ToastService"] },
|
||||
{ type: src_app_services_photo_service__WEBPACK_IMPORTED_MODULE_9__["PhotoService"] },
|
||||
{ type: src_app_services_photo_service__WEBPACK_IMPORTED_MODULE_8__["PhotoService"] },
|
||||
{ type: _ionic_angular__WEBPACK_IMPORTED_MODULE_6__["AlertController"] }
|
||||
];
|
||||
LoginPage = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__decorate"])([
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+17
-27
@@ -249,13 +249,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||
/* harmony import */
|
||||
|
||||
|
||||
var src_app_config_auth_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
|
||||
/*! src/app/config/auth-constants */
|
||||
"./src/app/config/auth-constants.ts");
|
||||
/* harmony import */
|
||||
|
||||
|
||||
var src_app_services_photo_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(
|
||||
var src_app_services_photo_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(
|
||||
/*! src/app/services/photo.service */
|
||||
"./src/app/services/photo.service.ts");
|
||||
|
||||
@@ -320,19 +314,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||
}, _callee, this);
|
||||
}));
|
||||
}
|
||||
}, {
|
||||
key: "loginRocketChat",
|
||||
value: function loginRocketChat() {
|
||||
var _this = this;
|
||||
|
||||
this.authService.loginChat(this.postData).subscribe(function (res) {
|
||||
_this.storageService.store(src_app_config_auth_constants__WEBPACK_IMPORTED_MODULE_8__["AuthConnstants"].AUTH, res.data);
|
||||
|
||||
/* loginRocketChat(){
|
||||
this.authService.loginChat(this.postData).subscribe((res: any) =>{
|
||||
this.storageService.store(AuthConnstants.AUTH, res.data);
|
||||
console.log('Login to Rocket chat OK');
|
||||
}, function (error) {
|
||||
},(error:any) =>{
|
||||
console.log('Network error');
|
||||
});
|
||||
}
|
||||
} */
|
||||
|
||||
}, {
|
||||
key: "Login",
|
||||
value: function Login() {
|
||||
@@ -342,7 +332,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||
switch (_context2.prev = _context2.next) {
|
||||
case 0:
|
||||
if (!this.validateInput()) {
|
||||
_context2.next = 12;
|
||||
_context2.next = 11;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -357,28 +347,28 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||
|
||||
case 4:
|
||||
if (!_context2.sent) {
|
||||
_context2.next = 9;
|
||||
_context2.next = 8;
|
||||
break;
|
||||
}
|
||||
|
||||
this.loginRocketChat();
|
||||
/* this.loginRocketChat(); */
|
||||
this.router.navigate(['/home/events']);
|
||||
_context2.next = 10;
|
||||
_context2.next = 9;
|
||||
break;
|
||||
|
||||
case 9:
|
||||
case 8:
|
||||
//this.toastService.presentToast('Não foi possível fazer login"');
|
||||
this.presentAlert('O nome de utilizador e palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar.');
|
||||
|
||||
case 10:
|
||||
_context2.next = 13;
|
||||
case 9:
|
||||
_context2.next = 12;
|
||||
break;
|
||||
|
||||
case 12:
|
||||
case 11:
|
||||
//this.toastService.presentToast('Preencha todos campos');
|
||||
this.presentAlert('Por favor, insira o seu nome de utilizador e palavra-passe.');
|
||||
|
||||
case 13:
|
||||
case 12:
|
||||
case "end":
|
||||
return _context2.stop();
|
||||
}
|
||||
@@ -401,7 +391,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
||||
}, {
|
||||
type: src_app_services_toast_service__WEBPACK_IMPORTED_MODULE_4__["ToastService"]
|
||||
}, {
|
||||
type: src_app_services_photo_service__WEBPACK_IMPORTED_MODULE_9__["PhotoService"]
|
||||
type: src_app_services_photo_service__WEBPACK_IMPORTED_MODULE_8__["PhotoService"]
|
||||
}, {
|
||||
type: _ionic_angular__WEBPACK_IMPORTED_MODULE_6__["AlertController"]
|
||||
}];
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user