mirror of
https://github.com/EvolutionAPI/evolution-manager.git
synced 2025-12-24 05:07:44 -06:00
version 0.4.0 prepare to evolution-api
This commit is contained in:
@@ -141,6 +141,8 @@
|
||||
import { useAppStore } from "@/store/app";
|
||||
import AboutModal from "./About.vue";
|
||||
import ShareConnection from "./ShareConnection.vue";
|
||||
const BASE_URL = import.meta.env.BASE_URL;
|
||||
|
||||
export default {
|
||||
components: { AboutModal, ShareConnection },
|
||||
name: "SettingsModal",
|
||||
@@ -149,7 +151,7 @@ export default {
|
||||
valid: false,
|
||||
revelPassword: false,
|
||||
connection: {
|
||||
host: "",
|
||||
host: BASE_URL ? window.location.origin : "",
|
||||
globalApiKey: "",
|
||||
},
|
||||
loading: false,
|
||||
@@ -161,7 +163,6 @@ export default {
|
||||
share() {
|
||||
const connection = Object.assign({}, this.AppStore.connection);
|
||||
this.$refs.share.open(connection);
|
||||
|
||||
},
|
||||
logout() {
|
||||
this.AppStore.logout();
|
||||
@@ -192,6 +193,8 @@ export default {
|
||||
open() {
|
||||
this.dialog = true;
|
||||
this.connection = Object.assign({}, this.AppStore.connection);
|
||||
if (!this.connection.host && BASE_URL.startsWith("/manager"))
|
||||
this.connection.host = window.location.origin;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
|
||||
@@ -77,9 +77,14 @@ export default {
|
||||
},
|
||||
},
|
||||
async mounted() {
|
||||
const urlConnection = await this.loadConnectionFromUrl();
|
||||
if (!urlConnection) await this.AppStore.loadConnection();
|
||||
if (!this.AppStore.validConnection) this.openSettings();
|
||||
try {
|
||||
const urlConnection = await this.loadConnectionFromUrl();
|
||||
if (!urlConnection) await this.AppStore.loadConnection();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} finally {
|
||||
if (!this.AppStore.validConnection) this.openSettings();
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user