fix(routing): fix store login 404 caused by CMS catch-all route priority
The CMS catch-all route /{store_code}/{slug} was registered before tenancy's
/{store_code}/login because modules are discovered alphabetically (cms before
tenancy). Also fix login.js store code extraction for /platforms/{code}/store/...
URL pattern.
- Add ROUTE_CONFIG priority=100 to CMS store pages so catch-all registers last
- Sort get_store_page_routes() by priority (matching other route getters)
- Use indexOf('store') in login.js to support platform-prefixed URLs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -39,9 +39,11 @@ function storeLogin() {
|
||||
storeLoginLog.debug('Dark mode:', this.dark);
|
||||
|
||||
// Get store code from URL path
|
||||
// Supports both /store/{code}/login and /platforms/{platform}/store/{code}/login
|
||||
const pathSegments = window.location.pathname.split('/').filter(Boolean);
|
||||
if (pathSegments[0] === 'store' && pathSegments[1]) {
|
||||
this.storeCode = pathSegments[1];
|
||||
const storeIndex = pathSegments.indexOf('store');
|
||||
if (storeIndex !== -1 && pathSegments[storeIndex + 1]) {
|
||||
this.storeCode = pathSegments[storeIndex + 1];
|
||||
storeLoginLog.debug('Store code from URL:', this.storeCode);
|
||||
await this.loadStore();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user