提交代码

This commit is contained in:
wangchengming 2025-08-13 12:56:12 +08:00
parent 039a51fc3b
commit 03a7f9b915
3 changed files with 15 additions and 190 deletions

View File

@ -1,15 +1,15 @@
# 是否打开mock
VITE_USE_MOCK = true
VITE_USE_MOCK = false
# 发布路径
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

View File

@ -1,6 +1,6 @@
.aui-content {
padding: 40px 60px;
min-height: 100vh;
min-height: calc(100vh - 25px);
}
.aui-container {

View File

@ -7,12 +7,12 @@
<div class="aui-container">
<div class="aui-form">
<div class="aui-formBox">
<div class="aui-formWell">
<div style="width: 100%;margin-bottom: 25px;">
<img :src="logoImg" style="margin: 0 auto;" />
<div class="aui-formWell">
<div
style="display: flex; width: 410px; margin-bottom: 25px; margin-left: 96px; justify-content: center;">
<img :src="logoImg" />
</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>
<div class="aui-form-box" style="height: 252px">
@ -57,7 +57,7 @@
<a-input class="fix-auto-fill" type="checkbox" v-model:value="rememberMe" />
<span style="margin-left: 5px">{{ t('sys.login.rememberMe') }}</span>
</div>
</div>
</div>
</div>
</div>
</a-form>
@ -88,75 +88,39 @@
</div>
</template>
<script lang="ts" setup name="login-mini">
import { getCaptcha, getCodeInfo } from '/@/api/sys/user';
import { computed, onMounted, reactive, ref, toRaw, unref } from 'vue';
import { getCodeInfo } from '/@/api/sys/user';
import { onMounted, reactive, ref, toRaw } from 'vue';
import codeImg from '/@/assets/images/checkcode.png';
import { Rule } from '/@/components/Form';
import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n';
import { SmsEnum } from '/@/views/sys/login/useLogin';
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 adTextImg from '/@/assets/loginmini/icon/jeecg_ad_text.png';
import { AppLocalePicker, AppDarkModeToggle } from '/@/components/Application';
import { useLocaleStore } from '/@/store/modules/locale';
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 { 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 { notification, createMessage } = useMessage();
const userStore = useUserStore();
const { t } = useI18n();
const localeStore = useLocaleStore();
const showLocale = localeStore.getShowPicker;
const randCodeData = reactive<any>({
randCodeImage: '',
requestCodeSuccess: false,
checkKey: null,
});
const rememberMe = ref<string>('0');
//
// const activeIndex = ref<string>('accountLogin');
const type = ref<string>('login');
//
const formData = reactive<any>({
inputCode: '',
username: 'admin',
password: '123456',
});
//
const phoneFormData = reactive<any>({
mobile: '',
smscode: '',
});
const loginRef = 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 { getIsMobile } = useAppInject();
const [captchaRegisterModal, { openModal: openCaptchaModal }] = useModal();
defineProps({
sessionTimeout: {
@ -178,23 +142,11 @@ function handleChangeCheckCode() {
});
}
/**
* 切换登录方式
*/
function loginClick(type) {
activeIndex.value = type;
}
/**
* 账号或者手机登录
*/
async function loginHandleClick() {
if (unref(activeIndex) === 'accountLogin') {
accountLogin();
} else {
//
phoneLogin();
}
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-9005IP15---
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-9005IP15---
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(() => {
//
handleChangeCheckCode();
@ -421,7 +245,8 @@ onMounted(() => {
background-size: 100% 100%;
background-repeat: no-repeat;
}
.aui-link-login:hover{
.aui-link-login:hover {
color: #ffffff !important;
background-color: transparent;
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.61);