Merge remote-tracking branch 'origin/modular' into modular
This commit is contained in:
+14
-1
@@ -83,11 +83,24 @@ function applyTenantThemeVars() {
|
||||
document.documentElement.style.setProperty('--App-background-color', backgroundColor)
|
||||
}
|
||||
}
|
||||
function detectTWA() {
|
||||
const fromReferrer = document.referrer.startsWith('android-app://');
|
||||
const fromParam = new URLSearchParams(window.location.search).get('source') === 'twa';
|
||||
|
||||
if (fromReferrer || fromParam) {
|
||||
sessionStorage.setItem('appMode', 'twa');
|
||||
// پاک کردن پارامتر از URL
|
||||
if (fromParam) {
|
||||
const url = new URL(window.location.href);
|
||||
url.searchParams.delete('source');
|
||||
window.history.replaceState({}, '', url);
|
||||
}
|
||||
}
|
||||
}
|
||||
export async function bootstrapApp() {
|
||||
try {
|
||||
detectTWA()
|
||||
const config = await withTimeout(loadAppConfig(), 20000, 'Config loading timeout')
|
||||
|
||||
setAppConfig(config)
|
||||
applyTenantThemeVars()
|
||||
startPwaManifest(config)
|
||||
|
||||
+8
-1
@@ -224,7 +224,14 @@ export function applyProjectFont() {
|
||||
document.documentElement.classList.add('font-dana')
|
||||
}
|
||||
}
|
||||
|
||||
export function isTWA() {
|
||||
if (sessionStorage.getItem('appMode') === 'twa') return true;
|
||||
if (document.referrer.startsWith('android-app://')) {
|
||||
sessionStorage.setItem('appMode', 'twa');
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
export function applyProjectTheme() {
|
||||
applyProjectFont()
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
</BasicButton>
|
||||
|
||||
<template v-if="config.config?.name === 'garoosi'">
|
||||
<div class="dauth-actions-row">
|
||||
<div v-if="!isTWA()" class="dauth-actions-row">
|
||||
<a
|
||||
class="dauth-link-btn dauth-link-btn--primary"
|
||||
download="Garoosi.apk"
|
||||
@@ -194,7 +194,7 @@
|
||||
>
|
||||
دانلود اپ اندروید
|
||||
</a>
|
||||
<button type="button" class="dauth-link-btn" @click="installWebApp">
|
||||
<button type="button" class="dauth-link-btn" @click="installWebApp">
|
||||
نصب نسخه وب اپ
|
||||
</button>
|
||||
</div>
|
||||
@@ -205,6 +205,15 @@
|
||||
درباره ما
|
||||
</button>
|
||||
</template>
|
||||
<div v-else-if="!isTWA() && !!setting.getSettingByKey('apk_download_link')" class="mt-1">
|
||||
<a
|
||||
class="dauth-link-btn dauth-link-btn--primary !hover:text-primary "
|
||||
:href="setting.getSettingByKey('apk_download_link')"
|
||||
>
|
||||
دانلود اپ اندروید
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div
|
||||
@@ -239,8 +248,9 @@
|
||||
ورود با اثر انگشت
|
||||
</div>
|
||||
</BasicButton>
|
||||
|
||||
<template v-if="config.config?.name === 'garoosi'">
|
||||
<div class="flex w-full gap-2 mb-2 mt-2">
|
||||
<div v-if="!isTWA()" class="flex w-full gap-2 mb-2 mt-2">
|
||||
<a
|
||||
class="flex w-full items-center justify-center rounded py-2 text-white bg-primary border-none cursor-pointer no-underline"
|
||||
download="Garoosi.apk"
|
||||
@@ -261,10 +271,17 @@
|
||||
</div>
|
||||
</BasicButton>
|
||||
</template>
|
||||
|
||||
<div v-else-if="!isTWA() && !!setting.getSettingByKey('apk_download_link')" class=" mt-1">
|
||||
<a
|
||||
class="dauth-link-btn dauth-link-btn--primary !hover:text-primary "
|
||||
:href="setting.getSettingByKey('apk_download_link')"
|
||||
>
|
||||
دانلود اپ اندروید
|
||||
</a>
|
||||
</div>
|
||||
<div
|
||||
v-if="isRegister"
|
||||
class="cursor-pointer flex gap-1 justify-center mt-5 text-xs"
|
||||
class="cursor-pointer flex gap-1 justify-center mt-5 text-xs "
|
||||
@click="$emit('register', true)"
|
||||
>
|
||||
اگر حساب کاربری ندارید
|
||||
@@ -360,7 +377,13 @@ import { useWalletStore } from '@/store/walletStore'
|
||||
import { useSettingsStore } from '@/store/settingsStore'
|
||||
import { setTruth } from '@/app/authBoot'
|
||||
import {useConfigStore} from "@/store/configStore";
|
||||
import {getConfigApp, getProjectLoginLogo, getProjectLoginTaglineLines, hasCustomLoginLogoLayout} from "@/utils/config";
|
||||
import {
|
||||
getConfigApp,
|
||||
getProjectLoginLogo,
|
||||
getProjectLoginTaglineLines,
|
||||
hasCustomLoginLogoLayout,
|
||||
isTWA
|
||||
} from "@/utils/config";
|
||||
import BasicActionSheet from "@/components/BasicPacks/BasicActionSheet.vue";
|
||||
import {getConfig} from "@/api/config";
|
||||
import shareAppleIcon from '@/assets/img/share-apple.png'
|
||||
@@ -390,6 +413,7 @@ const stepTwoVerify = ref<boolean>(false)
|
||||
const formRef = ref<FormInstance>()
|
||||
const userStore = useUserStore()
|
||||
const walletStore = useWalletStore()
|
||||
const setting=useSettingsStore()
|
||||
const data = reactive(['ورود با پیامک', 'ورود با کلمه عبور'])
|
||||
const value = ref(data[0])
|
||||
const refOtpInput = ref<InstanceType<typeof OtpInput> | null>(null)
|
||||
|
||||
@@ -8,11 +8,14 @@ import { useConfigStore } from '@/store/configStore'
|
||||
import { useLoginPageContext } from '../../composables/useLoginPage'
|
||||
import DesktopPwaGuideModal from './DesktopPwaGuideModal.vue'
|
||||
import router from '@/router'
|
||||
import {isTWA} from "@/utils/config";
|
||||
import {useUserStore} from "@/store/userStore";
|
||||
import {useSettingsStore} from "@/store/settingsStore";
|
||||
|
||||
const emit = defineEmits<{
|
||||
register: [val: boolean]
|
||||
}>()
|
||||
|
||||
const setting=useSettingsStore()
|
||||
const config = useConfigStore()
|
||||
const {
|
||||
time,
|
||||
@@ -170,7 +173,7 @@ function goToAboutUs() {
|
||||
</BasicButton>
|
||||
|
||||
<template v-if="config.config?.name === 'garoosi'">
|
||||
<div class="dauth-actions-row">
|
||||
<div v-if="!isTWA()" class="dauth-actions-row">
|
||||
<a
|
||||
class="dauth-link-btn dauth-link-btn--primary"
|
||||
download="Garoosi.apk"
|
||||
@@ -189,6 +192,15 @@ function goToAboutUs() {
|
||||
درباره ما
|
||||
</button>
|
||||
</template>
|
||||
<div v-else-if="!isTWA() && !!setting.getSettingByKey('apk_download_link')" class="dauth-actions-row ">
|
||||
<a
|
||||
class="dauth-link-btn dauth-link-btn--primary !hover:text-primary "
|
||||
:href="setting.getSettingByKey('apk_download_link')"
|
||||
>
|
||||
دانلود اپ اندروید
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div v-if="isRegister" class="dauth-switch">
|
||||
|
||||
Reference in New Issue
Block a user