You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
819 B
26 lines
819 B
3 years ago
|
|
||
|
export class SignalRAspNetCoreHelper {
|
||
|
static initSignalR(callback?: () => void): void {
|
||
|
const encryptedAuthToken = sessionStorage.getItem("encryptedAccessToken");
|
||
|
let url = "http://39.106.78.171:8906";
|
||
|
abp.signalr = {
|
||
|
autoConnect: true,
|
||
|
connect: undefined,
|
||
|
hubs: undefined,
|
||
|
qs: "enc_auth_token" + '=' + encodeURIComponent(encryptedAuthToken),
|
||
|
remoteServiceBaseUrl: url,
|
||
|
startConnection: undefined,
|
||
|
url: '/signalr'
|
||
|
};
|
||
|
|
||
|
const script = document.createElement('script');
|
||
|
if (callback) {
|
||
|
script.onload = () => {
|
||
|
callback();
|
||
|
};
|
||
|
}
|
||
|
script.src = '/assets/js/abp.signalr-client.js';
|
||
|
document.head.appendChild(script);
|
||
|
}
|
||
|
}
|