Mobile
This commit is contained in:
@@ -60,5 +60,10 @@
|
||||
</array>
|
||||
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||
<true/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@@ -11,6 +11,7 @@ install! 'cocoapods', :disable_input_output_paths => true
|
||||
def capacitor_pods
|
||||
pod 'Capacitor', :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 'CapacitorNetwork', :path => '../../node_modules/@capacitor/network'
|
||||
pod 'CapacitorPreferences', :path => '../../node_modules/@capacitor/preferences'
|
||||
@@ -24,7 +25,15 @@ target 'App' do
|
||||
end
|
||||
|
||||
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
|
||||
|
||||
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 dayjs from "dayjs";
|
||||
import {useAuthStore} from "~/stores/auth.js";
|
||||
|
||||
const route = useRoute()
|
||||
const auth = useAuthStore()
|
||||
@@ -234,9 +235,9 @@ onBeforeUnmount(() => {
|
||||
class="w-1/3 mx-auto my-10"
|
||||
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 -->
|
||||
<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">
|
||||
<span class="text-left">{{tenant.name}}</span>
|
||||
<UButton
|
||||
@@ -252,7 +253,14 @@ onBeforeUnmount(() => {
|
||||
|
||||
</div>
|
||||
<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>
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
export default defineNuxtRouteMiddleware(async (to, from) => {
|
||||
const auth = useAuthStore()
|
||||
|
||||
console.log(auth)
|
||||
|
||||
if (auth.loading) return
|
||||
|
||||
|
||||
// Wenn nicht eingeloggt → auf /login (außer er will schon dahin)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@capacitor/android": "^7.0.0",
|
||||
"@capacitor/browser": "^7.0.2",
|
||||
"@capacitor/core": "^7.0.0",
|
||||
"@capacitor/device": "^7.0.0",
|
||||
"@capacitor/ios": "^7.0.0",
|
||||
@@ -66,7 +67,7 @@
|
||||
"maplibre-gl": "^4.7.0",
|
||||
"nuxt-editorjs": "^1.0.4",
|
||||
"nuxt-viewport": "^2.0.6",
|
||||
"onesignal-cordova-plugin": "^5.2.11",
|
||||
"onesignal-cordova-plugin": "^5.2.14",
|
||||
"papaparse": "^5.4.1",
|
||||
"pdf-lib": "^1.17.1",
|
||||
"pinia": "^2.1.7",
|
||||
|
||||
@@ -5,6 +5,7 @@ definePageMeta({
|
||||
|
||||
const auth = useAuthStore()
|
||||
const toast = useToast()
|
||||
const router = useRouter()
|
||||
|
||||
const platformIsNative = useCapacitor().getIsNative()
|
||||
|
||||
@@ -15,9 +16,9 @@ const doLogin = async (data:any) => {
|
||||
// Weiterleiten nach erfolgreichem Login
|
||||
toast.add({title:"Einloggen erfolgreich"})
|
||||
if(platformIsNative) {
|
||||
return navigateTo("/mobile")
|
||||
await router.push("/mobile")
|
||||
} else {
|
||||
return navigateTo("/")
|
||||
await router.push("/")
|
||||
}
|
||||
} catch (err: any) {
|
||||
toast.add({title:"Zugangsdaten falsch. Bitte überprüfen Sie Ihre Eingaben",color:"rose"})
|
||||
|
||||
@@ -4,12 +4,12 @@ export default defineNuxtPlugin(() => {
|
||||
const config = useRuntimeConfig()
|
||||
|
||||
const api = $fetch.create({
|
||||
baseURL: config.public.apiBase,/*"http://192.168.1.227:3100" "https://backend.fedeo.io"*/
|
||||
baseURL: config.public.apiBase,
|
||||
credentials: "include",
|
||||
async onRequest({options}) {
|
||||
// Token aus Cookie holen
|
||||
let token: string | null | undefined = ""
|
||||
if (await useCapacitor().getIsNative()) {
|
||||
if (useCapacitor().getIsNative()) {
|
||||
const {value} = await Preferences.get({key: 'token'});
|
||||
token = value
|
||||
} else {
|
||||
|
||||
@@ -63,13 +63,18 @@ export const useAuthStore = defineStore("auth", {
|
||||
},
|
||||
|
||||
async login(email: string, password: string) {
|
||||
console.log("Auth login")
|
||||
const { token } = await useNuxtApp().$api("/auth/login", {
|
||||
method: "POST",
|
||||
body: { email, password }
|
||||
})
|
||||
console.log(token)
|
||||
await this.fetchMe(token)
|
||||
try {
|
||||
console.log("Auth login")
|
||||
const { token } = await useNuxtApp().$api("/auth/login", {
|
||||
method: "POST",
|
||||
body: { email, password }
|
||||
})
|
||||
console.log("Token: " + token)
|
||||
await this.fetchMe(token)
|
||||
} catch (e) {
|
||||
console.log("login error:" + e)
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
async logout() {
|
||||
@@ -105,6 +110,7 @@ export const useAuthStore = defineStore("auth", {
|
||||
jwt
|
||||
}}
|
||||
})
|
||||
console.log(me)
|
||||
this.user = me.user
|
||||
this.permissions = me.permissions
|
||||
this.tenants = me.tenants
|
||||
@@ -143,7 +149,7 @@ export const useAuthStore = defineStore("auth", {
|
||||
|
||||
const {token} = res
|
||||
|
||||
if(await useCapacitor().getIsNative()) {
|
||||
if(useCapacitor().getIsNative()) {
|
||||
await Preferences.set({
|
||||
key:"token",
|
||||
value: token,
|
||||
|
||||
Reference in New Issue
Block a user