diff --git a/txw-mhzc-web/src/pages/index/views/home2/assets/home-bg-0.mp4 b/txw-mhzc-web/src/pages/index/views/home2/assets/home-bg-0.mp4
new file mode 100644
index 0000000..fec84d6
Binary files /dev/null and b/txw-mhzc-web/src/pages/index/views/home2/assets/home-bg-0.mp4 differ
diff --git a/txw-mhzc-web/src/pages/index/views/home2/assets/home-bg-1.mp4 b/txw-mhzc-web/src/pages/index/views/home2/assets/home-bg-1.mp4
new file mode 100644
index 0000000..2e9fbd6
Binary files /dev/null and b/txw-mhzc-web/src/pages/index/views/home2/assets/home-bg-1.mp4 differ
diff --git a/txw-mhzc-web/src/pages/index/views/home2/index.vue b/txw-mhzc-web/src/pages/index/views/home2/index.vue
index 8a28fbc..5744641 100644
--- a/txw-mhzc-web/src/pages/index/views/home2/index.vue
+++ b/txw-mhzc-web/src/pages/index/views/home2/index.vue
@@ -4,10 +4,10 @@
-
-
-
+
+
+
@@ -281,10 +281,9 @@ export default {
hyzx: [], // 行业资讯
ptgg: [] // 平台公告
},
- topBannerImages: [
- require('@/pages/index/assets/home-top-bg1.jpg'),
- // require('@/pages/index/assets/home-top-bg2.jpg'),
- // require('@/pages/index/assets/home-top-bg3.jpg'),
+ topBannerVideos: [
+ require('@/pages/index/views/home2/assets/home-bg-0.mp4'),
+ require('@/pages/index/views/home2/assets/home-bg-1.mp4'),
],
capabilityList: [
{ name: '碳核算平台', icon: require('@/pages/index/assets/home-thspt-icon.png'), anchor: 'content-1' },
@@ -680,6 +679,12 @@ export default {
z-index: 0;
}
+.banner-video {
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+}
+
.banner-slide {
width: 100%;
height: 100%;
@@ -700,7 +705,7 @@ export default {
/* 指示条默认在底部,会被 .top-box-bottom-over 渐变盖住,上移避开 300px 渐变区 */
.top-box ::v-deep .t-swiper__navigation {
- bottom: 340px;
+ display: none;
}
.container {
diff --git a/txw-mhzc-web/src/pages/index/views/login/components/components-login.vue b/txw-mhzc-web/src/pages/index/views/login/components/components-login.vue
index 68c3d81..7934413 100644
--- a/txw-mhzc-web/src/pages/index/views/login/components/components-login.vue
+++ b/txw-mhzc-web/src/pages/index/views/login/components/components-login.vue
@@ -1,12 +1,12 @@
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
- {{ countDown === 0 ? '发送验证码' : `${countDown}秒后可重发` }}
-
+
+
+
-
-
-
-
{{ confirmWords }}
-
-
-
-
-
{{ confirmWords }}
-
+
+
+
+
+
+
+
+
+
@@ -86,16 +53,12 @@
import { removePassword, removeRememberMe, removeUsername } from '@/utils/auth';
import { UserIcon, LockOnIcon } from 'tdesign-icons-vue';
import { MessagePlugin } from 'tdesign-vue';
-import { getVerify, sendMsg } from '@/pages/index/api/login';
+import { getCaptcha } from '@/pages/index/api/login';
const FORM_RULES = {
- // mobile: [{ required: true, message: '手机号必填', type: 'error' }],
-
zsxm1: [{ required: true, message: '真实姓名必填', type: 'error' }],
dlzh: [{ required: true, message: '账号必填', type: 'error' }],
password: [{ required: true, message: '密码必填', type: 'error' }],
- sms: [{ required: true, message: '验证码必填', type: 'error' }],
- // mobileCode: [{ required: true, message: '验证码必填', type: 'error' }],
};
export default {
components: {
@@ -104,311 +67,127 @@ export default {
},
data() {
return {
- beginClientX: 0 /* 距离屏幕左端距离 */,
- mouseMoveState: false /* 触发拖动状态 判断 */,
- maxWidth: '' /* 拖动最大宽度,依据滑块宽度算出来的 */,
- confirmWords: '发送验证码前,请先拖动滑块' /* 滑块文字 */,
- confirmSuccess: false /* 验证成功判断 */,
- width: 350,
- height: 42,
- textSize: '18px',
+ // 图形验证码相关
+ captchaUuid: '',
+ captchaImage: '',
FORM_RULES,
loginForm: {
loginType: 'password',
dlzh: '',
password: '',
zsxm1: '',
+ captchaVerification: '',
+ captchaCode: '',
},
- countDown: 0,
- intervalTimer: null,
- isCounting: false, // 新增:标记是否正在倒计时
- iscxhk:false,
- ishkzs:false,
- ishqyzm:false,
};
},
- beforeDestroy() {
- clearInterval(this.intervalTimer);
- },
methods: {
async onSubmit() {
- if (this.loginForm.loginType === 'password') {
- if (!this.loginForm.dlzh) {
- MessagePlugin.info({
- content: '请输入手机号',
- duration: 1000,
- });
- return;
- }
- if (!this.loginForm.password) {
- MessagePlugin.info({
- content: '请输入密码',
- duration: 1000,
- });
- return;
- }
- if (!this.loginForm.zsxm1) {
- MessagePlugin.info({
- content: '请输入真实姓名',
- duration: 1000,
- });
- return;
- }
- if (!this.loginForm.sms) {
- MessagePlugin.info({
- content: '请输入验证码',
- duration: 1000,
- });
- return;
- }
- if(!this.ishqyzm){
- MessagePlugin.info({
+ if (!this.loginForm.dlzh) {
+ MessagePlugin.info({
+ content: '请输入手机号',
+ duration: 1000,
+ });
+ return;
+ }
+ if (!this.loginForm.password) {
+ MessagePlugin.info({
+ content: '请输入密码',
+ duration: 1000,
+ });
+ return;
+ }
+ if (!this.loginForm.zsxm1) {
+ MessagePlugin.info({
+ content: '请输入真实姓名',
+ duration: 1000,
+ });
+ return;
+ }
+ if (!this.captchaUuid) {
+ MessagePlugin.info({
content: '请先获取验证码',
duration: 1000,
});
return;
}
- } else {
+ if (!this.loginForm.captchaCode || this.loginForm.captchaCode.length !== 4) {
+ MessagePlugin.info({
+ content: '请输入4位验证码',
+ duration: 1000,
+ });
+ return;
}
- const { href } = window.location;
this.loading = true;
removeUsername();
removePassword();
removeRememberMe();
- // 发起登陆
this.$store
.dispatch('zhuce', this.loginForm)
.then(() => {
- console.log('111111');
- // this.$router.replace('/demo/demo').catch(() => '');
- // 本地之外
- // window.location.href = href.replace('sso/login', 'htgl/mhsy');
- // 本地
- // window.location.href = `/view/mhzc/glxtSy`;
this.$emit('zhucecg', true);
})
.catch((error) => {
- console.log('22222');
- // 登录失败时,如果正在倒计时,停止计时器并重置滑块
- // if (this.isCounting) {
- // this.stopAndResetTimer();
- // this.reSetSlider();
- // }
- if (this.isCounting) {
- this.stopAndResetTimer();
- }
- return;
- // if (error === 1004003) {
- // this.reSetSlider();
- // }
+ this.refreshCaptcha();
+ return;
});
},
-handleCounter() {
- if (!this.loginForm.dlzh) {
- MessagePlugin.info({
- content: '请输入手机号',
- duration: 1000,
- });
- return;
- }
- if (!this.confirmSuccess) {
- MessagePlugin.info({
- content: '请先完成滑块验证',
- duration: 1000,
- });
- return;
- }
- this.startCountDown();
- let params = {
- captchaVerification: this.loginForm.captchaVerification,
- sjhm1: this.loginForm.dlzh,
- }
- sendMsg(params).then((res) => {
- MessagePlugin.info({
- content: '发送成功',
- duration: 1000,
- });
- this.ishqyzm = true;
- }).catch((error) => {
- MessagePlugin.warning({
- content: '发送失败',
- duration: 1000,
- });
- // 发送失败时停止计时器并重置滑块(取消注释)
- this.stopAndResetTimer();
- // this.reSetSlider(); // 这个不需要了,因为 stopAndResetTimer() 已经调用了 reSetSlider()
- })
-},
-
- // 新增:开始倒计时方法
- startCountDown() {
- this.countDown = 60;
- this.isCounting = true;
- clearInterval(this.intervalTimer); // 清除之前的定时器
- this.intervalTimer = setInterval(() => {
- if (this.countDown > 0) {
- this.countDown -= 1;
- } else {
- this.stopAndResetTimer();
- }
- }, 1000);
- },
-
- // 新增:停止计时器并重置状态
-stopAndResetTimer() {
- clearInterval(this.intervalTimer);
- this.iscxhk = !this.iscxhk;
- this.intervalTimer = null;
- this.countDown = 0;
- this.isCounting = false;
- // 添加滑块重置逻辑
- this.reSetSlider();
-},
-
- // mousedown 事件
- mouseDown(e) {
- if (!this.confirmSuccess) {
- e.preventDefault && e.preventDefault(); // 阻止文字选中等 浏览器默认事件
- this.mouseMoveState = true;
- this.beginClientX = e.clientX;
- }
- },
- // 验证成功函数
- successFunction() {
- getVerify().then((res) => {
- this.loginForm.captchaVerification = res.data;
- this.confirmSuccess = true;
- this.confirmWords = '验证通过';
+ // 刷新图形验证码
+ refreshCaptcha() {
+ getCaptcha().then((res) => {
+ this.captchaUuid = res.data.uuid;
+ this.captchaImage = res.data.imageBase64;
+ this.loginForm.captchaVerification = res.data.uuid;
+ this.loginForm.captchaCode = '';
});
- this.removeMouseListeners();
- },
-
- // 新增:移除鼠标监听事件
- removeMouseListeners() {
- if (window.addEventListener) {
- document.getElementsByTagName('html')[0].removeEventListener('mousemove', this.mouseMoveFn);
- document.getElementsByTagName('html')[0].removeEventListener('mouseup', this.moseUpFn);
- } else {
- document.getElementsByTagName('html')[0].removeEventListener('mouseup', () => {});
- }
- document.getElementsByClassName('drag_text')[0].style.color = '#fff';
- document.getElementsByClassName('handler')[0].style.left = `${this.maxWidth}px`;
- document.getElementsByClassName('drag_bg')[0].style.width = `${this.maxWidth}px`;
- },
-
- // mousemove事件
- mouseMoveFn(e) {
- if (this.mouseMoveState) {
- const width = e.clientX - this.beginClientX;
- if (width > 0 && width <= this.maxWidth) {
- document.getElementsByClassName('handler')[0].style.left = `${width}px`;
- document.getElementsByClassName('drag_bg')[0].style.width = `${width}px`;
- } else if (width > this.maxWidth) {
- this.successFunction();
- }
- }
- },
- // mouseup事件
- moseUpFn(e) {
- this.mouseMoveState = false;
- const width = e.clientX - this.beginClientX;
- if (width < this.maxWidth) {
- document.getElementsByClassName('handler')[0].style.left = `${0}px`;
- document.getElementsByClassName('drag_bg')[0].style.width = `${0}px`;
- }
- },
- reSet() {
- this.formData.sfzhm = '';
- this.formData.xm = '';
- this.reSetSlider();
- },
- reSetSlider() {
- this.confirmSuccess = false;
- this.mouseMoveState = false;
- this.confirmWords = '请按住滑块,拖动到最右边';
- document.getElementsByClassName('handler')[0].style.left = `${0}px`;
- document.getElementsByClassName('drag_bg')[0].style.width = `${0}px`;
- document.getElementsByClassName('drag_text')[0].style.color = 'black';
-
- // 重新添加监听事件
- this.addMouseListeners();
- },
-
- // 新增:添加鼠标监听事件
- addMouseListeners() {
- document.getElementsByTagName('html')[0].addEventListener('mousemove', this.mouseMoveFn);
- document.getElementsByTagName('html')[0].addEventListener('mouseup', this.moseUpFn);
},
},
mounted() {
- // 计算滑块滑动最大值
- this.maxWidth = this.$refs.dragDiv.clientWidth - this.$refs.moveDiv.clientWidth;
- // 添加监听事件
- this.addMouseListeners();
+ this.refreshCaptcha();
},
};
diff --git a/txw-mhzc/txw-mhzc-service-biz/src/main/java/com/css/txw/mhzc/constants/ErrorCodeConstants.java b/txw-mhzc/txw-mhzc-service-biz/src/main/java/com/css/txw/mhzc/constants/ErrorCodeConstants.java
index de6fd91..76486ea 100644
--- a/txw-mhzc/txw-mhzc-service-biz/src/main/java/com/css/txw/mhzc/constants/ErrorCodeConstants.java
+++ b/txw-mhzc/txw-mhzc-service-biz/src/main/java/com/css/txw/mhzc/constants/ErrorCodeConstants.java
@@ -42,6 +42,6 @@ public interface ErrorCodeConstants {
ErrorCode YHXX_IS_EXISTS = new ErrorCode(1004020, "账号已存在");
-
+ ErrorCode REGISTER_CAPTCHA_CODE_ERROR = new ErrorCode(1004021, "验证码错误,请重新输入");
}
diff --git a/txw-mhzc/txw-mhzc-service-biz/src/main/java/com/css/txw/mhzc/pojo/vo/UserRegisterReqVO.java b/txw-mhzc/txw-mhzc-service-biz/src/main/java/com/css/txw/mhzc/pojo/vo/UserRegisterReqVO.java
index 766c67d..986f466 100644
--- a/txw-mhzc/txw-mhzc-service-biz/src/main/java/com/css/txw/mhzc/pojo/vo/UserRegisterReqVO.java
+++ b/txw-mhzc/txw-mhzc-service-biz/src/main/java/com/css/txw/mhzc/pojo/vo/UserRegisterReqVO.java
@@ -13,7 +13,9 @@ public class UserRegisterReqVO {
private String password;
@Schema(description = "真实姓名")
private String zsxm1;
+ @Schema(description = "验证码UUID")
+ private String captchaVerification;
@Schema(description = "验证码")
- private String sms;
+ private String captchaCode;
}
diff --git a/txw-mhzc/txw-mhzc-service-biz/src/main/java/com/css/txw/mhzc/service/impl/TxwMhzcYhxxbServiceImpl.java b/txw-mhzc/txw-mhzc-service-biz/src/main/java/com/css/txw/mhzc/service/impl/TxwMhzcYhxxbServiceImpl.java
index ef93d27..b458f65 100644
--- a/txw-mhzc/txw-mhzc-service-biz/src/main/java/com/css/txw/mhzc/service/impl/TxwMhzcYhxxbServiceImpl.java
+++ b/txw-mhzc/txw-mhzc-service-biz/src/main/java/com/css/txw/mhzc/service/impl/TxwMhzcYhxxbServiceImpl.java
@@ -3,6 +3,7 @@ package com.css.txw.mhzc.service.impl;
import static com.css.ggzc.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.css.txw.mhzc.constants.ErrorCodeConstants.OAUTH2_LOGIN_SJHM_NOT_EXISTS;
import static com.css.txw.mhzc.constants.ErrorCodeConstants.YHXX_IS_EXISTS;
+import static com.css.txw.mhzc.constants.ErrorCodeConstants.REGISTER_CAPTCHA_CODE_ERROR;
import java.util.Date;
import java.util.List;
@@ -15,10 +16,9 @@ import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.css.ggzc.framework.cache.utils.CacheUtils;
+import com.css.ggzc.framework.common.pojo.CommonResult;
import com.css.ggzc.framework.common.util.gy.GyUtils;
import com.css.ggzc.framework.common.util.object.BeanUtils;
-import com.css.ggzc.framework.redis.utils.RedisUtils;
import com.css.ggzc.framework.session.SessionUtils;
import com.css.txw.mhzc.mapper.TxwMhzcYhqygxbMapper;
import com.css.txw.mhzc.mapper.TxwMhzcYhxxbMapper;
@@ -35,6 +35,7 @@ import com.css.txw.mhzc.pojo.vo.UserVO;
import com.css.txw.mhzc.properties.MhzcProperties;
import com.css.txw.mhzc.service.TxwMhzcQyxxbService;
import com.css.txw.mhzc.service.TxwMhzcYhxxbService;
+import com.css.txw.sso.api.ISsoApi;
import cn.hutool.core.util.IdUtil;
import cn.hutool.crypto.digest.MD5;
@@ -61,6 +62,9 @@ public class TxwMhzcYhxxbServiceImpl extends ServiceImpl result = ssoApi.checkCaptcha(reqVO.getCaptchaVerification(), reqVO.getCaptchaCode());
+ if (result == null || !result.getData()) {
+ throw exception(REGISTER_CAPTCHA_CODE_ERROR);
+ }
}
TxwMhzcYhxxbDO yhxxByDlzh = yhxxbMapper.getYhxxByDlzhNoYxbzNoSdbz(dlzh);
if (!GyUtils.isNull(yhxxByDlzh)) {
@@ -203,11 +209,6 @@ public class TxwMhzcYhxxbServiceImpl extends ServiceImpl checkCaptcha(@RequestParam("uuid") String uuid, @RequestParam("code") String code);
}
diff --git a/txw-sso/txw-sso-service-api/target/classes/com/css/txw/sso/api/ISsoApi.class b/txw-sso/txw-sso-service-api/target/classes/com/css/txw/sso/api/ISsoApi.class
index 7dc1109..16e2fac 100644
Binary files a/txw-sso/txw-sso-service-api/target/classes/com/css/txw/sso/api/ISsoApi.class and b/txw-sso/txw-sso-service-api/target/classes/com/css/txw/sso/api/ISsoApi.class differ
diff --git a/txw-sso/txw-sso-service-biz/src/main/java/com/css/txw/sso/controller/verify/VerifyController.java b/txw-sso/txw-sso-service-biz/src/main/java/com/css/txw/sso/controller/verify/VerifyController.java
index 07e3917..39ad37c 100644
--- a/txw-sso/txw-sso-service-biz/src/main/java/com/css/txw/sso/controller/verify/VerifyController.java
+++ b/txw-sso/txw-sso-service-biz/src/main/java/com/css/txw/sso/controller/verify/VerifyController.java
@@ -8,6 +8,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@@ -41,6 +42,15 @@ public class VerifyController {
return verifyService.getCaptcha(remoteId);
}
+ @Operation(summary = "校验图形验证码")
+ @PermitAll
+ @PostMapping("/checkCaptcha")
+ public CommonResult checkCaptcha(@RequestParam("uuid") String uuid,
+ @RequestParam("code") String code) {
+ Boolean result = verifyService.checkCaptcha(uuid, code);
+ return CommonResult.success(result);
+ }
+
public static String getRemoteId(HttpServletRequest request) {
String ip = ServletUtils.getClientIP(request);
String ua = request.getHeader("user-agent");