Commit 0eaf0d86 authored by 俞嘉婷's avatar 俞嘉婷

feat: 登录链路处理+获取验证码需点选校验

parent 496e52ae
...@@ -56,18 +56,12 @@ ...@@ -56,18 +56,12 @@
// 提示弹窗二维码短链链接(目的页是 首页xx/index.html?off=1) 线上正式 TODO 域名记得改为dexfu的 // 提示弹窗二维码短链链接(目的页是 首页xx/index.html?off=1) 线上正式 TODO 域名记得改为dexfu的
CFG.prizePageQrcodeUrl = CFG.domain + CFG.index + "&off=1"; CFG.prizePageQrcodeUrl = CFG.domain + CFG.index + "&off=1";
// 分享落地页 // 分享落地页
CFG.shareUrl = "/projectx/" + CFG.projectId + "/share.html?appID=" + CFG.appID + '&channel=' + CFG.channel; CFG.shareUrl = "/projectx/" + CFG.projectId + "/share.html?appID=" + CFG.appID + '&channel=' + CFG.channel + "&appKey=3oLQF9j3y7BKJUquwGn56hL6zzCW&openBs=openbs";
if (CFG.projectId === 'pe8805796') { if (CFG.projectId === 'pe8805796') {
// 测试环境 // 测试环境
// http://activity.m.duibatest.com.cn/projectx/pe8805796/share.html?appKey=jlg88lyxz7siqtmr&openBs=openbs&appID=1 // http://activity.m.duibatest.com.cn/projectx/pe8805796/share.html?appKey=jlg88lyxz7siqtmr&openBs=openbs&appID=1
CFG.shareUrl = CFG.shareUrl + "&appKey=jlg88lyxz7siqtmr&openBs=openbs" CFG.shareUrl = CFG.shareUrl + "&appKey=jlg88lyxz7siqtmr&openBs=openbs"
} }
if (CFG.projectId === 'pf909ff04') {
// 线上测试
// https://90548-activity.dexfu.cn/projectx/pf909ff04/share.html?appKey=3oLQF9j3y7BKJUquwGn56hL6zzCW&openBs=openbs&appID=90548
CFG.shareUrl = CFG.shareUrl + "&appKey=3oLQF9j3y7BKJUquwGn56hL6zzCW&openBs=openbs"
}
CFG.inviteCode = getUrlParam('inviteCode'); CFG.inviteCode = getUrlParam('inviteCode');
...@@ -77,10 +71,10 @@ ...@@ -77,10 +71,10 @@
} }
</script> </script>
<script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1756092540569/assets/index-BEioK6x7.js"></script> <script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1756869301165/assets/index-DslPsmrq.js"></script>
<link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1756092540569/assets/vendor-BiCVt3x5.js"> <link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1756869301165/assets/vendor-Bl1m6B-G.js">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1756092540569/assets/vendor-BQh5NVNk.css"> <link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1756869301165/assets/vendor-BQh5NVNk.css">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1756092540569/assets/index-BF5qNog2.css"> <link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1756869301165/assets/index-srtai-6a.css">
<script type="module">import.meta.url;import("_").catch(()=>1);(async function*(){})().next();if(location.protocol!="file:"){window.__vite_is_modern_browser=true}</script> <script type="module">import.meta.url;import("_").catch(()=>1);(async function*(){})().next();if(location.protocol!="file:"){window.__vite_is_modern_browser=true}</script>
<script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script> <script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
</head> </head>
...@@ -88,8 +82,8 @@ ...@@ -88,8 +82,8 @@
<body> <body>
<div id="root"></div> <div id="root"></div>
<script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script> <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
<script nomodule crossorigin id="vite-legacy-polyfill" src="https://yun.duiba.com.cn/db_games/spark/v3/1756092540569/assets/polyfills-legacy-D0AVcSo7.js"></script> <script nomodule crossorigin id="vite-legacy-polyfill" src="https://yun.duiba.com.cn/db_games/spark/v3/1756869301165/assets/polyfills-legacy-D0AVcSo7.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1756092540569/assets/index-legacy-CzlDNyWc.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script> <script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1756869301165/assets/index-legacy-ExQbX3R3.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -56,18 +56,12 @@ ...@@ -56,18 +56,12 @@
// 提示弹窗二维码短链链接(目的页是 首页xx/index.html?off=1) 线上正式 TODO 域名记得改为dexfu的 // 提示弹窗二维码短链链接(目的页是 首页xx/index.html?off=1) 线上正式 TODO 域名记得改为dexfu的
CFG.prizePageQrcodeUrl = CFG.domain + CFG.index + "&off=1"; CFG.prizePageQrcodeUrl = CFG.domain + CFG.index + "&off=1";
// 分享落地页 // 分享落地页
CFG.shareUrl = "/projectx/" + CFG.projectId + "/share.html?appID=" + CFG.appID + '&channel=' + CFG.channel; CFG.shareUrl = "/projectx/" + CFG.projectId + "/share.html?appID=" + CFG.appID + '&channel=' + CFG.channel + "&appKey=3oLQF9j3y7BKJUquwGn56hL6zzCW&openBs=openbs";
if (CFG.projectId === 'pe8805796') { if (CFG.projectId === 'pe8805796') {
// 测试环境 // 测试环境
// http://activity.m.duibatest.com.cn/projectx/pe8805796/share.html?appKey=jlg88lyxz7siqtmr&openBs=openbs&appID=1 // http://activity.m.duibatest.com.cn/projectx/pe8805796/share.html?appKey=jlg88lyxz7siqtmr&openBs=openbs&appID=1
CFG.shareUrl = CFG.shareUrl + "&appKey=jlg88lyxz7siqtmr&openBs=openbs" CFG.shareUrl = CFG.shareUrl + "&appKey=jlg88lyxz7siqtmr&openBs=openbs"
} }
if (CFG.projectId === 'pf909ff04') {
// 线上测试
// https://90548-activity.dexfu.cn/projectx/pf909ff04/share.html?appKey=3oLQF9j3y7BKJUquwGn56hL6zzCW&openBs=openbs&appID=90548
CFG.shareUrl = CFG.shareUrl + "&appKey=3oLQF9j3y7BKJUquwGn56hL6zzCW&openBs=openbs"
}
CFG.inviteCode = getUrlParam('inviteCode'); CFG.inviteCode = getUrlParam('inviteCode');
......
...@@ -33,20 +33,8 @@ export const CHANNEL = { ...@@ -33,20 +33,8 @@ export const CHANNEL = {
HXLC: "1", HXLC: "1",
/** 母行-华夏银行 */ /** 母行-华夏银行 */
HXBANK: "2", HXBANK: "2",
/** 微信端 */ /** 渠道5-昆仑银行 */
WX: "3", KUNLUN: "5",
// /** 三方合作APP-南粤银行 */
// NANYUE: "3",
// /** 三方合作APP-紫金 */
// ZIJIN: "4",
// /** 三方合作APP-中信 */
// ZHONGXIN: "5",
// /** 三方合作APP-河北 */
// HEBEI: "6",
// /** 三方合作APP-渤海 */
// BOHAI: "7",
// /** 母行备选渠道 手机号登录模式 投放母行app外 相当于三方合作APP */
// HXBANK_TEL: "8",
}; };
/** 是否为三方合作APP */ /** 是否为三方合作APP */
......
...@@ -65,11 +65,16 @@ const API = generateAPI({ ...@@ -65,11 +65,16 @@ const API = generateAPI({
}, },
// 首页-查询服务协议 // 首页-查询服务协议
coop_queryAgreement: "home/coop_queryAgreement.do", coop_queryAgreement: "home/coop_queryAgreement.do",
// 首页-校验验证码并登录 // 首页-校验验证码并登录(渠道5-昆仑银行使用)
coop_checkCode: { coop_checkCode: {
uri: 'home/coop_checkCode.do', uri: 'home/coop_checkCode.do',
method: 'post', method: 'post',
}, },
// 首页-校验验证码并登录(渠道1-华夏理财,渠道2-华夏银行使用)
checkCode: {
uri: 'home/checkCode.do',
method: 'post',
},
// 首页-发送验证码 // 首页-发送验证码
coop_sendCode: { coop_sendCode: {
uri: 'home/coop_sendCode.do', uri: 'home/coop_sendCode.do',
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
import React from 'react'; import React from 'react';
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import './sharePage.less'; import './sharePage.less';
import { _throttle, windowJumpUrl, CHANNEL, generateUUID, _asyncThrottle } from '@/utils/utils'; import { _throttle, windowJumpUrl, generateUUID, _asyncThrottle } from '@/utils/utils';
import { copyToClipboard } from '@spark/utils'; import { copyToClipboard } from '@spark/utils';
import { Toast } from "@grace/ui"; import { Toast } from "@grace/ui";
import API from '@/api'; import API from '@/api';
import { RATE_NAME } from '@/AppTools'; import { CHANNEL, RATE_NAME } from '@/AppTools';
@observer @observer
class SharePage extends React.Component { class SharePage extends React.Component {
......
...@@ -10,6 +10,7 @@ import { _asyncThrottle, getUrlParam } from '@/utils/utils'; ...@@ -10,6 +10,7 @@ import { _asyncThrottle, getUrlParam } from '@/utils/utils';
import LightSDK from 'light-sdk/dist/index.umd' import LightSDK from 'light-sdk/dist/index.umd'
import { CHANNEL } from '@/AppTools'; import { CHANNEL } from '@/AppTools';
import Privacypop from '../privacypop/privacypop'; import Privacypop from '../privacypop/privacypop';
import { startNecCaptcha } from '@spark/utils';
/* 电话号码验证规则 **/ /* 电话号码验证规则 **/
export const REG_TEL = /^1[0-9]{10}$/; export const REG_TEL = /^1[0-9]{10}$/;
...@@ -38,9 +39,10 @@ class Loginpop extends React.Component { ...@@ -38,9 +39,10 @@ class Loginpop extends React.Component {
if (getUrlParam("off") != 1) { if (getUrlParam("off") != 1) {
this.queryAgreement() this.queryAgreement()
} }
if (CFG.channel === CHANNEL.HXLC) { // 不用前端拿了 后端能拿到
this.getUserInfo() // if (CFG.channel === CHANNEL.HXLC) {
} // this.getUserInfo()
// }
} }
// 查询服务协议 // 查询服务协议
...@@ -83,7 +85,7 @@ class Loginpop extends React.Component { ...@@ -83,7 +85,7 @@ class Loginpop extends React.Component {
} }
// 点击获取验证码 // 点击获取验证码
clickGetCode = _asyncThrottle(() => { clickGetCode = _asyncThrottle(async () => {
// 已经开始倒计时 // 已经开始倒计时
if (this.state.showCountDown) return false; if (this.state.showCountDown) return false;
if (!this.state.loginPhone || this.state.loginPhone == "") { if (!this.state.loginPhone || this.state.loginPhone == "") {
...@@ -91,15 +93,27 @@ class Loginpop extends React.Component { ...@@ -91,15 +93,27 @@ class Loginpop extends React.Component {
} else if (!REG_TEL.test(this.state.loginPhone)) { } else if (!REG_TEL.test(this.state.loginPhone)) {
Toast.show('请输入正确手机号') Toast.show('请输入正确手机号')
} else { } else {
let validate = await startNecCaptcha(
"1ee4615751874cbeaea4dd4681930f61", // 文字点选
// "a869bfdfb9bd4cdf88e1ff2f8667a114", // 滑块验证
5
).catch(e => {
Toast.show("校验失败,请再次尝试哦")
});
// 对准了有值才往下走
if (!validate) {
return false;
}
// 获取验证码 // 获取验证码
this.getCode(this.state.loginPhone) this.getCode(this.state.loginPhone, validate)
} }
}) })
// 获取验证码 // 获取验证码
getCode = async (phoneNum) => { getCode = async (phoneNum, validate) => {
const params = { const params = {
phoneNumber: phoneNum, phoneNumber: phoneNum,
validate: validate,
} }
const { success, data } = await API.coop_sendCode(params) const { success, data } = await API.coop_sendCode(params)
if (success) { if (success) {
...@@ -163,11 +177,14 @@ class Loginpop extends React.Component { ...@@ -163,11 +177,14 @@ class Loginpop extends React.Component {
const params = { const params = {
"phoneNumber": loginPhone, "phoneNumber": loginPhone,
"smsCode": loginCode, "smsCode": loginCode,
"origenUid": uid || '', // 华夏理财渠道才拿得到 其他渠道不用传 // 不用前端传了 后端能拿到
// "origenUid": uid || '', // 华夏理财渠道才拿得到 其他渠道不用传
// "redirectUrl": CFG.domain + (getUrlParam("off") == 1 ? CFG.prize : CFG.index) // "redirectUrl": CFG.domain + (getUrlParam("off") == 1 ? CFG.prize : CFG.index)
"redirectUrl": location.href "redirectUrl": location.href
} }
const { success, data } = await API.coop_checkCode(params) const { success, data } = await API[
CFG.channel == CHANNEL.KUNLUN ? "coop_checkCode" : "checkCode"
](params)
if (success) { if (success) {
location.replace(data); location.replace(data);
} }
......
import { makeAutoObservable } from 'mobx'; import { makeAutoObservable } from 'mobx';
import API from '../api/index'; import API from '../api/index';
import store from './store'; import store from './store';
import { CHANNEL } from '@/utils/utils'; import { CHANNEL } from '@/AppTools';
import { Toast } from '@grace/ui'; import { Toast } from '@grace/ui';
import { hxbankShare } from './bank'; import { hxbankShare } from './bank';
import { ModalCtrl } from '@/core/ctrls/ModalCtrl'; import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
......
...@@ -153,7 +153,8 @@ class Store { ...@@ -153,7 +153,8 @@ class Store {
} else if (code == 60002) { } else if (code == 60002) {
// 请绑定手机号 // 请绑定手机号
ModalCtrl.showModal(Loginpop) ModalCtrl.showModal(Loginpop)
} else if ((isWeiXin() || CFG.channel == CHANNEL.HXLC || IS_OTHER_APP) && (code == 100001 || code == 100007 || code == 100009)) { } else if ((CFG.channel == CHANNEL.KUNLUN) && (code == 100001 || code == 100007 || code == 100009)) {
// 只有昆仑银行 需要绑定手机号 其他渠道拦截登录直接出未登录toast,防止奖品被刷
ModalCtrl.showModal(Loginpop); ModalCtrl.showModal(Loginpop);
} else { } else {
Toast.show(message || '网络异常,请稍后再试') Toast.show(message || '网络异常,请稍后再试')
...@@ -184,6 +185,7 @@ class Store { ...@@ -184,6 +185,7 @@ class Store {
this.percent = 0; this.percent = 0;
} }
// 防止奖品被刷 禁止微信端访问了 这个弹窗不会出了 配置项控制
if (endPop) { if (endPop) {
ModalCtrl.showModal(Tipspop); ModalCtrl.showModal(Tipspop);
} }
......
...@@ -25,7 +25,8 @@ export const errMessageMap = { ...@@ -25,7 +25,8 @@ export const errMessageMap = {
export function errorHandler(error) { export function errorHandler(error) {
if ((error.code == 0 && error.message == "请稍后再试") || filterCode.indexOf(`${error.code}`) >= 0) return; if ((error.code == 0 && error.message == "请稍后再试") || filterCode.indexOf(`${error.code}`) >= 0) return;
// 微信端/华夏理财/三方合作APP 未登录时 其他接口都走登录弹窗 // 微信端/华夏理财/三方合作APP 未登录时 其他接口都走登录弹窗
if ((isWeiXin() || CFG.channel == CHANNEL.HXLC || IS_OTHER_APP) && (error.code == 100001 || error.code == 100007 || error.code == 100009)) return ModalCtrl.showModal(Loginpop); // 20250903迭代:只有昆仑银行 需要绑定手机号 其他渠道拦截登录直接出未登录toast,防止奖品被刷
if ((CFG.channel == CHANNEL.KUNLUN) && (error.code == 100001 || error.code == 100007 || error.code == 100009)) return ModalCtrl.showModal(Loginpop);
switch (error.code) { switch (error.code) {
default: { default: {
const msg = errMessageMap[error.code] || error.message || '网络异常,请稍后再试'; const msg = errMessageMap[error.code] || error.message || '网络异常,请稍后再试';
......
...@@ -471,28 +471,6 @@ export const windowJumpUrl = (url) => { ...@@ -471,28 +471,6 @@ export const windowJumpUrl = (url) => {
url && (location.href = url); url && (location.href = url);
}; };
/** 渠道 */
export const CHANNEL = {
/** 母行-华夏银行 */
HXBANK: "2",
/** 华夏理财 */
HXLC: "1",
/** 三方合作APP-南粤银行 */
NANYUE: "3",
/** 三方合作APP-紫金 */
ZIJIN: "4",
/** 三方合作APP-中信 */
ZHONGXIN: "5",
/** 三方合作APP-河北 */
HEBEI: "6",
/** 三方合作APP-渤海 */
BOHAI: "7",
/** 母行备选渠道 手机号登录模式 投放母行app外 相当于三方合作APP */
HXBANK_TEL: "8",
/** 下线弹窗二维码入口进入 */
OFFLINE_QRCODE: "9",
};
// 生成uuid // 生成uuid
export function generateUUID() { export function generateUUID() {
let d = new Date().getTime(); let d = new Date().getTime();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment