|
@@ -1,6 +1,9 @@
|
|
|
<template>
|
|
<template>
|
|
|
<app-statusbar class="login">
|
|
<app-statusbar class="login">
|
|
|
<app-navback class="login-navback" />
|
|
<app-navback class="login-navback" />
|
|
|
|
|
+ <app-statusbar class="login-luanguage" v-if="globalStore.getSystemInfo('i18nEnabled')">
|
|
|
|
|
+ <app-luanguage />
|
|
|
|
|
+ </app-statusbar>
|
|
|
<div class="login-logo">
|
|
<div class="login-logo">
|
|
|
<slot name="logo">
|
|
<slot name="logo">
|
|
|
<img :src="logoSrc" />
|
|
<img :src="logoSrc" />
|
|
@@ -8,25 +11,25 @@
|
|
|
</div>
|
|
</div>
|
|
|
<Form class="login-form" @submit="formSubmit">
|
|
<Form class="login-form" @submit="formSubmit">
|
|
|
<CellGroup inset>
|
|
<CellGroup inset>
|
|
|
- <Field v-model="formData.userName" name="account" :label="$t('user.login.username')" label-align="top" size="large" :placeholder="$t('user.login.Pleaseenterausername')"
|
|
|
|
|
|
|
+ <Field v-model="formData.userName" name="account" :label="$t('user.login.username')" label-align="top"
|
|
|
|
|
+ size="large" :placeholder="$t('user.login.Pleaseenterausername')"
|
|
|
:rules="[{ required: true, message: $t('user.login.Pleaseenterausername') }]" />
|
|
:rules="[{ required: true, message: $t('user.login.Pleaseenterausername') }]" />
|
|
|
- <Field v-model="formData.password" name="password" type="password" :label="$t('user.login.password')" label-align="top" size="large"
|
|
|
|
|
- :placeholder="$t('user.login.Pleaseenterthepassword')" :rules="[{ required: true, message: $t('user.login.Pleaseenterthepassword') }]" autocomplete="off" />
|
|
|
|
|
|
|
+ <Field v-model="formData.password" name="password" type="password" :label="$t('user.login.password')"
|
|
|
|
|
+ label-align="top" size="large" :placeholder="$t('user.login.Pleaseenterthepassword')"
|
|
|
|
|
+ :rules="[{ required: true, message: $t('user.login.Pleaseenterthepassword') }]" autocomplete="off" />
|
|
|
<Field>
|
|
<Field>
|
|
|
<template #input>
|
|
<template #input>
|
|
|
<SliderVerify @statu="slide" style="max-width: 100%;margin: auto;" v-if="showSliderVerify" />
|
|
<SliderVerify @statu="slide" style="max-width: 100%;margin: auto;" v-if="showSliderVerify" />
|
|
|
</template>
|
|
</template>
|
|
|
</Field>
|
|
</Field>
|
|
|
- <div style="margin: 10px 16px;">
|
|
|
|
|
- <app-select v-model="luanguage" :options="dataList.filter(e => e.isvalid === 1)" :optionProps="{ label: 'langname', value: 'langcode' }" @confirm="changeLuanguage"/>
|
|
|
|
|
- </div>
|
|
|
|
|
</CellGroup>
|
|
</CellGroup>
|
|
|
<div class="button-submit">
|
|
<div class="button-submit">
|
|
|
<Button type="primary" native-type="submit" round block>{{ $t('user.login.login') }}</Button>
|
|
<Button type="primary" native-type="submit" round block>{{ $t('user.login.login') }}</Button>
|
|
|
</div>
|
|
</div>
|
|
|
</Form>
|
|
</Form>
|
|
|
<div class="login-link">
|
|
<div class="login-link">
|
|
|
- <span @click="navigationTo('user-register')" v-if="globalStore.hasSystemModule('register')">{{ $t('user.login.register') }}</span>
|
|
|
|
|
|
|
+ <span @click="navigationTo('user-register')" v-if="globalStore.hasSystemModule('register')">{{
|
|
|
|
|
+ $t('user.login.register') }}</span>
|
|
|
<span @click="navigationTo('user-forget')">{{ $t('user.login.forgetpassword') }}</span>
|
|
<span @click="navigationTo('user-forget')">{{ $t('user.login.forgetpassword') }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="login-footer">
|
|
<div class="login-footer">
|
|
@@ -46,24 +49,16 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { shallowRef, computed } from 'vue'
|
|
|
|
|
|
|
+import { shallowRef } from 'vue'
|
|
|
import { Button, Field, CellGroup, Form, Checkbox, showFailToast, showToast } from 'vant'
|
|
import { Button, Field, CellGroup, Form, Checkbox, showFailToast, showToast } from 'vant'
|
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
import { fullloading, dialog } from '@/utils/vant'
|
|
|
import { useLogin } from '@/business/login'
|
|
import { useLogin } from '@/business/login'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
import { useGlobalStore, i18n } from '@/stores'
|
|
import { useGlobalStore, i18n } from '@/stores'
|
|
|
-import { useRequest } from '@/hooks/request'
|
|
|
|
|
-import { getI18nConfigs } from '@/services/api/common'
|
|
|
|
|
-import { Locale } from 'vant'
|
|
|
|
|
-import { localData } from '@/stores/storage'
|
|
|
|
|
import service from '@/services'
|
|
import service from '@/services'
|
|
|
import SliderVerify from '@/components/base/slider-verify/index.vue' // 临时调用,待优化
|
|
import SliderVerify from '@/components/base/slider-verify/index.vue' // 临时调用,待优化
|
|
|
import logoImage from '../../../assets/images/login-logo.png'
|
|
import logoImage from '../../../assets/images/login-logo.png'
|
|
|
-import AppSelect from '@mobile/components/base/select/index.vue'
|
|
|
|
|
-import enUS from 'vant/es/locale/lang/en-US'
|
|
|
|
|
-import enCN from 'vant/es/locale/lang/zh-CN'
|
|
|
|
|
-import thTH from 'vant/es/locale/lang/th-TH'
|
|
|
|
|
-import zhTW from 'vant/es/locale/lang/zh-TW'
|
|
|
|
|
|
|
+import AppLuanguage from '@mobile/components/modules/luanguage/index.vue'
|
|
|
|
|
|
|
|
defineProps({
|
|
defineProps({
|
|
|
logoSrc: {
|
|
logoSrc: {
|
|
@@ -87,46 +82,6 @@ const sliderVerifyStatus = shallowRef(false) // 滑块验证状态
|
|
|
const meta = document.getElementsByTagName('meta')
|
|
const meta = document.getElementsByTagName('meta')
|
|
|
const appVersion = meta.namedItem('revised')?.content ?? '0'
|
|
const appVersion = meta.namedItem('revised')?.content ?? '0'
|
|
|
|
|
|
|
|
-const { dataList, run } = useRequest(getI18nConfigs, {
|
|
|
|
|
- manual: true
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
-const luanguage = computed(() => {
|
|
|
|
|
- switch (i18n.global.locale) {
|
|
|
|
|
- case 'zh-CN':
|
|
|
|
|
- return 'zh-CN'
|
|
|
|
|
- case 'en-US':
|
|
|
|
|
- return 'en'
|
|
|
|
|
- case 'zh-TW':
|
|
|
|
|
- return 'zh-TW'
|
|
|
|
|
- default:
|
|
|
|
|
- return 'th'
|
|
|
|
|
- }
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
-const changeLuanguage = (e: string) => {
|
|
|
|
|
- switch (e) {
|
|
|
|
|
- case 'zh-CN':
|
|
|
|
|
- i18n.global.locale = 'zh-CN'
|
|
|
|
|
- Locale.use(i18n.global.locale, enCN)
|
|
|
|
|
- break;
|
|
|
|
|
- case 'en':
|
|
|
|
|
- i18n.global.locale = 'en-US'
|
|
|
|
|
- Locale.use(i18n.global.locale, enUS)
|
|
|
|
|
- break;
|
|
|
|
|
- case 'zh-TW':
|
|
|
|
|
- i18n.global.locale ='zh-TW'
|
|
|
|
|
- Locale.use(i18n.global.locale, zhTW)
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- i18n.global.locale = 'th'
|
|
|
|
|
- Locale.use(i18n.global.locale, thTH)
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- /// 设置语言
|
|
|
|
|
- localData.setValue('appLanguage', i18n.global.locale)
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// 导航跳转
|
|
// 导航跳转
|
|
|
const navigationTo = (name: string) => {
|
|
const navigationTo = (name: string) => {
|
|
|
fullloading((hideLoading) => {
|
|
fullloading((hideLoading) => {
|
|
@@ -178,10 +133,6 @@ const formSubmit = () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-service.onReady().then(() => {
|
|
|
|
|
- run()
|
|
|
|
|
-})
|
|
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|