Commit 74c9e59e authored by wildfirecode13's avatar wildfirecode13

11

parent 4997416a
......@@ -37,7 +37,7 @@
if (cmbdata) {
} else {
const protocol = 'cmblife://approval?aid=6b9a76cce8b54060a3a31867c4c9281d&callback=https%3A%2F%2Factivity.m.duiba.com.cn%2FcustomShare%2Fshare%3Fid%3D5369&clientType=h5&date=20211008150440&keyAlias=CO_PUB_KEY_SM2&mid=1611e17549f83f6d83c77822d0bf7bef&random=e19d106bd178472ba96d67f4a4863d6a&responseType=code&scope=defaultScope&sign=MEYCIQDP2oFR0LLYlObc9QIApk7QdnrGs5YHo23t8Ofs41jwOQIhAO7CyAhP8wYzCrY9VwF4GiKGKVgG%2FNFKpT%2BJMHKPDVKc&state=state';
const protocol = 'cmblife://approval?aid=6b9a76cce8b54060a3a31867c4c9281d&callback=http%3A%2F%2Factivity.m.duibatest.com.cn%2Fprojectx%2Fp19dcfe16%2Findex.html&clientType=h5&date=20211008173254&keyAlias=CO_PUB_KEY_SM2&mid=1611e17549f83f6d83c77822d0bf7bef&random=3aea65eb302643b6ae37ea1679df1d46&responseType=code&scope=defaultScope&sign=MEQCICn7x9vdwkeBn6tl63XKXS%2Bl9UxUVsL0BXmMXoQ%2FHgJ9AiBVIEHSleUhyr1A%2BqbnRxk4Ila%2BZWT4stTJr8B%2Bu6viOA%3D%3D&state=state';
setTimeout(() => {
window.location.href = protocol;
}, 100);
......
......@@ -9,6 +9,6 @@ module.exports ={
"IMAGE_Q1": 0.6,
"IMAGE_Q2": 0.8,
"RES_PATH": "/src/assets/",
"RES_PATH_PROD": "//yun.duiba.com.cn/spark/v2/temp_base/1633679631882",
"JS_PATH_PROD": "https://yun.duiba.com.cn/spark/v2/temp_base/1633679633903/js"
"RES_PATH_PROD": "//yun.duiba.com.cn/spark/v2/temp_base/1633686726105",
"JS_PATH_PROD": "https://yun.duiba.com.cn/spark/v2/temp_base/1633686727993/js"
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
const apiCfg = {
getRule:`projectRule.query`,
generateApproval:`/chw/cmbautologin/generateApproval`,
generateLoginUrl:`/chw/cmbautologin/generateLoginUrl`,
generateLoginUrl:`/customActivity/cmbautologin/generateLoginUrl`,
doJoin: {
uri: `join.do`,
method: "post"
......
......@@ -17,37 +17,46 @@ class App extends Component {
const callBackUrl = 'http%3A%2F%2Factivity.m.duibatest.com.cn%2Fprojectx%2Fp19dcfe16%2Findex.html';
let activityId = CFG.projectId;
const { code, testact } = queryParams;
if (testact == 1) activityId = 1;
if (code) { //获取到code
let { code, testact,iscallback,cmbdata } = queryParams;
if (testact == 1) activityId = 'p0e63e885';
cmbdata = '%7B%22respMsg%22%3A%22%E6%93%8D%E4%BD%9C%E6%88%90%E5%8A%9F%EF%BC%81%22%2C%22mid%22%3A%221611e17549f83f6d83c77822d0bf7bef%22%2C%22state%22%3A%22state%22%2C%22cmbKeyAlias%22%3A%22SM2_CMBLIFE%22%2C%22iscallback%22%3A%221%22%2C%22respCode%22%3A%221000%22%2C%22scope%22%3A%22defaultScope%22%2C%22code%22%3A%225394c93d48144ab8806e203%22%2C%22date%22%3A%2220211008174532%22%2C%22aid%22%3A%226b9a76cce8b54060a3a31867c4c9281d%22%2C%22sign%22%3A%22MEUCIFL%2BScttTBRCZTOYcC5IhFHJ5B%5C%2FwF6oykB7LyliFpqdnAiEA5Z%5C%2FT3HyYLk2XnSWNkHgNDbpD2Fq6r5FJ9tTR3MwEBXw%3D%22%7D';
setTimeout(() => {
console.error('queryParams',JSON.stringify(queryParams));
console.error('cmbdata',decodeURIComponent(cmbdata));
}, 1000);
if (iscallback) { //获取到code
const generateLoginUrlResult = await API.generateLoginUrl({
redirectUrl: "",
cmbData: code,
activityId: activityId,
callBackUrl: callBackUrl
redirectUrl: "https://activity.m.duibatest.com.cn/projectx/p19dcfe16/index.html",
cmbData: decodeURIComponent(cmbdata),
activityId: activityId
});
// location.href = generateLoginUrlResult.data;
location.href = generateLoginUrlResult.data;
} else { //没有获取到code
//请求授权协议
const result = await API.generateApproval({
activityId: activityId,
callBackUrl: callBackUrl
});
const protocol = result.data;
setTimeout(() => {
const protocol = 'cmblife://approval?aid=6b9a76cce8b54060a3a31867c4c9281d&callback=https%3A%2F%2Factivity.m.duibatest.com.cn%2Fprojectx%2Fp19dcfe16%2Findex.html%3Fiscallback%3D1&clientType=h5&date=20211008174119&keyAlias=CO_PUB_KEY_SM2&mid=1611e17549f83f6d83c77822d0bf7bef&random=dfcf20bc301e428db145957c672329ab&responseType=code&scope=defaultScope&sign=MEYCIQD6%2Fm6DdzezwlzQEIzXHzFKDHqBdxmkv4lopAVCsX%2FtuAIhAKR3F%2BuTsy4VVC%2B8ltsIMp%2FgMcrEJxkaoFLG468h9g2Y&state=state';
setTimeout(() => {
window.location.href = protocol;
}, 100);
console.error('protocol', protocol)
}, 1000);
//请求授权协议
// const result = await API.generateApproval({
// activityId: activityId,
// callBackUrl: callBackUrl
// });
// const protocol = result.data;
// setTimeout(() => {
// console.error('protocol', protocol)
// }, 1000);
// console.error(202)
// const protocol = 'cmblife://approval?aid=9dad6d3900ec3ffabd80e46522a10ead&callback=https%3A%2F%2Ftest.com%2Fmerchant%2FapprovalCallback.html&clientType=h5&date=20210930134315&keyAlias=CO_PUB_KEY_SM2&mid=f806c259d86e3b9aa956c98d475b6af7&random=6d5e7923308d489b969376cdb448072c&responseType=code&scope=defaultScope&sign=MEUCICIfC6OJFUUHYAIKlswzWvy2H%2BCPSyebZLb48OoTdqRaAiEA6UlFWD2Qd6OHBC0Cd69kFuu8%2FplOiddP%2FCcdokhPPoE%3D&state=state';
// var redirectUrl = "https://open.cmbchina.com/DevEnv/redirect/auth"
// + "?protocol=" + encodeURIComponent(protocol)
// + "&merchantApprovalUrl=" + encodeURIComponent(window.location.href);
window.location.href = protocol;
// window.location.href = protocol;
}
}
......
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