This commit is contained in:
2020-06-19 22:47:57 +00:00
parent 7067e26a24
commit 70f035f90e
5 changed files with 63 additions and 213 deletions

View File

@@ -216,7 +216,7 @@ export default {
}
};
},
created() {
async created() {
let vm = this;
//------------------
//Test ui feedback mechanisms here:
@@ -242,16 +242,14 @@ export default {
icon: "",
title: ""
});
window.$gz.api
.get("notify/hello")
.then(res => {
if (res.data != null) {
vm.showEvalUsers = res.data;
}
})
.catch(function handleGetTrialModeError(error) {
//squash it, this isn't critical
});
try {
let res = await window.$gz.api.get("notify/hello");
if (res.data != null) {
vm.showEvalUsers = res.data;
}
} catch (error) {
//squash it, this isn't critical
}
},
methods: {
@@ -274,9 +272,6 @@ export default {
let vm = this;
if (vm.input.username != "" && vm.input.password != "") {
vm.errorBadCreds = false;
//auth directly bypass auth here
//==========================
let loggedInWithKnownPassword =
vm.input.username == "superuser" && vm.input.password == "l3tm3in";
@@ -347,75 +342,6 @@ export default {
return;
}
}
//==========================
//############## OLD AUTH ########################
// auth
// .authenticate(vm.input.username, vm.input.password)
// .then(() => {
// /*public enum LicenseStatus
// {
// NONE = 0,//fast track
// ActiveTrial = 1,//slow track
// ExpiredTrial = 2,//fast track
// ActivePurchased = 3,//slow track
// ExpiredPurchased = 4,//fast track
// Revoked = 5//slow track
// } */
// //check if support and updates has expired and is paid for license and show warning if so
// if (
// vm.$store.state.globalSettings.maintenanceExpired &&
// (vm.$store.state.globalSettings.licenseStatus == 3 ||
// vm.$store.state.globalSettings.licenseStatus == 4)
// ) {
// (async function() {
// await window.$gz.dialog.displayLTModalNotificationMessage(
// "MaintenanceExpiredNote",
// "MaintenanceExpired",
// "error",
// "https://www.ayanova.com/subscriptionexpired.htm"
// );
// })();
// }
// if (vm.$store.state.openObject != null) {
// window.$gz.eventBus.$emit("openobject", null);
// } else {
// vm.$router.push(vm.$store.state.homePage);
// }
// })
// .catch(function handleCaughtLoginError(error) {
// //bad creds?
// if (
// error.message &&
// error.message.includes("ErrorUserNotAuthenticated")
// ) {
// vm.errorBadCreds = true;
// return;
// }
// //server closed by server state setting?
// if (error.code == 2000 || error.code == 2001) {
// vm.formState.errorBoxMessage = error.message;
// return;
// }
// //probably here because server unresponsive.
// if (error.message) {
// let msg = error.message;
// if (
// msg.includes("NetworkError") ||
// msg.includes("Failed to fetch")
// ) {
// msg =
// "Could not connect to AyaNova server at " +
// window.$gz.api.APIUrl("") +
// "\r\nError: " +
// error.message;
// }
// vm.formState.errorBoxMessage = msg;
// return;
// }
// });
//#################################################
}
}
},

View File

@@ -429,7 +429,7 @@ export default {
try {
window.$gz.form.deleteAllErrorBoxErrors(vm);
let res = await window.$gz.api.getEx(url);
let res = await window.$gz.api.get(url);
if (res.error) {
//Not found?
@@ -523,7 +523,7 @@ export default {
let url = API_BASE_URL + vm.$route.params.recordid;
window.$gz.form.deleteAllErrorBoxErrors(vm);
let res = await window.$gz.api.removeEx(url);
let res = await window.$gz.api.remove(url);
if (res.error) {
vm.formState.serverError = res.error;
window.$gz.form.setErrorBoxErrors(vm);