add server settings for cordova
This commit is contained in:
parent
d396940071
commit
797f7dd67a
|
@ -13,6 +13,7 @@
|
|||
"@quasar/extras": "^1.9.10",
|
||||
"@vue/composition-api": "^0.6.4",
|
||||
"axios": "^0.21.0",
|
||||
"cordova": "^10.0.0",
|
||||
"core-js": "^3.7.0",
|
||||
"quasar": "^1.14.5",
|
||||
"vue-router": "3.3.2"
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -13,6 +13,7 @@
|
|||
"author": "Apache Cordova Team",
|
||||
"license": "Apache-2.0",
|
||||
"devDependencies": {
|
||||
"cordova-android": "^9.0.0",
|
||||
"cordova-ios": "^6.1.1",
|
||||
"cordova-plugin-whitelist": "^1.3.4"
|
||||
},
|
||||
|
@ -21,7 +22,8 @@
|
|||
"cordova-plugin-whitelist": {}
|
||||
},
|
||||
"platforms": [
|
||||
"ios"
|
||||
"ios",
|
||||
"android"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -10,6 +10,10 @@ declare module 'vue/types/vue' {
|
|||
}
|
||||
}
|
||||
|
||||
export const setBaseUrl = (url: string) => {
|
||||
axios.defaults.baseURL = url;
|
||||
}
|
||||
|
||||
export default boot<Store<StateInterface>>(({ Vue, store, router }) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
Vue.prototype.$axios = axios;
|
||||
|
|
|
@ -36,6 +36,16 @@
|
|||
</div>
|
||||
</q-form>
|
||||
</q-card-section>
|
||||
<q-card-section>
|
||||
<q-separator class="q-mt-sm"/>
|
||||
<div class="cordova-only q-my-sm">
|
||||
<div class="text-h6">Serversettings</div>
|
||||
<q-input filled label="Server" dense v-model="server" />
|
||||
</div>
|
||||
</q-card-section>
|
||||
<q-card-actions align="right">
|
||||
<q-btn dense color="primary" label="Speichern" @click="changeUrl" />
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-page>
|
||||
</template>
|
||||
|
@ -43,6 +53,7 @@
|
|||
<script lang="ts">
|
||||
import { defineComponent, ref } from '@vue/composition-api';
|
||||
import { Loading, Notify } from 'quasar';
|
||||
import { setBaseUrl } from 'boot/axios';
|
||||
|
||||
export default defineComponent({
|
||||
// name: 'PageName'
|
||||
|
@ -53,6 +64,13 @@ export default defineComponent({
|
|||
const userid = ref('');
|
||||
const password = ref('');
|
||||
const rules = [(val: string) => (val && val.length > 0) || 'Feld darf nicht leer sein!'];
|
||||
const server = ref<string|undefined>(root.$axios.defaults.baseURL)
|
||||
|
||||
function changeUrl() {
|
||||
if (server.value) {
|
||||
setBaseUrl(server.value)
|
||||
}
|
||||
}
|
||||
|
||||
function doLogin() {
|
||||
Loading.show({
|
||||
|
@ -116,7 +134,7 @@ export default defineComponent({
|
|||
});
|
||||
}
|
||||
|
||||
return { userid, password, doLogin, doReset, rules };
|
||||
return { userid, password, doLogin, doReset, rules, server, changeUrl };
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue