|
|
@ -1,6 +1,6 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div :class="prefixCls" class="login-background-img"> |
|
|
|
<div :class="prefixCls" class="login-background-img"> |
|
|
|
<AppLocalePicker class="absolute top-4 right-4 enter-x xl:text-gray-600" :showText="false"/> |
|
|
|
<AppLocalePicker v-if="showLocale" class="absolute top-4 right-4 enter-x xl:text-gray-600" :showText="false"/> |
|
|
|
<AppDarkModeToggle class="absolute top-3 right-10 enter-x"/> |
|
|
|
<AppDarkModeToggle class="absolute top-3 right-10 enter-x"/> |
|
|
|
<div v-if="!getIsMobile" class="aui-logo"> |
|
|
|
<div v-if="!getIsMobile" class="aui-logo"> |
|
|
|
<div> |
|
|
|
<div> |
|
|
@ -10,32 +10,28 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-else class="aui-phone-logo"> |
|
|
|
<div v-else class="aui-phone-logo"> |
|
|
|
<img :src="logoImg"> |
|
|
|
<img :src="logoPhoneImg"> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-show="type === 'login'"> |
|
|
|
<div v-show="type === 'login'"> |
|
|
|
<div class="aui-content"> |
|
|
|
<div class="aui-content"> |
|
|
|
<div class="aui-container"> |
|
|
|
<div class="aui-container"> |
|
|
|
<div class="aui-form"> |
|
|
|
<div class="aui-form"> |
|
|
|
<div class="aui-image"> |
|
|
|
<div class="aui-image"> |
|
|
|
<div class="aui-image-text"> |
|
|
|
<div class="aui-image-text"/> |
|
|
|
<img :src="adTextImg" alt=""> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="aui-formBox"> |
|
|
|
<div class="aui-formBox"> |
|
|
|
<div class="aui-formWell"> |
|
|
|
<div class="aui-formWell"> |
|
|
|
<div class="aui-flex aui-form-nav investment_title"> |
|
|
|
<div class="aui-flex aui-form-nav"> |
|
|
|
<div |
|
|
|
<div |
|
|
|
class="aui-flex-box" |
|
|
|
class="aui-flex-box" |
|
|
|
:class="activeIndex === 'accountLogin' ? 'activeNav on' : ''" |
|
|
|
:class="activeIndex === 'accountLogin' ? 'activeNav on' : ''" |
|
|
|
@click="loginClick('accountLogin')" |
|
|
|
@click="loginClick('accountLogin')" |
|
|
|
>{{ t('sys.login.signInFormTitle') }} |
|
|
|
>{{ t('sys.login.signInFormTitle') }}</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div |
|
|
|
<div |
|
|
|
class="aui-flex-box" |
|
|
|
class="aui-flex-box" |
|
|
|
:class="activeIndex === 'phoneLogin' ? 'activeNav on' : ''" |
|
|
|
:class="activeIndex === 'phoneLogin' ? 'activeNav on' : ''" |
|
|
|
@click="loginClick('phoneLogin')" |
|
|
|
@click="loginClick('phoneLogin')" |
|
|
|
>{{ t('sys.login.mobileSignInFormTitle') }} |
|
|
|
>{{ t('sys.login.mobileSignInFormTitle') }}</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="aui-form-box" style="height: 180px"> |
|
|
|
<div class="aui-form-box" style="height: 180px"> |
|
|
|
<a-form |
|
|
|
<a-form |
|
|
@ -77,7 +73,7 @@ |
|
|
|
<img |
|
|
|
<img |
|
|
|
v-else |
|
|
|
v-else |
|
|
|
style="margin-top: 2px; max-width: initial" |
|
|
|
style="margin-top: 2px; max-width: initial" |
|
|
|
:src="codeImg" |
|
|
|
:src="defaultCaptchaImg" |
|
|
|
@click="handleChangeCheckCode" |
|
|
|
@click="handleChangeCheckCode" |
|
|
|
> |
|
|
|
> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -129,8 +125,7 @@ |
|
|
|
class="aui-link-login aui-flex-box" |
|
|
|
class="aui-link-login aui-flex-box" |
|
|
|
type="primary" |
|
|
|
type="primary" |
|
|
|
@click="loginHandleClick" |
|
|
|
@click="loginHandleClick" |
|
|
|
> |
|
|
|
>{{ t('sys.login.loginButton') }}</a-button> |
|
|
|
{{ t('sys.login.loginButton') }}</a-button> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="aui-flex"> |
|
|
|
<div class="aui-flex"> |
|
|
|
<a class="aui-linek-code aui-flex-box" @click="codeHandleClick">{{ t('sys.login.qrSignInFormTitle') }}</a> |
|
|
|
<a class="aui-linek-code aui-flex-box" @click="codeHandleClick">{{ t('sys.login.qrSignInFormTitle') }}</a> |
|
|
@ -140,7 +135,7 @@ |
|
|
|
</div>--> |
|
|
|
</div>--> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<a-form @keypress.enter="loginHandleClick"> |
|
|
|
<a-form> |
|
|
|
<div class="aui-flex aui-third-text"> |
|
|
|
<div class="aui-flex aui-third-text"> |
|
|
|
<div class="aui-flex-box aui-third-border"> |
|
|
|
<div class="aui-flex-box aui-third-border"> |
|
|
|
<span>{{ t('sys.login.otherSignIn') }}</span> |
|
|
|
<span>{{ t('sys.login.otherSignIn') }}</span> |
|
|
@ -154,7 +149,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="aui-flex-box"> |
|
|
|
<div class="aui-flex-box"> |
|
|
|
<div class="aui-third-login"> |
|
|
|
<div class="aui-third-login"> |
|
|
|
<a title="企业微信" @click="onThirdLogin('wechat_enterprise')"><icon-font class="item-icon" type="icon-qiyeweixin3"/></a> |
|
|
|
<a title="支付宝" @click="onThirdLogin('alipay')"><AlipayCircleFilled/></a> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="aui-flex-box"> |
|
|
|
<div class="aui-flex-box"> |
|
|
@ -185,31 +180,24 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<script lang="ts" setup name="login-mini"> |
|
|
|
<script lang="ts" setup> |
|
|
|
|
|
|
|
|
|
|
|
import { getCaptcha } from '/@/api/platform/core/controller/user'; |
|
|
|
import { getCaptcha } from '/@/api/platform/core/controller/user'; |
|
|
|
import { computed, onMounted, reactive, ref, toRaw, unref } from 'vue'; |
|
|
|
import { onMounted, reactive, ref, toRaw, unref } from 'vue'; |
|
|
|
import codeImg from '/@/assets/images/captcha.jpg'; |
|
|
|
import defaultCaptchaImg from '/@/assets/images/captcha.jpg'; |
|
|
|
import { Rule } from '/@/components/Form'; |
|
|
|
|
|
|
|
import { useUserStore } from '/@/store/modules/user'; |
|
|
|
import { useUserStore } from '/@/store/modules/user'; |
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
import { useI18n } from '/@/hooks/web/useI18n'; |
|
|
|
import { useI18n } from '/@/hooks/web/useI18n'; |
|
|
|
import { LoginStateEnum } from '/@/views/core/login/useLogin'; |
|
|
|
|
|
|
|
//import ThirdModal from '/@/views/sys/login/ThirdModal.vue'; |
|
|
|
|
|
|
|
import MiniForgotpad from './MiniForgotpad.vue'; |
|
|
|
import MiniForgotpad from './MiniForgotpad.vue'; |
|
|
|
import MiniRegister from './MiniRegister.vue'; |
|
|
|
import MiniRegister from './MiniRegister.vue'; |
|
|
|
import MiniCodelogin from './MiniCodelogin.vue'; |
|
|
|
import MiniCodelogin from './MiniCodelogin.vue'; |
|
|
|
import adTextImg from '/@/assets/loginmini/icon/login-ad-text.png'; |
|
|
|
|
|
|
|
import logoImg from '/@/assets/images/logo-tag.png'; |
|
|
|
import logoImg from '/@/assets/images/logo-tag.png'; |
|
|
|
|
|
|
|
import logoPhoneImg from '/@/assets/images/logo.png'; |
|
|
|
import { AppLocalePicker, AppDarkModeToggle } from '/@/components/Application'; |
|
|
|
import { AppLocalePicker, AppDarkModeToggle } from '/@/components/Application'; |
|
|
|
import { useLocaleStore } from '/@/store/modules/locale'; |
|
|
|
import { useLocaleStore } from '/@/store/modules/locale'; |
|
|
|
import { useDesign } from '/@/hooks/web/useDesign'; |
|
|
|
import { useDesign } from '/@/hooks/web/useDesign'; |
|
|
|
import { useAppInject } from '/@/hooks/web/useAppInject'; |
|
|
|
import { useAppInject } from '/@/hooks/web/useAppInject'; |
|
|
|
import { GithubFilled, WechatFilled, DingtalkCircleFilled, createFromIconfontCN } from '@ant-design/icons-vue'; |
|
|
|
import { GithubFilled, WechatFilled, AlipayCircleFilled, DingtalkCircleFilled } from '@ant-design/icons-vue'; |
|
|
|
|
|
|
|
|
|
|
|
const IconFont = createFromIconfontCN({ |
|
|
|
|
|
|
|
scriptUrl: '//at.alicdn.com/t/font_2316098_umqusozousr.js', |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
const { prefixCls } = useDesign('mini-login'); |
|
|
|
const { prefixCls } = useDesign('mini-login'); |
|
|
|
const { notification, createMessage } = useMessage(); |
|
|
|
const { notification, createMessage } = useMessage(); |
|
|
|
const userStore = useUserStore(); |
|
|
|
const userStore = useUserStore(); |
|
|
@ -219,7 +207,6 @@ |
|
|
|
const randCodeData = reactive<any>({ |
|
|
|
const randCodeData = reactive<any>({ |
|
|
|
randCodeImage: '', |
|
|
|
randCodeImage: '', |
|
|
|
requestCodeSuccess: false, |
|
|
|
requestCodeSuccess: false, |
|
|
|
checkKey: null, |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
const rememberMe = ref<string>('0'); |
|
|
|
const rememberMe = ref<string>('0'); |
|
|
|
// 手机号登录还是账号登录 |
|
|
|
// 手机号登录还是账号登录 |
|
|
@ -238,8 +225,6 @@ |
|
|
|
smscode: '', |
|
|
|
smscode: '', |
|
|
|
}); |
|
|
|
}); |
|
|
|
const loginRef = ref(); |
|
|
|
const loginRef = ref(); |
|
|
|
//第三方登录弹窗 |
|
|
|
|
|
|
|
const thirdModalRef = ref(); |
|
|
|
|
|
|
|
// 扫码登录 |
|
|
|
// 扫码登录 |
|
|
|
const codeRef = ref(); |
|
|
|
const codeRef = ref(); |
|
|
|
// 是否显示获取验证码 |
|
|
|
// 是否显示获取验证码 |
|
|
@ -255,12 +240,6 @@ |
|
|
|
const loginLoading = ref<boolean>(false); |
|
|
|
const loginLoading = ref<boolean>(false); |
|
|
|
const { getIsMobile } = useAppInject(); |
|
|
|
const { getIsMobile } = useAppInject(); |
|
|
|
|
|
|
|
|
|
|
|
defineProps({ |
|
|
|
|
|
|
|
sessionTimeout: { |
|
|
|
|
|
|
|
type: Boolean, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 获取验证码 |
|
|
|
* 获取验证码 |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -268,7 +247,7 @@ |
|
|
|
formData.inputCode = ''; |
|
|
|
formData.inputCode = ''; |
|
|
|
try { |
|
|
|
try { |
|
|
|
const codeModel = await getCaptcha(); |
|
|
|
const codeModel = await getCaptcha(); |
|
|
|
randCodeData.randCodeImage = codeModel.img ?? codeImg; |
|
|
|
randCodeData.randCodeImage = codeModel.img; |
|
|
|
randCodeData.requestCodeSuccess = true; |
|
|
|
randCodeData.requestCodeSuccess = true; |
|
|
|
formData.realKey = codeModel.realKey; |
|
|
|
formData.realKey = codeModel.realKey; |
|
|
|
} catch(error) { |
|
|
|
} catch(error) { |
|
|
@ -288,10 +267,9 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
async function loginHandleClick() { |
|
|
|
async function loginHandleClick() { |
|
|
|
if (unref(activeIndex) === 'accountLogin') { |
|
|
|
if (unref(activeIndex) === 'accountLogin') { |
|
|
|
accountLogin(); |
|
|
|
await accountLogin(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
//手机号登录 |
|
|
|
await phoneLogin(); |
|
|
|
phoneLogin(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -326,7 +304,7 @@ |
|
|
|
} catch (error){ |
|
|
|
} catch (error){ |
|
|
|
formData.code=''; |
|
|
|
formData.code=''; |
|
|
|
formData.realKey=''; |
|
|
|
formData.realKey=''; |
|
|
|
handleChangeCheckCode(); |
|
|
|
await handleChangeCheckCode(); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
loginLoading.value = false; |
|
|
|
loginLoading.value = false; |
|
|
|
} |
|
|
|
} |
|
|
@ -336,37 +314,10 @@ |
|
|
|
* 手机号登录 |
|
|
|
* 手机号登录 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
async function phoneLogin() { |
|
|
|
async function phoneLogin() { |
|
|
|
/*if (!phoneFormData.mobile) { |
|
|
|
|
|
|
|
createMessage.warn(t('sys.login.mobilePlaceholder')); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!phoneFormData.smscode) { |
|
|
|
|
|
|
|
createMessage.warn(t('sys.login.smsPlaceholder')); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
loginLoading.value = true; |
|
|
|
|
|
|
|
const { userInfo }: any = await userStore.phoneLogin({ |
|
|
|
|
|
|
|
mobile: phoneFormData.mobile, |
|
|
|
|
|
|
|
captcha: phoneFormData.smscode, |
|
|
|
|
|
|
|
mode: 'none', //不要默认的错误提示 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (userInfo) { |
|
|
|
|
|
|
|
notification.success({ |
|
|
|
notification.success({ |
|
|
|
message: t('sys.login.loginSuccessTitle'), |
|
|
|
message: '功能待开发中.', |
|
|
|
description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.realname}`, |
|
|
|
|
|
|
|
duration: 3, |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
|
|
notification.error({ |
|
|
|
|
|
|
|
message: t('sys.api.errorTip'), |
|
|
|
|
|
|
|
description: error.message || t('sys.login.networkExceptionMsg'), |
|
|
|
|
|
|
|
duration: 3, |
|
|
|
duration: 3, |
|
|
|
}); |
|
|
|
}); |
|
|
|
} finally { |
|
|
|
|
|
|
|
loginLoading.value = false; |
|
|
|
|
|
|
|
}*/ |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -376,9 +327,7 @@ |
|
|
|
/*if (!phoneFormData.mobile) { |
|
|
|
/*if (!phoneFormData.mobile) { |
|
|
|
createMessage.warn(t('sys.login.mobilePlaceholder')); |
|
|
|
createMessage.warn(t('sys.login.mobilePlaceholder')); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
}*/ |
|
|
|
const result = await getCaptcha({ mobile: phoneFormData.mobile, smsmode: SmsEnum.FORGET_PASSWORD }); |
|
|
|
|
|
|
|
if (result) { |
|
|
|
|
|
|
|
const TIME_COUNT = 60; |
|
|
|
const TIME_COUNT = 60; |
|
|
|
if (!unref(timer)) { |
|
|
|
if (!unref(timer)) { |
|
|
|
timeRuning.value = TIME_COUNT; |
|
|
|
timeRuning.value = TIME_COUNT; |
|
|
@ -393,7 +342,6 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}, 1000); |
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -401,7 +349,10 @@ |
|
|
|
* @param type |
|
|
|
* @param type |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function onThirdLogin(type) { |
|
|
|
function onThirdLogin(type) { |
|
|
|
thirdModalRef.value.onThirdLogin(type); |
|
|
|
notification.success({ |
|
|
|
|
|
|
|
message: '功能待开发中.', |
|
|
|
|
|
|
|
duration: 3, |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -445,7 +396,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 注册 |
|
|
|
* 二维码登录 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
function codeHandleClick() { |
|
|
|
function codeHandleClick() { |
|
|
|
type.value = 'codeLogin'; |
|
|
|
type.value = 'codeLogin'; |
|
|
@ -461,8 +412,8 @@ |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped> |
|
|
|
<style lang="less" scoped> |
|
|
|
@import '/@/assets/loginmini/style/home.less'; |
|
|
|
@import '../../../assets/loginmini/style/home.less'; |
|
|
|
@import '/@/assets/loginmini/style/base.less'; |
|
|
|
@import '../../../assets/loginmini/style/base.less'; |
|
|
|
|
|
|
|
|
|
|
|
:deep(.ant-input:focus) { |
|
|
|
:deep(.ant-input:focus) { |
|
|
|
box-shadow: none; |
|
|
|
box-shadow: none; |
|
|
@ -489,10 +440,6 @@ |
|
|
|
color: #aaa !important; |
|
|
|
color: #aaa !important; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
:deep(.jeecg-dark-switch){ |
|
|
|
|
|
|
|
position:absolute; |
|
|
|
|
|
|
|
margin-right: 10px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.aui-link-login{ |
|
|
|
.aui-link-login{ |
|
|
|
height: 42px; |
|
|
|
height: 42px; |
|
|
|
padding: 10px 15px; |
|
|
|
padding: 10px 15px; |
|
|
|