This commit is contained in:
@@ -276,6 +276,22 @@ export default {
|
||||
window.$gz.eventBus.$off();
|
||||
},
|
||||
mounted() {
|
||||
//Open object after login?
|
||||
if (window.location.search) {
|
||||
//https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams
|
||||
var searchParams = new URLSearchParams(window.location.search);
|
||||
var openObject = {};
|
||||
//data should be format for open-object-handler
|
||||
// { type: [AYATYPE], id: [RECORDID] }
|
||||
if (searchParams.has("type")) {
|
||||
openObject.type = searchParams.get("type");
|
||||
if (searchParams.has("id")) {
|
||||
openObject.type = searchParams.get("id");
|
||||
}
|
||||
window.$gz.store.commit("setOpenObject", openObject);
|
||||
}
|
||||
}
|
||||
|
||||
this.$root.$gzconfirm = this.$refs.gzconfirm.open;
|
||||
this.$root.$gznotify = this.$refs.gznotify.addNotification;
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ Vue.use(Vuex);
|
||||
export default new Vuex.Store({
|
||||
plugins: [createPersistedState()],
|
||||
state: {
|
||||
openObject: {},
|
||||
lastClientVersion: "",
|
||||
authenticated: false,
|
||||
apiUrl: "",
|
||||
@@ -122,6 +123,11 @@ export default new Vuex.Store({
|
||||
},
|
||||
setHomePage(state, data) {
|
||||
state.homePage = data;
|
||||
},
|
||||
setOpenObject(state, data) {
|
||||
//data should be format for open-object-handler
|
||||
// { type: [AYATYPE], id: [RECORDID] }
|
||||
state.openObject = data;
|
||||
}
|
||||
},
|
||||
actions: {}
|
||||
|
||||
Reference in New Issue
Block a user