This commit is contained in:
qsh
2024-05-23 14:08:08 +08:00
parent 28c328d191
commit 3050b9a2fe
109 changed files with 479 additions and 3139 deletions

View File

@@ -10,7 +10,7 @@
<!-- 左上角的 logo + 系统标题 -->
<div class="flex items-center relative text-white">
<img alt="" class="w-48px h-48px mr-10px" src="@/assets/imgs/logo.png" />
<span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
<span class="text-20px font-bold">{{ underlineToHump(appInfo.instanceName) }}</span>
</div>
<!-- 左边的背景图 + 欢迎语 -->
<div class="flex justify-center">
@@ -35,7 +35,7 @@
<div class="flex justify-between items-center text-white @2xl:justify-end @xl:justify-end">
<div class="flex items-center @2xl:hidden @xl:hidden">
<img alt="" class="w-48px h-48px mr-10px" src="@/assets/imgs/logo.png" />
<span class="text-20px font-bold">{{ underlineToHump(appStore.getTitle) }}</span>
<span class="text-20px font-bold">{{ underlineToHump(appInfo.instanceName) }}</span>
</div>
<div class="flex justify-end items-center space-x-10px">
<ThemeSwitch />
@@ -63,7 +63,7 @@
</div>
</div>
</template>
<script lang="ts" name="Login" setup>
<script name="Login" setup>
import { underlineToHump } from '@/utils'
import { useDesign } from '@/hooks/web/useDesign'
@@ -74,11 +74,16 @@ import { LoginForm, MobileForm, QrCodeForm } from './components'
import soups from './components/soup.js'
import * as authUtil from '@/utils/auth'
// const { t } = useI18n()
const { currentRoute } = useRouter()
const appStore = useAppStore()
const { getPrefixCls } = useDesign()
const prefixCls = getPrefixCls('login')
const appInfo = ref({ title: appStore.getTitle })
const currentCharIndex = ref(0)
const typingInterval = ref(null)
@@ -91,8 +96,22 @@ const chars = computed(() => {
return text.slice(0, currentCharIndex.value)
})
function init() {
const res = currentRoute.value?.query?.tenantId
authUtil.setTenantId(res)
const appId = currentRoute.value?.query?.appId
authUtil.setAppId(appId)
appStore.setAppInfo(appId).then((res) => {
appInfo.value = res
})
}
onMounted(() => {
startTyping()
if (currentRoute.value?.query?.appId) {
init()
}
})
function startTyping() {