-
I am trying to fetch data via POST. This works fine in dev and tauri dev, but as soon as the whole thing runs in a finished build, nothing comes. [✔] Environment [-] Packages [-] App This is my VUE component: <template>
<div>
<p v-for="ma in Daten" :key="ma.pers_nr">
{{ ma.name }}
</p>
</div>
</template>
<script>
export default {
data() {
return {
Daten: [],
};
},
created() {
this.AlleMitarbeiter("KT", "A");
},
methods: {
AlleMitarbeiter: function (Abteilung, pg_ken) {
const postData = new FormData();
postData.append("action", "AlleMitarbeiter");
postData.append("Abteilung", Abteilung);
postData.append("pg_ken", pg_ken);
fetch("http://192.168.xxxxxxxxxx/Aktion.php", {
method: "POST",
body: postData,
})
.then((response) => {
return response.text();
})
.then((data) => {
this.Daten = JSON.parse(data);
console.log(this.Daten);
});
},
},
};
</script> The following error message comes up in the build:
The whole thing is running on the local network. How can I allow http? Thanks already for your help Greetings Himra |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
This is our main tracking issue for this: #3007 If you can't use tauri's http module instead of the webview's native fetch then the only workaround currently is to use the localhost plugin (which exposes your whole frontend on localhost :/ ) |
Beta Was this translation helpful? Give feedback.
Hello @FabianLars,
that was the tip which helped me.
Now also without https on the network server
The following is running in my build: