Commit 5ed10fad authored by wildfirecode13's avatar wildfirecode13

11

parent 45c77fba
No preview for this file type
module.exports = {
"data": 3,
"success": true
}
\ No newline at end of file
module.exports = {
"data": 3,
"success": true
}
\ No newline at end of file
const rule = require("./common/rule");
const drawNum = require("./common/drawNum");
const generateApproval = require("./common/generateApproval");
const generateLoginUrl = require("./common/generateLoginUrl");
const proxy = {
"GET /customActivity/cmbautologin/generateApproval": generateApproval,
"GET /customActivity/cmbautologin/generateLoginUrl": generateLoginUrl,
"GET /projectRule.query": rule,
"GET /drawNum.query": drawNum
};
......
......@@ -9,6 +9,12 @@
<script src="//yun.duiba.com.cn/spark/v2/spark.base.fz.wxpollyfill.js"></script>
<script src="//yun.duiba.com.cn/js-libs/rem/1.1.3/rem.min.js"></script>
<script src="//yun.duiba.com.cn/h5/lib/zepto.min.js"></script>
<!-- cmblifeSDK -->
<!-- <script src="//yun.duiba.com.cn/aurora/assets/1f77f067b23f29cbab785a417db977b3bde8d809.js"></script> -->
<!-- cmblifeSDK-Dev -->
<script src="//yun.duiba.com.cn/aurora/assets/a2ea866799a083bc624ed081af653884ad066779.js"></script>
<script>
function getApp() {
return {
......@@ -53,4 +59,4 @@
</body>
</html>
</html>
\ No newline at end of file
const apiCfg = {
getRule:`projectRule.query`,
generateApproval:`/customActivity/cmbautologin/generateApproval`,
generateLoginUrl:`/customActivity/cmbautologin/generateLoginUrl`,
doJoin: {
uri: `join.do`,
method: "post"
......
import { queryParams } from "duiba-utils";
import React, { Component } from "react";
import ReactDOM from "react-dom";
import MD from '../MD';
import "../monitor.js"; //前端错误监控
import "./app.less";
import Modal from './modal/modal';
import MD from '../MD';
MD();
import "../monitor.js"; //前端错误监控
//此处为spark-cli动态生成
class App extends Component {
async componentDidMount() {
const { code } = queryParams;
if (code) { //获取到code
const generateLoginUrlResult = await API.generateLoginUrl({
redirectUrl: "",
cmbData: code
});
location.href = generateLoginUrlResult.data;
} else { //没有获取到code
//请求授权协议
const generateApprovalResult = await API.generateApproval();
var redirectUrl = "https://open.cmbchina.com/DevEnv/redirect/auth"
+ "?protocol=" + encodeURIComponent(protocol)
+ "&merchantApprovalUrl=" + encodeURIComponent(window.location.href);
window.location.href = redirectUrl;
}
}
render() {
return (
<div>
......
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