Login bug fix for OOP and module bundling architecture complete.
This commit is contained in:
Binary file not shown.
@@ -27,7 +27,7 @@ from business_objects.store.stock_item import Stock_Item, Stock_Item_Filters
|
|||||||
from business_objects.user import User, User_Filters, User_Permission_Evaluation
|
from business_objects.user import User, User_Filters, User_Permission_Evaluation
|
||||||
from business_objects.store.product_variation import Product_Variation, Product_Variation_Filters, Product_Variation_List
|
from business_objects.store.product_variation import Product_Variation, Product_Variation_Filters, Product_Variation_List
|
||||||
from datastores.datastore_base import DataStore_Base
|
from datastores.datastore_base import DataStore_Base
|
||||||
# from helpers.helper_db_mysql import Helper_DB_MySQL
|
from helpers.helper_db_mysql import Helper_DB_MySQL
|
||||||
# from models.model_view_store_checkout import Model_View_Store_Checkout # circular!
|
# from models.model_view_store_checkout import Model_View_Store_Checkout # circular!
|
||||||
from extensions import db
|
from extensions import db
|
||||||
# external
|
# external
|
||||||
|
|||||||
2
static/dist/js/main.bundle.js
vendored
2
static/dist/js/main.bundle.js
vendored
File diff suppressed because one or more lines are too long
@@ -40,18 +40,19 @@ export default class API {
|
|||||||
if (hash == null) hash = hashPageHome;
|
if (hash == null) hash = hashPageHome;
|
||||||
console.log("getUrlFromHash:");
|
console.log("getUrlFromHash:");
|
||||||
console.log("base url: " + _pathHost + "\nhash: " + hash + '\nparams: ' + params);
|
console.log("base url: " + _pathHost + "\nhash: " + hash + '\nparams: ' + params);
|
||||||
let url = _pathHost + hash;
|
let url = API.parameteriseUrl(_pathHost + hash, params);
|
||||||
if (params) {
|
|
||||||
url += '?' + new URLSearchParams(params).toString();
|
|
||||||
}
|
|
||||||
console.log("url: " + url);
|
console.log("url: " + url);
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
static parameteriseUrl(url, params) {
|
||||||
|
if (params) {
|
||||||
|
url += '?' + new URLSearchParams(params).toString();
|
||||||
|
}
|
||||||
|
return url;
|
||||||
|
}
|
||||||
static goToUrl(url) {
|
static goToUrl(url) {
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
|
|
||||||
static goToHash(hash, params = null) {
|
static goToHash(hash, params = null) {
|
||||||
const url = API.getUrlFromHash(hash, params);
|
const url = API.getUrlFromHash(hash, params);
|
||||||
API.goToUrl(url);
|
API.goToUrl(url);
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ export default class BasePage {
|
|||||||
console.log('sending data to user login controller: ');
|
console.log('sending data to user login controller: ');
|
||||||
console.log(dataRequest);
|
console.log(dataRequest);
|
||||||
*/
|
*/
|
||||||
|
// let page = this;
|
||||||
API.loginUser()
|
API.loginUser()
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
if (response.Success) {
|
if (response.Success) {
|
||||||
|
|||||||
@@ -179,6 +179,12 @@ export default class Router {
|
|||||||
const pageCurrent = new ClassPageCurrent(this);
|
const pageCurrent = new ClassPageCurrent(this);
|
||||||
pageCurrent.leave();
|
pageCurrent.leave();
|
||||||
}
|
}
|
||||||
|
navigateToUrl(url, data = null, appendHistory = true) {
|
||||||
|
this.beforeLeave();
|
||||||
|
if (appendHistory) history.pushState(data, '', url);
|
||||||
|
url = API.parameteriseUrl(url, data);
|
||||||
|
API.goToUrl(url);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
static getPages() {
|
static getPages() {
|
||||||
@@ -222,12 +228,6 @@ export default class Router {
|
|||||||
this.navigateToUrl(url, data);
|
this.navigateToUrl(url, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
navigateToUrl(url, data = null, appendHistory = true) {
|
|
||||||
this.leavePageCurrent();
|
|
||||||
if (appendHistory) history.pushState(data, '', url);
|
|
||||||
url = Router.parameteriseUrl(url, data);
|
|
||||||
Router.#goToUrl(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
leavePageCurrent() {
|
leavePageCurrent() {
|
||||||
const pageCurrent = Router.getPageCurrent();
|
const pageCurrent = Router.getPageCurrent();
|
||||||
|
|||||||
Reference in New Issue
Block a user