提交代码
This commit is contained in:
parent
039a51fc3b
commit
03a7f9b915
|
@ -1,15 +1,15 @@
|
||||||
# 是否打开mock
|
# 是否打开mock
|
||||||
VITE_USE_MOCK = true
|
VITE_USE_MOCK = false
|
||||||
|
|
||||||
# 发布路径
|
# 发布路径
|
||||||
VITE_PUBLIC_PATH = /
|
VITE_PUBLIC_PATH = /
|
||||||
|
|
||||||
|
|
||||||
# 跨域代理,您可以配置多个 ,请注意,没有换行符
|
# 跨域代理,您可以配置多个 ,请注意,没有换行符
|
||||||
VITE_PROXY = [["/jeecgboot","http://localhost:8081/jeecg-boot"],["/upload","http://localhost:3300/upload"]]
|
VITE_PROXY = [["/jeecgboot","http://pbl.natapp1.cc"],["/upload","http://localhost:3300/upload"]]
|
||||||
|
|
||||||
#后台接口全路径地址(必填)
|
#后台接口全路径地址(必填)
|
||||||
VITE_GLOB_DOMAIN_URL=http://localhost:8081/jeecg-boot
|
VITE_GLOB_DOMAIN_URL=http://pbl.natapp1.cc
|
||||||
|
|
||||||
#后台接口父地址(必填)
|
#后台接口父地址(必填)
|
||||||
VITE_GLOB_API_URL=/jeecgboot
|
VITE_GLOB_API_URL=/jeecgboot
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
.aui-content {
|
.aui-content {
|
||||||
padding: 40px 60px;
|
padding: 40px 60px;
|
||||||
min-height: 100vh;
|
min-height: calc(100vh - 25px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.aui-container {
|
.aui-container {
|
||||||
|
|
|
@ -7,12 +7,12 @@
|
||||||
<div class="aui-container">
|
<div class="aui-container">
|
||||||
<div class="aui-form">
|
<div class="aui-form">
|
||||||
<div class="aui-formBox">
|
<div class="aui-formBox">
|
||||||
<div class="aui-formWell">
|
<div class="aui-formWell">
|
||||||
|
<div
|
||||||
<div style="width: 100%;margin-bottom: 25px;">
|
style="display: flex; width: 410px; margin-bottom: 25px; margin-left: 96px; justify-content: center;">
|
||||||
<img :src="logoImg" style="margin: 0 auto;" />
|
<img :src="logoImg" />
|
||||||
</div>
|
</div>
|
||||||
<div class="aui-flex aui-form-nav investment_title">
|
<div class="aui-flex aui-form-nav investment_title" style="margin-left: 78px;">
|
||||||
<div class="logoTitle">放射性源项分析系统</div>
|
<div class="logoTitle">放射性源项分析系统</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="aui-form-box" style="height: 252px">
|
<div class="aui-form-box" style="height: 252px">
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
<a-input class="fix-auto-fill" type="checkbox" v-model:value="rememberMe" />
|
<a-input class="fix-auto-fill" type="checkbox" v-model:value="rememberMe" />
|
||||||
<span style="margin-left: 5px">{{ t('sys.login.rememberMe') }}</span>
|
<span style="margin-left: 5px">{{ t('sys.login.rememberMe') }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-form>
|
</a-form>
|
||||||
|
@ -88,75 +88,39 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup name="login-mini">
|
<script lang="ts" setup name="login-mini">
|
||||||
import { getCaptcha, getCodeInfo } from '/@/api/sys/user';
|
import { getCodeInfo } from '/@/api/sys/user';
|
||||||
import { computed, onMounted, reactive, ref, toRaw, unref } from 'vue';
|
import { onMounted, reactive, ref, toRaw } from 'vue';
|
||||||
import codeImg from '/@/assets/images/checkcode.png';
|
import codeImg from '/@/assets/images/checkcode.png';
|
||||||
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 { SmsEnum } from '/@/views/sys/login/useLogin';
|
|
||||||
import ThirdModal from '/@/views/sys/login/ThirdModal.vue';
|
import ThirdModal from '/@/views/sys/login/ThirdModal.vue';
|
||||||
import MiniForgotpad from './MiniForgotpad.vue';
|
|
||||||
import MiniRegister from './MiniRegister.vue';
|
|
||||||
import MiniCodelogin from './MiniCodelogin.vue';
|
|
||||||
import logoImg from '/@/assets/loginmini/icon/logo.png';
|
import logoImg from '/@/assets/loginmini/icon/logo.png';
|
||||||
import adTextImg from '/@/assets/loginmini/icon/jeecg_ad_text.png';
|
|
||||||
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 { GithubFilled, WechatFilled, DingtalkCircleFilled, createFromIconfontCN } from '@ant-design/icons-vue';
|
|
||||||
import CaptchaModal from '@/components/jeecg/captcha/CaptchaModal.vue';
|
import CaptchaModal from '@/components/jeecg/captcha/CaptchaModal.vue';
|
||||||
import { useModal } from "@/components/Modal";
|
import { useModal } from "@/components/Modal";
|
||||||
import { ExceptionEnum } from "@/enums/exceptionEnum";
|
|
||||||
|
|
||||||
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();
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
const localeStore = useLocaleStore();
|
|
||||||
const showLocale = localeStore.getShowPicker;
|
|
||||||
const randCodeData = reactive<any>({
|
const randCodeData = reactive<any>({
|
||||||
randCodeImage: '',
|
randCodeImage: '',
|
||||||
requestCodeSuccess: false,
|
requestCodeSuccess: false,
|
||||||
checkKey: null,
|
checkKey: null,
|
||||||
});
|
});
|
||||||
const rememberMe = ref<string>('0');
|
const rememberMe = ref<string>('0');
|
||||||
//手机号登录还是账号登录
|
|
||||||
// const activeIndex = ref<string>('accountLogin');
|
|
||||||
const type = ref<string>('login');
|
|
||||||
//账号登录表单字段
|
//账号登录表单字段
|
||||||
const formData = reactive<any>({
|
const formData = reactive<any>({
|
||||||
inputCode: '',
|
inputCode: '',
|
||||||
username: 'admin',
|
username: 'admin',
|
||||||
password: '123456',
|
password: '123456',
|
||||||
});
|
});
|
||||||
//手机登录表单字段
|
|
||||||
const phoneFormData = reactive<any>({
|
|
||||||
mobile: '',
|
|
||||||
smscode: '',
|
|
||||||
});
|
|
||||||
const loginRef = ref();
|
const loginRef = ref();
|
||||||
//第三方登录弹窗
|
//第三方登录弹窗
|
||||||
const thirdModalRef = ref();
|
const thirdModalRef = ref();
|
||||||
//扫码登录
|
|
||||||
const codeRef = ref();
|
|
||||||
//是否显示获取验证码
|
|
||||||
const showInterval = ref<boolean>(true);
|
|
||||||
//60s
|
|
||||||
const timeRuning = ref<number>(60);
|
|
||||||
//定时器
|
|
||||||
const timer = ref<any>(null);
|
|
||||||
//忘记密码
|
|
||||||
const forgotRef = ref();
|
|
||||||
//注册
|
|
||||||
const registerRef = ref();
|
|
||||||
const loginLoading = ref<boolean>(false);
|
const loginLoading = ref<boolean>(false);
|
||||||
const { getIsMobile } = useAppInject();
|
|
||||||
const [captchaRegisterModal, { openModal: openCaptchaModal }] = useModal();
|
const [captchaRegisterModal, { openModal: openCaptchaModal }] = useModal();
|
||||||
defineProps({
|
defineProps({
|
||||||
sessionTimeout: {
|
sessionTimeout: {
|
||||||
|
@ -178,23 +142,11 @@ function handleChangeCheckCode() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 切换登录方式
|
|
||||||
*/
|
|
||||||
function loginClick(type) {
|
|
||||||
activeIndex.value = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号或者手机登录
|
* 账号或者手机登录
|
||||||
*/
|
*/
|
||||||
async function loginHandleClick() {
|
async function loginHandleClick() {
|
||||||
if (unref(activeIndex) === 'accountLogin') {
|
accountLogin();
|
||||||
accountLogin();
|
|
||||||
} else {
|
|
||||||
//手机号登录
|
|
||||||
phoneLogin();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function accountLogin() {
|
async function accountLogin() {
|
||||||
|
@ -236,134 +188,6 @@ async function accountLogin() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号登录
|
|
||||||
*/
|
|
||||||
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({
|
|
||||||
message: t('sys.login.loginSuccessTitle'),
|
|
||||||
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,
|
|
||||||
});
|
|
||||||
} finally {
|
|
||||||
loginLoading.value = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取手机验证码
|
|
||||||
*/
|
|
||||||
async function getLoginCode() {
|
|
||||||
if (!phoneFormData.mobile) {
|
|
||||||
createMessage.warn(t('sys.login.mobilePlaceholder'));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
//update-begin---author:wangshuai---date:2024-04-18---for:【QQYUN-9005】同一个IP,1分钟超过5次短信,则提示需要验证码---
|
|
||||||
const result = await getCaptcha({ mobile: phoneFormData.mobile, smsmode: SmsEnum.FORGET_PASSWORD }).catch((res) => {
|
|
||||||
if (res.code === ExceptionEnum.PHONE_SMS_FAIL_CODE) {
|
|
||||||
openCaptchaModal(true, {});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//update-end---author:wangshuai---date:2024-04-18---for:【QQYUN-9005】同一个IP,1分钟超过5次短信,则提示需要验证码---
|
|
||||||
if (result) {
|
|
||||||
const TIME_COUNT = 60;
|
|
||||||
if (!unref(timer)) {
|
|
||||||
timeRuning.value = TIME_COUNT;
|
|
||||||
showInterval.value = false;
|
|
||||||
timer.value = setInterval(() => {
|
|
||||||
if (unref(timeRuning) > 0 && unref(timeRuning) <= TIME_COUNT) {
|
|
||||||
timeRuning.value = timeRuning.value - 1;
|
|
||||||
} else {
|
|
||||||
showInterval.value = true;
|
|
||||||
clearInterval(unref(timer));
|
|
||||||
timer.value = null;
|
|
||||||
}
|
|
||||||
}, 1000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 第三方登录
|
|
||||||
* @param type
|
|
||||||
*/
|
|
||||||
function onThirdLogin(type) {
|
|
||||||
thirdModalRef.value.onThirdLogin(type);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 忘记密码
|
|
||||||
*/
|
|
||||||
function forgetHandelClick() {
|
|
||||||
type.value = 'forgot';
|
|
||||||
setTimeout(() => {
|
|
||||||
forgotRef.value.initForm();
|
|
||||||
}, 300);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 返回登录页面
|
|
||||||
*/
|
|
||||||
function goBack() {
|
|
||||||
activeIndex.value = 'accountLogin';
|
|
||||||
type.value = 'login';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 忘记密码/注册账号回调事件
|
|
||||||
* @param value
|
|
||||||
*/
|
|
||||||
function handleSuccess(value) {
|
|
||||||
Object.assign(formData, value);
|
|
||||||
Object.assign(phoneFormData, { mobile: "", smscode: "" });
|
|
||||||
type.value = 'login';
|
|
||||||
activeIndex.value = 'accountLogin';
|
|
||||||
handleChangeCheckCode();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 注册
|
|
||||||
*/
|
|
||||||
function registerHandleClick() {
|
|
||||||
type.value = 'register';
|
|
||||||
setTimeout(() => {
|
|
||||||
registerRef.value.initForm();
|
|
||||||
}, 300);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 注册
|
|
||||||
*/
|
|
||||||
function codeHandleClick() {
|
|
||||||
type.value = 'codeLogin';
|
|
||||||
setTimeout(() => {
|
|
||||||
codeRef.value.initFrom();
|
|
||||||
}, 300);
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
//加载验证码
|
//加载验证码
|
||||||
handleChangeCheckCode();
|
handleChangeCheckCode();
|
||||||
|
@ -421,7 +245,8 @@ onMounted(() => {
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
.aui-link-login:hover{
|
|
||||||
|
.aui-link-login:hover {
|
||||||
color: #ffffff !important;
|
color: #ffffff !important;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.61);
|
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.61);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user