did I crack the base href thing? Probably not

pull/3895/head
tidusjar 5 years ago
parent 6e123f1dc4
commit 94b103f4d4

@ -38,6 +38,7 @@ export class AppComponent implements OnInit {
private checkedForUpdate: boolean;
private hubConnected: boolean;
@HostBinding('class') public componentCssClass;
@ -54,10 +55,9 @@ export class AppComponent implements OnInit {
private signalrNotification: SignalRNotificationService,
private readonly snackBar: MatSnackBar) {
const base = '/' + (window.location.pathname.split('/')[1] || '');
if (base.length > 1) {
__webpack_public_path__ = base + "/dist/";
}
// __webpack_public_path__ = window['base-href']
this.translate.addLangs(["en", "de", "fr", "da", "es", "it", "nl", "sv", "no", "pl", "pt"]);

@ -79,6 +79,8 @@ const routes: Routes = [
{ loadChildren: () => import("./user-preferences/user-preferences.module").then(m => m.UserPreferencesModule), path: "user-preferences" },
];
// AoT requires an exported function for factories
export function HttpLoaderFactory(http: HttpClient, platformLocation: PlatformLocation) {
// const base = getBaseLocation();
@ -181,7 +183,7 @@ export function JwtTokenGetter() {
SignalRNotificationService,
{
provide: APP_BASE_HREF,
useValue: '/' + (window.location.pathname.split('/')[1] || '')
useValue: window["baseHref"]
}
],
bootstrap: [AppComponent],

@ -4,8 +4,14 @@
<head>
<script>
var base = "/"+ (window.location.pathname.split('/')[1] || '');
//document.write("<base href='" + base + "' />");
var base = "/";
var locations = window.location.pathname.split('/');
if(locations[1] !== 'login' && locations[1] !== 'discover') {
base = "/" + locations[1];
}
document.write("<base href='" + base + "' />");
window["baseHref"] = base;
console.log(base);
</script>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">

@ -17,7 +17,9 @@ import { AppModule } from "./app/app.module";
import { hmrBootstrap } from "./hmr";
declare var module: any;
// declare var __webpack_require__: any;
// __webpack_require__.p = '/ombi';
// __webpack_require__ = '/ombi';
if (environment.production) {
enableProdMode();
}

@ -1,6 +1,5 @@
// Globals
declare var __webpack_public_path__: any;
// declare module "*.json" {
// const value: any;
// export default value;

Loading…
Cancel
Save