Mobile
This commit is contained in:
@@ -60,5 +60,10 @@
|
|||||||
</array>
|
</array>
|
||||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
<true/>
|
<true/>
|
||||||
|
<key>NSAppTransportSecurity</key>
|
||||||
|
<dict>
|
||||||
|
<key>NSAllowsArbitraryLoads</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ install! 'cocoapods', :disable_input_output_paths => true
|
|||||||
def capacitor_pods
|
def capacitor_pods
|
||||||
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
|
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
|
||||||
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
|
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
|
||||||
|
pod 'CapacitorBrowser', :path => '../../node_modules/@capacitor/browser'
|
||||||
pod 'CapacitorDevice', :path => '../../node_modules/@capacitor/device'
|
pod 'CapacitorDevice', :path => '../../node_modules/@capacitor/device'
|
||||||
pod 'CapacitorNetwork', :path => '../../node_modules/@capacitor/network'
|
pod 'CapacitorNetwork', :path => '../../node_modules/@capacitor/network'
|
||||||
pod 'CapacitorPreferences', :path => '../../node_modules/@capacitor/preferences'
|
pod 'CapacitorPreferences', :path => '../../node_modules/@capacitor/preferences'
|
||||||
@@ -24,7 +25,15 @@ target 'App' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
post_install do |installer|
|
post_install do |installer|
|
||||||
assertDeploymentTarget(installer)
|
installer.pods_project.targets.each do |target|
|
||||||
|
target.build_configurations.each do |config|
|
||||||
|
# iOS Deployment Target erzwingen
|
||||||
|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
|
||||||
|
|
||||||
|
# Alle Warnungen auf inherited setzen, falls Pods Dinge überschreiben
|
||||||
|
config.build_settings['CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER'] = '$(inherited)'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
target 'OneSignalNotificationServiceExtension' do
|
target 'OneSignalNotificationServiceExtension' do
|
||||||
|
|||||||
@@ -1,105 +0,0 @@
|
|||||||
PODS:
|
|
||||||
- Capacitor (7.1.0):
|
|
||||||
- CapacitorCordova
|
|
||||||
- CapacitorCordova (7.1.0)
|
|
||||||
- CapacitorDevice (7.0.0):
|
|
||||||
- Capacitor
|
|
||||||
- CapacitorNetwork (7.0.0):
|
|
||||||
- Capacitor
|
|
||||||
- CapacitorPluginSafeArea (4.0.0):
|
|
||||||
- Capacitor
|
|
||||||
- CapacitorPreferences (6.0.3):
|
|
||||||
- Capacitor
|
|
||||||
- CordovaPluginsStatic (7.1.0):
|
|
||||||
- CapacitorCordova
|
|
||||||
- OneSignalXCFramework (= 5.2.10)
|
|
||||||
- OneSignalXCFramework (5.2.10):
|
|
||||||
- OneSignalXCFramework/OneSignalComplete (= 5.2.10)
|
|
||||||
- OneSignalXCFramework/OneSignal (5.2.10):
|
|
||||||
- OneSignalXCFramework/OneSignalCore
|
|
||||||
- OneSignalXCFramework/OneSignalExtension
|
|
||||||
- OneSignalXCFramework/OneSignalLiveActivities
|
|
||||||
- OneSignalXCFramework/OneSignalNotifications
|
|
||||||
- OneSignalXCFramework/OneSignalOSCore
|
|
||||||
- OneSignalXCFramework/OneSignalOutcomes
|
|
||||||
- OneSignalXCFramework/OneSignalUser
|
|
||||||
- OneSignalXCFramework/OneSignalComplete (5.2.10):
|
|
||||||
- OneSignalXCFramework/OneSignal
|
|
||||||
- OneSignalXCFramework/OneSignalInAppMessages
|
|
||||||
- OneSignalXCFramework/OneSignalLocation
|
|
||||||
- OneSignalXCFramework/OneSignalCore (5.2.10)
|
|
||||||
- OneSignalXCFramework/OneSignalExtension (5.2.10):
|
|
||||||
- OneSignalXCFramework/OneSignalCore
|
|
||||||
- OneSignalXCFramework/OneSignalOutcomes
|
|
||||||
- OneSignalXCFramework/OneSignalInAppMessages (5.2.10):
|
|
||||||
- OneSignalXCFramework/OneSignalCore
|
|
||||||
- OneSignalXCFramework/OneSignalNotifications
|
|
||||||
- OneSignalXCFramework/OneSignalOSCore
|
|
||||||
- OneSignalXCFramework/OneSignalOutcomes
|
|
||||||
- OneSignalXCFramework/OneSignalUser
|
|
||||||
- OneSignalXCFramework/OneSignalLiveActivities (5.2.10):
|
|
||||||
- OneSignalXCFramework/OneSignalCore
|
|
||||||
- OneSignalXCFramework/OneSignalOSCore
|
|
||||||
- OneSignalXCFramework/OneSignalUser
|
|
||||||
- OneSignalXCFramework/OneSignalLocation (5.2.10):
|
|
||||||
- OneSignalXCFramework/OneSignalCore
|
|
||||||
- OneSignalXCFramework/OneSignalNotifications
|
|
||||||
- OneSignalXCFramework/OneSignalOSCore
|
|
||||||
- OneSignalXCFramework/OneSignalUser
|
|
||||||
- OneSignalXCFramework/OneSignalNotifications (5.2.10):
|
|
||||||
- OneSignalXCFramework/OneSignalCore
|
|
||||||
- OneSignalXCFramework/OneSignalExtension
|
|
||||||
- OneSignalXCFramework/OneSignalOutcomes
|
|
||||||
- OneSignalXCFramework/OneSignalOSCore (5.2.10):
|
|
||||||
- OneSignalXCFramework/OneSignalCore
|
|
||||||
- OneSignalXCFramework/OneSignalOutcomes (5.2.10):
|
|
||||||
- OneSignalXCFramework/OneSignalCore
|
|
||||||
- OneSignalXCFramework/OneSignalUser (5.2.10):
|
|
||||||
- OneSignalXCFramework/OneSignalCore
|
|
||||||
- OneSignalXCFramework/OneSignalNotifications
|
|
||||||
- OneSignalXCFramework/OneSignalOSCore
|
|
||||||
- OneSignalXCFramework/OneSignalOutcomes
|
|
||||||
|
|
||||||
DEPENDENCIES:
|
|
||||||
- "Capacitor (from `../../node_modules/@capacitor/ios`)"
|
|
||||||
- "CapacitorCordova (from `../../node_modules/@capacitor/ios`)"
|
|
||||||
- "CapacitorDevice (from `../../node_modules/@capacitor/device`)"
|
|
||||||
- "CapacitorNetwork (from `../../node_modules/@capacitor/network`)"
|
|
||||||
- CapacitorPluginSafeArea (from `../../node_modules/capacitor-plugin-safe-area`)
|
|
||||||
- "CapacitorPreferences (from `../../node_modules/@capacitor/preferences`)"
|
|
||||||
- CordovaPluginsStatic (from `../capacitor-cordova-ios-plugins`)
|
|
||||||
- OneSignalXCFramework (< 6.0, >= 5.0)
|
|
||||||
|
|
||||||
SPEC REPOS:
|
|
||||||
trunk:
|
|
||||||
- OneSignalXCFramework
|
|
||||||
|
|
||||||
EXTERNAL SOURCES:
|
|
||||||
Capacitor:
|
|
||||||
:path: "../../node_modules/@capacitor/ios"
|
|
||||||
CapacitorCordova:
|
|
||||||
:path: "../../node_modules/@capacitor/ios"
|
|
||||||
CapacitorDevice:
|
|
||||||
:path: "../../node_modules/@capacitor/device"
|
|
||||||
CapacitorNetwork:
|
|
||||||
:path: "../../node_modules/@capacitor/network"
|
|
||||||
CapacitorPluginSafeArea:
|
|
||||||
:path: "../../node_modules/capacitor-plugin-safe-area"
|
|
||||||
CapacitorPreferences:
|
|
||||||
:path: "../../node_modules/@capacitor/preferences"
|
|
||||||
CordovaPluginsStatic:
|
|
||||||
:path: "../capacitor-cordova-ios-plugins"
|
|
||||||
|
|
||||||
SPEC CHECKSUMS:
|
|
||||||
Capacitor: bceb785fb78f5e81e4a9e37843bc1c24bd9c7194
|
|
||||||
CapacitorCordova: 866217f32c1d25b326c568a10ea3ed0c36b13e29
|
|
||||||
CapacitorDevice: 069faf433b3a99c3d5f0e500fbe634f60a8c6a84
|
|
||||||
CapacitorNetwork: 30c2e78a0ed32530656cb426c8ee6c2caec10dbf
|
|
||||||
CapacitorPluginSafeArea: 22031c3436269ca80fac90ec2c94bc7c1e59a81d
|
|
||||||
CapacitorPreferences: f3eadae2369ac3ab8e21743a2959145b0d1286a3
|
|
||||||
CordovaPluginsStatic: f722d4ff434f50099581e690d579b7c108f490e6
|
|
||||||
OneSignalXCFramework: 1a3b28dfbff23aabce585796d23c1bef37772774
|
|
||||||
|
|
||||||
PODFILE CHECKSUM: d76fcd3d35c3f8c3708303de70ef45a76cc6e2b5
|
|
||||||
|
|
||||||
COCOAPODS: 1.16.2
|
|
||||||
@@ -2,6 +2,7 @@
|
|||||||
import { ref, onMounted, onBeforeUnmount } from "vue"
|
import { ref, onMounted, onBeforeUnmount } from "vue"
|
||||||
|
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
|
import {useAuthStore} from "~/stores/auth.js";
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const auth = useAuthStore()
|
const auth = useAuthStore()
|
||||||
@@ -234,9 +235,9 @@ onBeforeUnmount(() => {
|
|||||||
class="w-1/3 mx-auto my-10"
|
class="w-1/3 mx-auto my-10"
|
||||||
v-else
|
v-else
|
||||||
/>
|
/>
|
||||||
<div v-if="!auth.activeTenant" class="w-full mx-auto text-center">
|
<div v-if="!auth.activeTenant && auth.tenants?.length > 0 " class="w-full mx-auto text-center">
|
||||||
<!-- Tenant Selection -->
|
<!-- Tenant Selection -->
|
||||||
<h3 class="text-center font-bold text-2xl mb-5">Kein Aktiver Mandant. Bitte wählen Sie ein Mandant.</h3>
|
<h3 class="text-center font-bold text-2xl mb-5">Kein Aktiver Mandant. <br>Bitte wählen Sie ein Mandant.</h3>
|
||||||
<div class="mx-auto w-5/6 flex flex-row justify-between my-3" v-for="tenant in auth.tenants">
|
<div class="mx-auto w-5/6 flex flex-row justify-between my-3" v-for="tenant in auth.tenants">
|
||||||
<span class="text-left">{{tenant.name}}</span>
|
<span class="text-left">{{tenant.name}}</span>
|
||||||
<UButton
|
<UButton
|
||||||
@@ -252,7 +253,14 @@ onBeforeUnmount(() => {
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<UProgress animation="carousel" class="w-3/4 mx-auto mt-10" />
|
<UProgress animation="carousel" class="w-3/4 mx-auto mt-10" />Test
|
||||||
|
{{auth.tenants}}
|
||||||
|
|
||||||
|
<UButton
|
||||||
|
variant="outline"
|
||||||
|
color="rose"
|
||||||
|
@click="auth.logout()"
|
||||||
|
>Abmelden</UButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
export default defineNuxtRouteMiddleware(async (to, from) => {
|
export default defineNuxtRouteMiddleware(async (to, from) => {
|
||||||
const auth = useAuthStore()
|
const auth = useAuthStore()
|
||||||
|
|
||||||
|
console.log(auth)
|
||||||
|
|
||||||
|
if (auth.loading) return
|
||||||
|
|
||||||
|
|
||||||
// Wenn nicht eingeloggt → auf /login (außer er will schon dahin)
|
// Wenn nicht eingeloggt → auf /login (außer er will schon dahin)
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@capacitor/android": "^7.0.0",
|
"@capacitor/android": "^7.0.0",
|
||||||
|
"@capacitor/browser": "^7.0.2",
|
||||||
"@capacitor/core": "^7.0.0",
|
"@capacitor/core": "^7.0.0",
|
||||||
"@capacitor/device": "^7.0.0",
|
"@capacitor/device": "^7.0.0",
|
||||||
"@capacitor/ios": "^7.0.0",
|
"@capacitor/ios": "^7.0.0",
|
||||||
@@ -66,7 +67,7 @@
|
|||||||
"maplibre-gl": "^4.7.0",
|
"maplibre-gl": "^4.7.0",
|
||||||
"nuxt-editorjs": "^1.0.4",
|
"nuxt-editorjs": "^1.0.4",
|
||||||
"nuxt-viewport": "^2.0.6",
|
"nuxt-viewport": "^2.0.6",
|
||||||
"onesignal-cordova-plugin": "^5.2.11",
|
"onesignal-cordova-plugin": "^5.2.14",
|
||||||
"papaparse": "^5.4.1",
|
"papaparse": "^5.4.1",
|
||||||
"pdf-lib": "^1.17.1",
|
"pdf-lib": "^1.17.1",
|
||||||
"pinia": "^2.1.7",
|
"pinia": "^2.1.7",
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ definePageMeta({
|
|||||||
|
|
||||||
const auth = useAuthStore()
|
const auth = useAuthStore()
|
||||||
const toast = useToast()
|
const toast = useToast()
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
const platformIsNative = useCapacitor().getIsNative()
|
const platformIsNative = useCapacitor().getIsNative()
|
||||||
|
|
||||||
@@ -15,9 +16,9 @@ const doLogin = async (data:any) => {
|
|||||||
// Weiterleiten nach erfolgreichem Login
|
// Weiterleiten nach erfolgreichem Login
|
||||||
toast.add({title:"Einloggen erfolgreich"})
|
toast.add({title:"Einloggen erfolgreich"})
|
||||||
if(platformIsNative) {
|
if(platformIsNative) {
|
||||||
return navigateTo("/mobile")
|
await router.push("/mobile")
|
||||||
} else {
|
} else {
|
||||||
return navigateTo("/")
|
await router.push("/")
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
toast.add({title:"Zugangsdaten falsch. Bitte überprüfen Sie Ihre Eingaben",color:"rose"})
|
toast.add({title:"Zugangsdaten falsch. Bitte überprüfen Sie Ihre Eingaben",color:"rose"})
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ export default defineNuxtPlugin(() => {
|
|||||||
const config = useRuntimeConfig()
|
const config = useRuntimeConfig()
|
||||||
|
|
||||||
const api = $fetch.create({
|
const api = $fetch.create({
|
||||||
baseURL: config.public.apiBase,/*"http://192.168.1.227:3100" "https://backend.fedeo.io"*/
|
baseURL: config.public.apiBase,
|
||||||
credentials: "include",
|
credentials: "include",
|
||||||
async onRequest({options}) {
|
async onRequest({options}) {
|
||||||
// Token aus Cookie holen
|
// Token aus Cookie holen
|
||||||
let token: string | null | undefined = ""
|
let token: string | null | undefined = ""
|
||||||
if (await useCapacitor().getIsNative()) {
|
if (useCapacitor().getIsNative()) {
|
||||||
const {value} = await Preferences.get({key: 'token'});
|
const {value} = await Preferences.get({key: 'token'});
|
||||||
token = value
|
token = value
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -63,13 +63,18 @@ export const useAuthStore = defineStore("auth", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async login(email: string, password: string) {
|
async login(email: string, password: string) {
|
||||||
console.log("Auth login")
|
try {
|
||||||
const { token } = await useNuxtApp().$api("/auth/login", {
|
console.log("Auth login")
|
||||||
method: "POST",
|
const { token } = await useNuxtApp().$api("/auth/login", {
|
||||||
body: { email, password }
|
method: "POST",
|
||||||
})
|
body: { email, password }
|
||||||
console.log(token)
|
})
|
||||||
await this.fetchMe(token)
|
console.log("Token: " + token)
|
||||||
|
await this.fetchMe(token)
|
||||||
|
} catch (e) {
|
||||||
|
console.log("login error:" + e)
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async logout() {
|
async logout() {
|
||||||
@@ -105,6 +110,7 @@ export const useAuthStore = defineStore("auth", {
|
|||||||
jwt
|
jwt
|
||||||
}}
|
}}
|
||||||
})
|
})
|
||||||
|
console.log(me)
|
||||||
this.user = me.user
|
this.user = me.user
|
||||||
this.permissions = me.permissions
|
this.permissions = me.permissions
|
||||||
this.tenants = me.tenants
|
this.tenants = me.tenants
|
||||||
@@ -143,7 +149,7 @@ export const useAuthStore = defineStore("auth", {
|
|||||||
|
|
||||||
const {token} = res
|
const {token} = res
|
||||||
|
|
||||||
if(await useCapacitor().getIsNative()) {
|
if(useCapacitor().getIsNative()) {
|
||||||
await Preferences.set({
|
await Preferences.set({
|
||||||
key:"token",
|
key:"token",
|
||||||
value: token,
|
value: token,
|
||||||
|
|||||||
Reference in New Issue
Block a user