提交 47ad09f5 authored 作者: jinrb's avatar jinrb

绑定建设用地账号

上级 8b2707d7
......@@ -5,8 +5,8 @@
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
</div>
</div>
<a-card v-else title="绑定粤政易账号" style="width: 300px">
<a-form :model="formState" name="绑定粤政易账号" @finish="onFinish" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off">
<a-card v-else title="绑定建设用地账号" style="width: 420px">
<a-form :model="formState" name="绑定建设用地账号" @finish="onFinish" :label-col="{ span: 6 }" :wrapper-col="{ span: 16 }" autocomplete="off">
<a-form-item label="账号" name="username" :rules="[{ required: true, message: '请输入账号' }]">
<a-input placeholder="请输入污染地块登录账号" v-model:value="formState.username" />
</a-form-item>
......@@ -14,8 +14,8 @@
<a-form-item label="密码" name="password" :rules="[{ required: true, message: '请输入密码' }]">
<a-input-password placeholder="请输入污染地块登录密码" v-model:value="formState.password" />
</a-form-item>
<a-form-item :wrapper-col="{ offset: 8, span: 16 }">
<a-button type="primary" html-type="submit">绑定</a-button>
<a-form-item :wrapper-col="{ offset: 6, span: 16 }">
<a-button type="primary" html-type="submit" style="width: 100%;">绑定</a-button>
</a-form-item>
</a-form>
</a-card>
......@@ -128,6 +128,17 @@ function onFinish() {
// }
</script>
<style>
.app-loading .ant-card-head-title {
text-align: center;
color: #0065cc;
}
.app-loading .ant-form-item-control-input-content{
text-align: center;
}
</style>
<style scoped>
html[data-theme='dark'] .app-loading {
background-color: #2c344a;
......
......@@ -9,75 +9,74 @@
</div>
<div class="aui-form">
<div class="aui-formBox">
<div class="aui-formWell">
<a-tabs v-model:activeKey="activeKey" @change="changeTab">
<a-tab-pane key="1" tab="建设用地账号登录">
<!-- <div class="aui-flex aui-form-nav investment_title">
<div class="aui-flex-box">{{ t('sys.login.signInFormTitle') }} </div>
</div> -->
<div class="aui-form-box" style="height: 260px">
<a-form ref="loginRef" :model="formData" v-if="activeIndex === 'accountLogin'" @keyup.enter.native="loginHandleClick">
<div class="aui-account">
<div class="aui-inputClear">
<i class="icon icon-code"></i>
<a-form-item>
<a-input class="fix-auto-fill" :placeholder="t('sys.login.userName')" v-model:value="formData.username" />
</a-form-item>
</div>
<div class="aui-inputClear">
<i class="icon icon-password"></i>
<a-form-item>
<a-input-password class="fix-auto-fill" :placeholder="t('sys.login.password')" v-model:value="formData.password" />
</a-form-item>
</div>
<div class="aui-inputClear">
<a-form-item>
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.inputCode')" v-model:value="formData.inputCode" />
</a-form-item>
<div class="aui-code">
<img v-if="randCodeData.requestCodeSuccess" :src="randCodeData.randCodeImage" @click="handleChangeCheckCode" />
<img v-else style="margin-top: 2px; max-width: initial" :src="codeImg" @click="handleChangeCheckCode" />
<!-- <div class="aui-flex aui-form-nav investment_title">
<div class="aui-flex-box">{{ t('sys.login.signInFormTitle') }} </div>
</div> -->
<div class="aui-form-box" style="height: 260px">
<a-form ref="loginRef" :model="formData" v-if="activeIndex === 'accountLogin'" @keyup.enter.native="loginHandleClick">
<div class="aui-account">
<div class="aui-inputClear">
<i class="icon icon-code"></i>
<a-form-item>
<a-input class="fix-auto-fill" :placeholder="t('sys.login.userName')" v-model:value="formData.username" />
</a-form-item>
</div>
<div class="aui-inputClear">
<i class="icon icon-password"></i>
<a-form-item>
<a-input-password class="fix-auto-fill" :placeholder="t('sys.login.password')" v-model:value="formData.password" />
</a-form-item>
</div>
<div class="aui-inputClear">
<a-form-item>
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.inputCode')" v-model:value="formData.inputCode" />
</a-form-item>
<div class="aui-code">
<img v-if="randCodeData.requestCodeSuccess" :src="randCodeData.randCodeImage" @click="handleChangeCheckCode" />
<img v-else style="margin-top: 2px; max-width: initial" :src="codeImg" @click="handleChangeCheckCode" />
</div>
</div>
</div>
</div>
</a-form>
</div>
</a-form>
</div>
</a-tab-pane>
<a-tab-pane key="2" tab="粤政易账号登录">
<a-tab-pane key="2" tab="智慧云平台登录" v-if="isgld">
<!-- <div class="aui-flex aui-form-nav investment_title">
<div class="aui-flex-box">{{ t('sys.login.signInFormTitle') }} </div>
</div> -->
<div class="aui-form-box" style="height: 260px">
<a-form ref="loginRef" :model="formData" v-if="activeIndex === 'accountLogin'" @keyup.enter.native="loginHandleClick">
<div class="aui-account">
<div class="aui-inputClear">
<i class="icon icon-code"></i>
<a-form-item>
<a-input class="fix-auto-fill" :placeholder="t('sys.login.userName')" v-model:value="formData.username" />
</a-form-item>
</div>
<div class="aui-inputClear">
<i class="icon icon-password"></i>
<a-form-item>
<a-input-password class="fix-auto-fill" :placeholder="t('sys.login.password')" v-model:value="formData.password" />
</a-form-item>
</div>
<div class="aui-inputClear">
<a-form-item>
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.inputCode')" v-model:value="formData.inputCode" />
</a-form-item>
<div class="aui-code">
<img v-if="randCodeData.requestCodeSuccess" :src="randCodeData.randCodeImage" @click="handleChangeCheckCode" />
<img v-else style="margin-top: 2px; max-width: initial" :src="codeImg" @click="handleChangeCheckCode" />
<div class="aui-flex-box">{{ t('sys.login.signInFormTitle') }} </div>
</div> -->
<div class="aui-form-box" style="height: 260px" v-if="false">
<a-form ref="loginRef" :model="formData" v-if="activeIndex === 'accountLogin'" @keyup.enter.native="loginHandleClick">
<div class="aui-account">
<div class="aui-inputClear">
<i class="icon icon-code"></i>
<a-form-item>
<a-input class="fix-auto-fill" :placeholder="t('sys.login.userName')" v-model:value="formData.username" />
</a-form-item>
</div>
<div class="aui-inputClear">
<i class="icon icon-password"></i>
<a-form-item>
<a-input-password class="fix-auto-fill" :placeholder="t('sys.login.password')" v-model:value="formData.password" />
</a-form-item>
</div>
<div class="aui-inputClear">
<a-form-item>
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.inputCode')" v-model:value="formData.inputCode" />
</a-form-item>
<div class="aui-code">
<img v-if="randCodeData.requestCodeSuccess" :src="randCodeData.randCodeImage" @click="handleChangeCheckCode" />
<img v-else style="margin-top: 2px; max-width: initial" :src="codeImg" @click="handleChangeCheckCode" />
</div>
</div>
</div>
</div>
</a-form>
</div>
</a-form>
</div>
</a-tab-pane>
</a-tabs>
<!-- 登录按钮 -->
<div class="aui-formButton">
<div class="aui-flex">
......@@ -96,332 +95,374 @@
</div>
</template>
<script lang="ts" setup name="login-mini">
import { getCodeInfo } from '/@/api/sys/user';
import { onMounted, reactive, ref, toRaw, unref } from 'vue';
import codeImg from '/@/assets/images/checkcode.png';
import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { useDesign } from '/@/hooks/web/useDesign';
import { RsaParams } from '/@/utils/rsa.js';
const { prefixCls } = useDesign('mini-login');
const { notification, createMessage } = useMessage();
const userStore = useUserStore();
const { t } = useI18n();
const randCodeData = reactive<any>({
randCodeImage: '',
requestCodeSuccess: false,
checkKey: null,
});
//手机号登录还是账号登录
const activeIndex = ref<string>('accountLogin');
const type = ref<string>('login');
//账号登录表单字段
const formData = reactive<any>({
import { getCodeInfo } from '/@/api/sys/user';
import { onMounted, reactive, ref, toRaw, unref } from 'vue';
import codeImg from '/@/assets/images/checkcode.png';
import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { useDesign } from '/@/hooks/web/useDesign';
import { RsaParams } from '/@/utils/rsa.js';
import { router } from '/@/router';
const { prefixCls } = useDesign('mini-login');
const { notification, createMessage } = useMessage();
const userStore = useUserStore();
const { t } = useI18n();
const randCodeData = reactive<any>({
randCodeImage: '',
requestCodeSuccess: false,
checkKey: null,
});
//手机号登录还是账号登录
const activeIndex = ref<string>('accountLogin');
const type = ref<string>('login');
//账号登录表单字段
const formData = reactive<any>({
inputCode: '',
username: '',
password: '',
url: '',
});
//手机登录表单字段
const activeKey = ref('1');
const loginRef = ref();
const isgld = ref(false);
const loginLoading = ref<boolean>(false);
defineProps({
sessionTimeout: {
type: Boolean,
},
});
function changeTab(e) {
console.log(e,'防守打法')
if (e == 2) {
router.push({path:'/tokenLogin'})
return
}
formData.value = {
inputCode: '',
username: '',
password: '',
url:'',
url: '',
};
}
/**
* 获取验证码
*/
function handleChangeCheckCode() {
formData.inputCode = '';
randCodeData.checkKey = 1629428467008;
getCodeInfo(randCodeData.checkKey).then((res) => {
randCodeData.randCodeImage = res;
randCodeData.requestCodeSuccess = true;
});
//手机登录表单字段
const activeKey = ref('1');
}
const loginRef = ref();
const loginLoading = ref<boolean>(false);
defineProps({
sessionTimeout: {
type: Boolean,
},
});
function changeTab() {
formData.value = {
inputCode: '',
username: '',
password: '',
url:'',
}
async function loginHandleClick() {
if (unref(activeIndex) === 'accountLogin') {
accountLogin();
}
}
/**
* 获取验证码
*/
function handleChangeCheckCode() {
formData.inputCode = '';
randCodeData.checkKey = 1629428467008;
getCodeInfo(randCodeData.checkKey).then((res) => {
randCodeData.randCodeImage = res;
randCodeData.requestCodeSuccess = true;
});
async function accountLogin() {
if (!formData.username) {
createMessage.warn(t('sys.login.accountPlaceholder'));
return;
}
async function loginHandleClick() {
if (unref(activeIndex) === 'accountLogin') {
accountLogin();
}
if (!formData.password) {
createMessage.warn(t('sys.login.passwordPlaceholder'));
return;
}
async function accountLogin() {
if (!formData.username) {
createMessage.warn(t('sys.login.accountPlaceholder'));
return;
}
if (!formData.password) {
createMessage.warn(t('sys.login.passwordPlaceholder'));
return;
}
try {
loginLoading.value = true;
if (activeKey.value == '1') {
const { userInfo }: any = await userStore.login(
toRaw({
password: RsaParams(formData.password),
username: RsaParams(formData.username),
url: RsaParams(formData.url),
captcha: formData.inputCode,
checkKey: randCodeData.checkKey,
mode: 'none', //不要默认的错误提示
})
);
if (userInfo) {
userStore.setUserInfo(userInfo);
notification.success({
message: t('sys.login.loginSuccessTitle'),
description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.realname}`,
duration: 3,
});
}
} else {
const { userInfo }: any = await userStore.yzylogin(
toRaw({
password: RsaParams(formData.password),
username: RsaParams(formData.username),
url: RsaParams(formData.url),
captcha: formData.inputCode,
checkKey: randCodeData.checkKey,
mode: 'none', //不要默认的错误提示
})
);
if (userInfo) {
userStore.setUserInfo(userInfo);
notification.success({
message: t('sys.login.loginSuccessTitle'),
description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.realname}`,
duration: 3,
});
}
try {
loginLoading.value = true;
if (activeKey.value == '1') {
const { userInfo }: any = await userStore.login(
toRaw({
password: RsaParams(formData.password),
username: RsaParams(formData.username),
url: RsaParams(formData.url),
captcha: formData.inputCode,
checkKey: randCodeData.checkKey,
mode: 'none', //不要默认的错误提示
})
);
if (userInfo) {
userStore.setUserInfo(userInfo);
notification.success({
message: t('sys.login.loginSuccessTitle'),
description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.realname}`,
duration: 3,
});
}
} else {
const { userInfo }: any = await userStore.yzylogin(
toRaw({
password: RsaParams(formData.password),
username: RsaParams(formData.username),
url: RsaParams(formData.url),
captcha: formData.inputCode,
checkKey: randCodeData.checkKey,
mode: 'none', //不要默认的错误提示
})
);
if (userInfo) {
userStore.setUserInfo(userInfo);
notification.success({
message: t('sys.login.loginSuccessTitle'),
description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.realname}`,
duration: 3,
});
}
} catch (error: any) {
notification.error({
message: t('sys.api.errorTip'),
description: error?.message || t('sys.login.networkExceptionMsg'),
duration: 3,
});
handleChangeCheckCode();
} finally {
loginLoading.value = false;
}
}
onMounted(() => {
//加载验证码
} catch (error: any) {
notification.error({
message: t('sys.api.errorTip'),
description: error?.message || t('sys.login.networkExceptionMsg'),
duration: 3,
});
handleChangeCheckCode();
formData.url = window.location.href
});
} finally {
loginLoading.value = false;
}
}
onMounted(() => {
//加载验证码
handleChangeCheckCode();
formData.url = window.location.href;
if (window.location.href.indexOf("jsydgld") > -1) {
isgld.value = true
}
});
</script>
<style lang="less" scoped>
@import '/@/assets/loginmini/style/home.less';
@import '/@/assets/loginmini/style/base.less';
:deep(.ant-input:focus) {
box-shadow: none;
@import '/@/assets/loginmini/style/home.less';
@import '/@/assets/loginmini/style/base.less';
:deep(.ant-input:focus) {
box-shadow: none;
}
.ant-input-affix-wrapper-focused{
border: none!important;
}
.ant-input-affix-wrapper{
border: none!important;
box-shadow: none!important;
margin-left: 20px;
width: calc(100% - 20px);
background: #ffffff;
.ant-input{
background: #ffffff!important;
box-shadow: none!important;
}
.aui-get-code {
float: right;
position: relative;
z-index: 3;
background: @white;
color: #1573e9;
border-radius: 100px;
padding: 5px 16px;
margin: 7px;
border: 1px solid #1573e9;
top: 12px;
}
.aui-inputClear {
background-color: #ffffff !important;
.fix-auto-fill{
background-color: #ffffff !important;
}
input:-webkit-autofill {
box-shadow: none!important;
}
}
.aui-get-code {
float: right;
position: relative;
z-index: 3;
background: @white;
color: #1573e9;
border-radius: 100px;
padding: 5px 16px;
margin: 7px;
border: 1px solid #1573e9;
top: 12px;
}
.aui-get-code:hover {
color: #1573e9;
}
.code-shape {
border-color: #dadada !important;
color: #aaa !important;
}
:deep(.jeecg-dark-switch) {
position: absolute;
margin-right: 10px;
}
.aui-link-login {
height: 55px;
padding: 10px 1px;
font-size: 14px;
border-radius: 25px;
margin-top: 0px;
margin-bottom: 8px;
font-size: 20px;
font-weight: bold;
}
.aui-phone-logo {
position: absolute;
margin-left: 10px;
width: 60px;
top: 2px;
z-index: 4;
}
.top-3 {
top: 0.45rem;
}
.login-title {
height: 77px;
display: flex;
justify-content: center;
img {
width: 75px;
height: 75px;
margin-right: 20px;
}
.aui-get-code:hover {
color: #1573e9;
span {
color: #fff;
font-size: 45px;
}
.code-shape {
border-color: #dadada !important;
color: #aaa !important;
}
margin-bottom: 50px;
}
</style>
:deep(.jeecg-dark-switch) {
position: absolute;
margin-right: 10px;
}
<style lang="less">
@prefix-cls: ~'@{namespace}-mini-login';
@dark-bg: #293146;
.aui-link-login {
height: 55px;
padding: 10px 1px;
font-size: 14px;
border-radius: 25px;
margin-top: 0px;
margin-bottom: 8px;
font-size: 20px;
font-weight: bold;
}
html[data-theme='dark'] {
.@{prefix-cls} {
background-color: @dark-bg !important;
background-image: none;
.aui-phone-logo {
position: absolute;
margin-left: 10px;
width: 60px;
top: 2px;
z-index: 4;
}
.top-3 {
top: 0.45rem;
}
&::before {
background-image: url(/@/assets/svg/login-bg-dark.svg);
}
.login-title {
height: 77px;
display: flex;
justify-content: center;
.aui-inputClear {
background-color: #232a3b !important;
}
img {
width: 75px;
height: 75px;
margin-right: 20px;
.ant-input,
.ant-input-password {
background-color: #232a3b !important;
}
span {
color: #fff;
font-size: 45px;
.ant-btn:not(.ant-btn-link):not(.ant-btn-primary) {
border: 1px solid #4a5569 !important;
}
margin-bottom: 50px;
}
</style>
&-form {
background: @dark-bg !important;
}
<style lang="less">
@prefix-cls: ~'@{namespace}-mini-login';
@dark-bg: #293146;
.app-iconify {
color: #fff !important;
}
.ant-tabs-tab{
font-size: 22px;
font-weight: bold;
flex: 1;
justify-content: center;
}
.ant-tabs-nav-wrap, .ant-tabs-nav-list{
width: 100%;
}
.aui-inputClear input,
.aui-input-line input,
.aui-choice {
color: #c9d1d9 !important;
}
html[data-theme='dark'] {
.@{prefix-cls} {
.aui-formBox {
background-color: @dark-bg !important;
background-image: none;
&::before {
background-image: url(/@/assets/svg/login-bg-dark.svg);
}
.aui-inputClear {
background-color: #232a3b !important;
}
.ant-input,
.ant-input-password {
background-color: #232a3b !important;
}
.ant-btn:not(.ant-btn-link):not(.ant-btn-primary) {
border: 1px solid #4a5569 !important;
}
&-form {
background: @dark-bg !important;
}
.app-iconify {
color: #fff !important;
}
.aui-inputClear input,
.aui-input-line input,
.aui-choice {
color: #c9d1d9 !important;
}
.aui-formBox {
background-color: @dark-bg !important;
}
.aui-third-text span {
background-color: @dark-bg !important;
}
}
.aui-form-nav .aui-flex-box {
color: #c9d1d9 !important;
}
.aui-third-text span {
background-color: @dark-bg !important;
}
.aui-formButton .aui-linek-code {
background: @dark-bg !important;
color: white !important;
}
.aui-form-nav .aui-flex-box {
color: #c9d1d9 !important;
}
.aui-code-line {
border-left: none !important;
}
.aui-formButton .aui-linek-code {
background: @dark-bg !important;
color: white !important;
}
.ant-checkbox-inner,
.aui-success h3 {
border-color: #c9d1d9;
}
.aui-code-line {
border-left: none !important;
}
input.fix-auto-fill,
.fix-auto-fill input {
-webkit-text-fill-color: #c9d1d9 !important;
box-shadow: inherit !important;
.ant-checkbox-inner,
.aui-success h3 {
border-color: #c9d1d9;
}
}
&-sign-in-way {
.anticon {
font-size: 22px !important;
color: #888 !important;
cursor: pointer !important;
input.fix-auto-fill,
.fix-auto-fill input {
-webkit-text-fill-color: #c9d1d9 !important;
box-shadow: inherit !important;
}
&:hover {
color: @primary-color !important;
}
&-sign-in-way {
.anticon {
font-size: 22px !important;
color: #888 !important;
cursor: pointer !important;
&:hover {
color: @primary-color !important;
}
}
}
.ant-divider-inner-text {
font-size: 12px !important;
color: @text-color-secondary !important;
}
.ant-divider-inner-text {
font-size: 12px !important;
color: @text-color-secondary !important;
}
.aui-third-login a {
background: transparent;
}
.aui-third-login a {
background: transparent;
}
}
.login-background-img {
.ant-tabs-tab, .ant-tabs-tab-active{
color: #666;
}
.ant-tabs-tab{
font-weight: 400;
}
.aui-formButton {
.ant-btn-primary {
border-color: #3183ff;
background: #3183ff;
}
.ant-btn-primary {
border-color: #3183ff;
background: #3183ff;
}
}
.ant-tabs-tab {
font-size: 22px;
font-weight: bold;
flex: 1;
justify-content: center;
}
.ant-tabs-nav-wrap,
.ant-tabs-nav-list {
width: 100%;
}
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论