mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Merge branch 'feature/websocket' of https://bitbucket.org/equilibriumito/gabinete-digital into feature/websocket
This commit is contained in:
@@ -10,10 +10,7 @@ import { AlertController } from '@ionic/angular';
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { AESEncrypt } from '../services/aesencrypt.service';
|
||||
import { CookieService } from 'ngx-cookie-service';
|
||||
import { RocketChatClientService } from '../services/socket/rocket-chat-client.service';
|
||||
import { ChatService } from './chat.service';
|
||||
import { WebsocketService } from './websocket.service';
|
||||
|
||||
import { WsChatService } from 'src/app/services/chat/ws-chat.service';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -34,8 +31,7 @@ export class AuthService {
|
||||
public alertController: AlertController,
|
||||
private aesencrypt: AESEncrypt,
|
||||
private cookieService: CookieService,
|
||||
private wsService: WebsocketService,
|
||||
private RocketChatClientService: RocketChatClientService) {
|
||||
private WsChatService: WsChatService) {
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
|
||||
@@ -43,9 +39,9 @@ export class AuthService {
|
||||
this.ValidatedUser = SessionStore.user
|
||||
|
||||
console.log('login', SessionStore.user.RochetChatUser, SessionStore.user.Password)
|
||||
this.RocketChatClientService.connect(()=>{
|
||||
this.WsChatService.connect(()=>{
|
||||
|
||||
this.RocketChatClientService.login({
|
||||
this.WsChatService.login({
|
||||
username: SessionStore.user.RochetChatUser,
|
||||
password: SessionStore.user.Password
|
||||
}).then((message) => {
|
||||
@@ -114,22 +110,6 @@ export class AuthService {
|
||||
this.ValidatedUser = null;
|
||||
}
|
||||
|
||||
loginWsChat(){
|
||||
let msg = {
|
||||
"msg": "method",
|
||||
"method": "login",
|
||||
"id":"42",
|
||||
"params":[
|
||||
{
|
||||
"user": { "username": "paulo.pinto" },
|
||||
"password": "tabteste@006"
|
||||
}
|
||||
]
|
||||
}
|
||||
this.wsService.messages.next(msg);
|
||||
this.isWsAuthenticated = true;
|
||||
}
|
||||
|
||||
//Login to rocketChat server
|
||||
async loginChat(user: UserForm): Promise<boolean> {
|
||||
let postData = {
|
||||
@@ -138,9 +118,9 @@ export class AuthService {
|
||||
}
|
||||
|
||||
|
||||
/* this.RocketChatClientService.connect(()=>{
|
||||
this.WsChatService.connect(()=>{
|
||||
|
||||
this.RocketChatClientService.login({
|
||||
this.WsChatService.login({
|
||||
username: SessionStore.user.RochetChatUser,
|
||||
password: user.password
|
||||
}).then((message) => {
|
||||
@@ -150,7 +130,7 @@ export class AuthService {
|
||||
}).finally(()=>{
|
||||
})
|
||||
|
||||
}) */
|
||||
})
|
||||
|
||||
|
||||
let responseChat = await this.httpService.post('login', postData).toPromise();
|
||||
|
||||
Reference in New Issue
Block a user