Fix bit(1) import coercion and subpath login redirect; add GitHub export script
Loader: bool() on pymysql bit(1) bytes is always true - isinstallable and isshopfloor imported as 1 for every row; route through _truthy_bit. The employee source DB is now optional (shopdb-only imports). Frontend: under a subpath mount the 401 interceptor stored the browser path (mount base included) as the login redirect and the router applied its base again (/ops/ops). New stripBase() keeps redirects base-free. tools/export-github.sh automates the publication flow: prune + scrub + commit into ~/projects/shopdb-flask-pub and emit a transfer bundle.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import axios from 'axios'
|
||||
import { withBase } from './../utils/basePath'
|
||||
import { withBase, stripBase } from './../utils/basePath'
|
||||
|
||||
// BASE_URL ends in '/', so this is '/api' at root or '/ops/api' under a subpath
|
||||
// mount. Keeps the SPA, its API, and IIS all on the same mount path.
|
||||
@@ -35,8 +35,10 @@ api.interceptors.response.use(
|
||||
// Preserve the destination so login returns the user to this page.
|
||||
if (hadToken) {
|
||||
const loginPath = withBase('/login')
|
||||
const here = window.location.pathname + window.location.search
|
||||
const target = here && here !== loginPath
|
||||
// Router paths exclude the mount base; strip it or login's
|
||||
// router.push double-prefixes under a subpath mount.
|
||||
const here = stripBase(window.location.pathname) + window.location.search
|
||||
const target = here && here !== '/login'
|
||||
? loginPath + '?redirect=' + encodeURIComponent(here)
|
||||
: loginPath
|
||||
window.location.href = target
|
||||
|
||||
Reference in New Issue
Block a user