mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-27 07:58:45 -07:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| baa17c0fd6 | |||
| 307ce93646 |
@@ -11,6 +11,9 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- 'v1-march-*'
|
- 'v1-march-*'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write # create the GitHub release + upload assets
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
|||||||
@@ -1,6 +1,20 @@
|
|||||||
import { clearSession, getToken, notifyAuthChange } from './auth';
|
import { clearSession, getToken, notifyAuthChange } from './auth';
|
||||||
|
|
||||||
const API_BASE = '/api/admin/v1';
|
const API_BASE = adminApiBase();
|
||||||
|
|
||||||
|
function adminApiBase(): string {
|
||||||
|
if (typeof window === 'undefined') return '/api/admin/v1';
|
||||||
|
|
||||||
|
const marker = '/__dn/admin';
|
||||||
|
const path = window.location.pathname;
|
||||||
|
const lower = path.toLowerCase();
|
||||||
|
const markerAt = lower.indexOf(marker);
|
||||||
|
if (markerAt >= 0) {
|
||||||
|
return path.slice(0, markerAt + marker.length) + '/api/admin/v1';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '/api/admin/v1';
|
||||||
|
}
|
||||||
|
|
||||||
export class ApiError extends Error {
|
export class ApiError extends Error {
|
||||||
constructor(public status: number, message: string, public body?: unknown) {
|
constructor(public status: number, message: string, public body?: unknown) {
|
||||||
|
|||||||
Reference in New Issue
Block a user