mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
solved unauthorized rockect chat url
This commit is contained in:
+1
-2
@@ -84,8 +84,7 @@
|
|||||||
"serve": {
|
"serve": {
|
||||||
"builder": "@angular-devkit/build-angular:dev-server",
|
"builder": "@angular-devkit/build-angular:dev-server",
|
||||||
"options": {
|
"options": {
|
||||||
"browserTarget": "app:build",
|
"browserTarget": "app:build"
|
||||||
"proxyConfig": "proxy.config.json"
|
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
|
|||||||
@@ -108,8 +108,8 @@ export class HomePage implements OnInit {
|
|||||||
// console.log('Active route ', this.router.url)
|
// console.log('Active route ', this.router.url)
|
||||||
|
|
||||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
this.webnotification.webconnection();
|
/* this.webnotification.webconnection();
|
||||||
this.webnotification.onReceviNotificationWeb();
|
this.webnotification.onReceviNotificationWeb(); */
|
||||||
} else {
|
} else {
|
||||||
this.mobilefirstConnect();
|
this.mobilefirstConnect();
|
||||||
this.notificationsService.getAndpostToken2();
|
this.notificationsService.getAndpostToken2();
|
||||||
|
|||||||
@@ -102,6 +102,8 @@ export class AuthService {
|
|||||||
console.log('Login to Rocket chat OK');
|
console.log('Login to Rocket chat OK');
|
||||||
this.ValidatedUserChat = responseChat;
|
this.ValidatedUserChat = responseChat;
|
||||||
localStorage.setItem('userChat', JSON.stringify(responseChat));
|
localStorage.setItem('userChat', JSON.stringify(responseChat));
|
||||||
|
localStorage.setItem('Meteor.loginToken', JSON.stringify(responseChat['data'].userId));
|
||||||
|
localStorage.setItem('Meteor.userId', JSON.stringify(responseChat['data'].authToken));
|
||||||
this.storageService.store(AuthConnstants.AUTH, responseChat);
|
this.storageService.store(AuthConnstants.AUTH, responseChat);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import { Storage } from '@ionic/storage';
|
|||||||
import { Message } from 'src/app/models/message.model';
|
import { Message } from 'src/app/models/message.model';
|
||||||
import { Observable, Subject } from "rxjs/Rx";
|
import { Observable, Subject } from "rxjs/Rx";
|
||||||
import { WebsocketService } from './websocket.service';
|
import { WebsocketService } from './websocket.service';
|
||||||
import { FileService } from './functions/file.service';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@@ -32,7 +31,6 @@ export class ChatService {
|
|||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private storage: Storage,
|
private storage: Storage,
|
||||||
private storageService:StorageService,
|
private storageService:StorageService,
|
||||||
private fileService: FileService,
|
|
||||||
//private wsService: WebsocketService,
|
//private wsService: WebsocketService,
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@@ -63,7 +61,7 @@ export class ChatService {
|
|||||||
};
|
};
|
||||||
let fullUrl = "https://www.tabularium.pt/" + url;
|
let fullUrl = "https://www.tabularium.pt/" + url;
|
||||||
return this.http.get(fullUrl, optionsc).subscribe(()=>{
|
return this.http.get(fullUrl, optionsc).subscribe(()=>{
|
||||||
this.fileService.viewDocumentByUrl(url)
|
//this.fileService.viewDocumentByUrl(url)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ export class FileService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
viewDocumentByUrl(url) {
|
viewDocumentByUrl(url) {
|
||||||
const browser = this.iab.create(url,"_blank");
|
const browser = this.iab.create(url,"_parent");
|
||||||
browser.show();
|
browser.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="file">
|
<div class="file">
|
||||||
<!-- <canvas id="pdf_canvas"></canvas> -->
|
<!-- <canvas id="pdf_canvas"></canvas> -->
|
||||||
<div (click)="viewDocument(file.title_link)" class="file-details add-ellipsis" *ngIf="msg.file">
|
<div (click)="viewDocument(file.title_link, msg.file.type)" class="file-details add-ellipsis" *ngIf="msg.file">
|
||||||
<span *ngIf="msg.file.type" class="cursor-pointer">
|
<span *ngIf="msg.file.type" class="cursor-pointer">
|
||||||
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
||||||
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
|
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import { ChatMessageStore } from 'src/app/store/chat/chat-message.service';
|
|||||||
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
|
import { ChatUserStorage } from 'src/app/store/chat/chat-user.service';
|
||||||
import { TimeService } from 'src/app/services/functions/time.service';
|
import { TimeService } from 'src/app/services/functions/time.service';
|
||||||
import { FileService } from 'src/app/services/functions/file.service';
|
import { FileService } from 'src/app/services/functions/file.service';
|
||||||
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-messages',
|
selector: 'app-messages',
|
||||||
@@ -68,6 +69,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
private timeService: TimeService,
|
private timeService: TimeService,
|
||||||
private fileService: FileService,
|
private fileService: FileService,
|
||||||
private gestureController: GestureController,
|
private gestureController: GestureController,
|
||||||
|
private http:HttpClient,
|
||||||
) {
|
) {
|
||||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||||
|
|
||||||
@@ -239,11 +241,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
viewDocument(url:string){
|
viewDocument(url:string, documentType?:string){
|
||||||
this.fileService.viewDocumentByUrl(url);
|
if(documentType == "application/webtrix"){
|
||||||
/* this.chatService.getDocumentDetails(url).subscribe(res => {
|
this.fileService.viewDocumentByUrl(url);
|
||||||
console.log(res);
|
}
|
||||||
}) */
|
else{
|
||||||
|
let fullUrl = "https://www.tabularium.pt" + url;
|
||||||
|
this.fileService.viewDocumentByUrl(fullUrl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getChatMembers() {
|
getChatMembers() {
|
||||||
|
|||||||
+5
-5
@@ -7,13 +7,13 @@
|
|||||||
|
|
||||||
<base href="/" />
|
<base href="/" />
|
||||||
|
|
||||||
<script type="text/javascript" src="node_modules/ibm-mfp-web-sdk/ibmmfpfanalytics.js"></script>
|
<!-- <script type="text/javascript" src="node_modules/ibm-mfp-web-sdk/ibmmfpfanalytics.js"></script>
|
||||||
<script type="text/javascript" src="node_modules/ibm-mfp-web-sdk/ibmmfpf.js"></script>
|
<script type="text/javascript" src="node_modules/ibm-mfp-web-sdk/ibmmfpf.js"></script> -->
|
||||||
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.9.359/pdf.min.js" integrity="sha512-U5C477Z8VvmbYAoV4HDq17tf4wG6HXPC6/KM9+0/wEXQQ13gmKY2Zb0Z2vu0VNUWch4GlJ+Tl/dfoLOH4i2msw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.9.359/pdf.min.js" integrity="sha512-U5C477Z8VvmbYAoV4HDq17tf4wG6HXPC6/KM9+0/wEXQQ13gmKY2Zb0Z2vu0VNUWch4GlJ+Tl/dfoLOH4i2msw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||||
<!-- <script src="assets/js/index.js"></script> -->
|
<!-- <script src="assets/js/index.js"></script> -->
|
||||||
<script src="assets/js/wldirectudpate.js"></script>
|
<!-- <script src="assets/js/wldirectudpate.js"></script> -->
|
||||||
|
|
||||||
<script>
|
<!-- <script>
|
||||||
if (navigator.serviceWorker) {
|
if (navigator.serviceWorker) {
|
||||||
navigator.serviceWorker.register("assets/js/MFPPushServiceWorker.js").then(function(reg) {
|
navigator.serviceWorker.register("assets/js/MFPPushServiceWorker.js").then(function(reg) {
|
||||||
window.pushReg = reg;
|
window.pushReg = reg;
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
} else {
|
} else {
|
||||||
console.info("Service workers aren't supported in this browser.");
|
console.info("Service workers aren't supported in this browser.");
|
||||||
}
|
}
|
||||||
</script>
|
</script> -->
|
||||||
|
|
||||||
<meta name="color-scheme" content="light dark" />
|
<meta name="color-scheme" content="light dark" />
|
||||||
<meta name="viewport" content="viewport-fit=cover, width=device-width, height=device-hight, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
<meta name="viewport" content="viewport-fit=cover, width=device-width, height=device-hight, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||||
|
|||||||
Reference in New Issue
Block a user