This commit is contained in:
2019-07-24 14:55:13 +00:00
parent 9389035bb9
commit 604fe1dd72
3 changed files with 8 additions and 8 deletions

View File

@@ -1,18 +1,18 @@
/* Xeslint-disable */
import gzapi from "./gzapi";
import { processLogin, processLogout } from "./authutil";
export default {
async authenticate(login, password) {
return fetch(
gzapi.APIUrl("auth"),
gzapi.fetchPostNoAuthOptions({
window.$gz.api.APIUrl("auth"),
window.$gz.api.fetchPostNoAuthOptions({
login: login,
password: password
})
)
.then(gzapi.status)
.then(gzapi.json)
.then(window.$gz.api.status)
.then(window.$gz.api.json)
.then(processLogin)
.then(() => {
return Promise.resolve(true);

View File

@@ -1,5 +1,5 @@
/* xeslint-disable */
import _ from "../libs/lodash.min.js";
import store from "../store";
import rights from "./bizroles";
@@ -72,7 +72,7 @@ export default {
var ret = this.defaultRightsObject();
//Get the type name from the type enum value
var typeName = _.findKey(window.$gz.type, function(o) {
var typeName = window.$gz._.findKey(window.$gz.type, function(o) {
return o == oType;
});

View File

@@ -40,7 +40,7 @@ import errorhandler from "./api/errorhandler";
// LIBS AND GLOBAL ITEMS
// (https://medium.com/js-dojo/use-any-javascript-library-with-vue-js-3f7e2a4974a8)
//
todo: Now that all is in Window.$gz Look for unnecessary local imports of global libs (search for import and see what comes up)
//todo: Now that all is in Window.$gz Look for unnecessary local imports of global libs (search for import and see what comes up)
//then modify the inventory-widget-edit form initialization shit so that the stuff needed after form loads still happens but the before is moved to route before enter and that it's all called
//with two separate methods: One standard one for init form before it is loaded and one for init form stuff for after it's loaded. BeforeLoadInit, AfterLoadInit or something
window.$gz = {