Commit e655fbbf by wangshuo

拉取代码

parent d669b678
self.__precacheManifest = [
{
"revision": "5a32b7261e4446facddc",
"url": "/mrstatic/js/0.bc874a24.chunk.js"
},
{
"revision": "4f2a23a6f7e1c4c50a21",
"url": "/mrstatic/css/1.bff22cf8.chunk.css"
},
{
"revision": "4f2a23a6f7e1c4c50a21",
"url": "/mrstatic/js/1.cb268bcf.chunk.js"
},
{
"revision": "1fb1a53d366f6c5a357e",
"url": "/mrstatic/js/2.0417c21c.chunk.js"
},
{
"revision": "78e582b0bb095034dace",
"url": "/mrstatic/css/3.5ed15c7e.chunk.css"
},
{
"revision": "78e582b0bb095034dace",
"url": "/mrstatic/js/3.4a2be69d.chunk.js"
},
{
"revision": "16f7b0279a12f3e957de",
"url": "/mrstatic/css/4.0dc24c6e.chunk.css"
},
{
"revision": "16f7b0279a12f3e957de",
"url": "/mrstatic/js/4.026d6db3.chunk.js"
},
{
"revision": "821973b7378ddaaf90eb",
"url": "/mrstatic/css/Activity.a74b39fb.chunk.css"
},
{
"revision": "821973b7378ddaaf90eb",
"url": "/mrstatic/js/Activity.ce04657e.chunk.js"
},
{
"revision": "e6134deb46e8c74490c0",
"url": "/mrstatic/css/BargainMiddlePage.31cef199.chunk.css"
},
{
"revision": "e6134deb46e8c74490c0",
"url": "/mrstatic/js/BargainMiddlePage.8814b7db.chunk.js"
},
{
"revision": "fbe5fcf945d7c7d64bef",
"url": "/mrstatic/css/Classify.f2f19957.chunk.css"
},
{
"revision": "fbe5fcf945d7c7d64bef",
"url": "/mrstatic/js/Classify.1316928e.chunk.js"
},
{
"revision": "148066bbb78124e5f7ad",
"url": "/mrstatic/css/Country.16a64650.chunk.css"
},
{
"revision": "148066bbb78124e5f7ad",
"url": "/mrstatic/js/Country.282356fe.chunk.js"
},
{
"revision": "702f1b420c60600fe8c2",
"url": "/mrstatic/css/CourseList.47812ac6.chunk.css"
},
{
"revision": "702f1b420c60600fe8c2",
"url": "/mrstatic/js/CourseList.5557a131.chunk.js"
},
{
"revision": "52ef7c575ff2da8ae4e8",
"url": "/mrstatic/css/DrawDocument.2e7d81ca.chunk.css"
},
{
"revision": "52ef7c575ff2da8ae4e8",
"url": "/mrstatic/js/DrawDocument.bcec53f1.chunk.js"
},
{
"revision": "f36e737a0285dab53882",
"url": "/mrstatic/css/Examination.f2cc3163.chunk.css"
},
{
"revision": "f36e737a0285dab53882",
"url": "/mrstatic/js/Examination.b8ab0d85.chunk.js"
},
{
"revision": "bd6041c96f1d044629ba",
"url": "/mrstatic/css/Invite.361dc1a3.chunk.css"
},
{
"revision": "bd6041c96f1d044629ba",
"url": "/mrstatic/js/Invite.2df843ed.chunk.js"
},
{
"revision": "16d594ac2b2d7f308b9f",
"url": "/mrstatic/js/MyEdit.93346dbf.chunk.js"
},
{
"revision": "1f29ef0ce51a361033da",
"url": "/mrstatic/css/Order.35f475a1.chunk.css"
},
{
"revision": "1f29ef0ce51a361033da",
"url": "/mrstatic/js/Order.336cedef.chunk.js"
},
{
"revision": "c720841a258c812ad7e3",
"url": "/mrstatic/js/Orderinfo.9523d283.chunk.js"
},
{
"revision": "ae4cdb1d8fb7ee7a5b90",
"url": "/mrstatic/css/PayOrder.e5315535.chunk.css"
},
{
"revision": "ae4cdb1d8fb7ee7a5b90",
"url": "/mrstatic/js/PayOrder.3406a411.chunk.js"
},
{
"revision": "084b7de9261d315e2c9c",
"url": "/mrstatic/css/Preferential.18d20d0c.chunk.css"
},
{
"revision": "084b7de9261d315e2c9c",
"url": "/mrstatic/js/Preferential.d93f1005.chunk.js"
},
{
"revision": "257565fa3d530c9345c9",
"url": "/mrstatic/css/SearchResult.bb7c3056.chunk.css"
},
{
"revision": "257565fa3d530c9345c9",
"url": "/mrstatic/js/SearchResult.6b2e53db.chunk.js"
},
{
"revision": "0aeca27dc18cac18fe70",
"url": "/mrstatic/css/ShareCourse.278ad3b1.chunk.css"
},
{
"revision": "0aeca27dc18cac18fe70",
"url": "/mrstatic/js/ShareCourse.5eeef10c.chunk.js"
},
{
"revision": "733b5411daa432dba8fb",
"url": "/mrstatic/css/ShopCart.3a4dbb7a.chunk.css"
},
{
"revision": "733b5411daa432dba8fb",
"url": "/mrstatic/js/ShopCart.bbca129b.chunk.js"
},
{
"revision": "cdc03aa197d4483fb150",
"url": "/mrstatic/css/aist-share.ca49c1cb.chunk.css"
},
{
"revision": "cdc03aa197d4483fb150",
"url": "/mrstatic/js/aist-share.de8a0e2a.chunk.js"
},
{
"revision": "b03de98f32265e761210",
"url": "/mrstatic/css/blessing-getPrize.951fd27d.chunk.css"
},
{
"revision": "b03de98f32265e761210",
"url": "/mrstatic/js/blessing-getPrize.3520a0c4.chunk.js"
},
{
"revision": "ddde5c51dace7d7a8240",
"url": "/mrstatic/css/blessing-preheat.715eb28a.chunk.css"
},
{
"revision": "ddde5c51dace7d7a8240",
"url": "/mrstatic/js/blessing-preheat.62d874e7.chunk.js"
},
{
"revision": "227043b9e791be66816e",
"url": "/mrstatic/css/blessing-rank.b92d0394.chunk.css"
},
{
"revision": "227043b9e791be66816e",
"url": "/mrstatic/js/blessing-rank.57beb548.chunk.js"
},
{
"revision": "9edf7dbb2753c6ff2076",
"url": "/mrstatic/css/coupons.c10ecc19.chunk.css"
},
{
"revision": "9edf7dbb2753c6ff2076",
"url": "/mrstatic/js/coupons.f14154ef.chunk.js"
},
{
"revision": "8cf9f133c54b908ae9fd",
"url": "/mrstatic/css/deposit-order.6f3a01ca.chunk.css"
},
{
"revision": "8cf9f133c54b908ae9fd",
"url": "/mrstatic/js/deposit-order.ffeee7d1.chunk.js"
},
{
"revision": "315826b54f4b2c17829d",
"url": "/mrstatic/css/deposit-pay-order.219bad3d.chunk.css"
},
{
"revision": "315826b54f4b2c17829d",
"url": "/mrstatic/js/deposit-pay-order.021258b8.chunk.js"
},
{
"revision": "61564a7f1f8241b0a3f9",
"url": "/mrstatic/css/detail.581c1e79.chunk.css"
},
{
"revision": "61564a7f1f8241b0a3f9",
"url": "/mrstatic/js/detail.9976501c.chunk.js"
},
{
"revision": "c004e7d0a89563a1b207",
"url": "/mrstatic/css/main.d853aa5c.chunk.css"
},
{
"revision": "c004e7d0a89563a1b207",
"url": "/mrstatic/js/main.830293b0.chunk.js"
},
{
"revision": "6de3b7af9b6aeef2635d",
"url": "/mrstatic/css/myorders.3c41b358.chunk.css"
},
{
"revision": "6de3b7af9b6aeef2635d",
"url": "/mrstatic/js/myorders.58381c0c.chunk.js"
},
{
"revision": "b614313fefe495bc0441",
"url": "/mrstatic/css/newyear-2019-landing.b0d930fa.chunk.css"
},
{
"revision": "b614313fefe495bc0441",
"url": "/mrstatic/js/newyear-2019-landing.5a799102.chunk.js"
},
{
"revision": "cb2c1a39498aa9eef446",
"url": "/mrstatic/css/newyear-yearIndex.c8863d51.chunk.css"
},
{
"revision": "cb2c1a39498aa9eef446",
"url": "/mrstatic/js/newyear-yearIndex.25ec9dae.chunk.js"
},
{
"revision": "f270a0f9d0e1d4ca31fd",
"url": "/mrstatic/css/prize-winner-list.55e46fc9.chunk.css"
},
{
"revision": "f270a0f9d0e1d4ca31fd",
"url": "/mrstatic/js/prize-winner-list.6a939100.chunk.js"
},
{
"revision": "f6b202549eb1870966ff",
"url": "/mrstatic/css/purchased.f583a040.chunk.css"
},
{
"revision": "f6b202549eb1870966ff",
"url": "/mrstatic/js/purchased.4dd2d566.chunk.js"
},
{
"revision": "06013a0b3b4e80b5abdf",
"url": "/mrstatic/css/python-class.087d6571.chunk.css"
},
{
"revision": "06013a0b3b4e80b5abdf",
"url": "/mrstatic/js/python-class.bfdfc4dc.chunk.js"
},
{
"revision": "b19f7335a1cdab871dcf",
"url": "/mrstatic/js/runtime~main.97306fc1.js"
},
{
"revision": "dd49b1ba6ed4a1cb0cd4",
"url": "/mrstatic/css/search.38c3e634.chunk.css"
},
{
"revision": "dd49b1ba6ed4a1cb0cd4",
"url": "/mrstatic/js/search.d392edb8.chunk.js"
},
{
"revision": "2baf17f32112fcc9deff",
"url": "/mrstatic/css/shareposter.f09a5959.chunk.css"
},
{
"revision": "2baf17f32112fcc9deff",
"url": "/mrstatic/js/shareposter.268a2ca3.chunk.js"
},
{
"revision": "9adf9050ba19d31de409",
"url": "/mrstatic/css/study.e406d228.chunk.css"
},
{
"revision": "9adf9050ba19d31de409",
"url": "/mrstatic/js/study.404b2f61.chunk.js"
},
{
"revision": "17ce679ba7a1c72d7238",
"url": "/mrstatic/css/system-notices.08df3d15.chunk.css"
},
{
"revision": "17ce679ba7a1c72d7238",
"url": "/mrstatic/js/system-notices.a2bbffec.chunk.js"
},
{
"revision": "3a5cc862d2f07edeb787",
"url": "/mrstatic/css/togroup.49988cae.chunk.css"
},
{
"revision": "3a5cc862d2f07edeb787",
"url": "/mrstatic/js/togroup.aed3e309.chunk.js"
},
{
"revision": "cd71a1f78a63c4cd72a1",
"url": "/mrstatic/css/treasure-box-home.742fb589.chunk.css"
},
{
"revision": "cd71a1f78a63c4cd72a1",
"url": "/mrstatic/js/treasure-box-home.83c24468.chunk.js"
},
{
"revision": "d2d8149cca7d46ebd8fa",
"url": "/mrstatic/css/treasure-box-mybox.012a9beb.chunk.css"
},
{
"revision": "d2d8149cca7d46ebd8fa",
"url": "/mrstatic/js/treasure-box-mybox.3670c265.chunk.js"
},
{
"revision": "cd748888fadd0ac5df24",
"url": "/mrstatic/css/video.d836ed34.chunk.css"
},
{
"revision": "cd748888fadd0ac5df24",
"url": "/mrstatic/js/video.c109b6c2.chunk.js"
},
{
"revision": "81f279f21e030b79bb9d",
"url": "/mrstatic/css/45.0c7eea28.chunk.css"
},
{
"revision": "81f279f21e030b79bb9d",
"url": "/mrstatic/js/45.9458e81a.chunk.js"
},
{
"revision": "429337699ba1f47680f8",
"url": "/mrstatic/js/46.44f38ed3.chunk.js"
},
{
"revision": "df5076891542d2e417a2",
"url": "/mrstatic/css/47.50547718.chunk.css"
},
{
"revision": "df5076891542d2e417a2",
"url": "/mrstatic/js/47.4ef49615.chunk.js"
},
{
"revision": "a743c62443311a7f4cf5",
"url": "/mrstatic/css/48.bd48401c.chunk.css"
},
{
"revision": "a743c62443311a7f4cf5",
"url": "/mrstatic/js/48.3cae0429.chunk.js"
},
{
"revision": "0cd0e92cd425132e72da",
"url": "/mrstatic/css/49.2471f477.chunk.css"
},
{
"revision": "0cd0e92cd425132e72da",
"url": "/mrstatic/js/49.0dfc3020.chunk.js"
},
{
"revision": "bebf7964f1a8fc9bec1c",
"url": "/mrstatic/css/50.0bb224f2.chunk.css"
},
{
"revision": "bebf7964f1a8fc9bec1c",
"url": "/mrstatic/js/50.41881c23.chunk.js"
},
{
"revision": "90760aaa31dacfbd2304",
"url": "/mrstatic/css/51.ecbb6f9a.chunk.css"
},
{
"revision": "90760aaa31dacfbd2304",
"url": "/mrstatic/js/51.38a8cd5c.chunk.js"
},
{
"revision": "95e9d2b3e3d393eccdf1",
"url": "/mrstatic/css/52.9f46e45e.chunk.css"
},
{
"revision": "95e9d2b3e3d393eccdf1",
"url": "/mrstatic/js/52.c69a440a.chunk.js"
},
{
"revision": "203ea2ff829d9a6f81cc",
"url": "/mrstatic/css/53.ee45d0b0.chunk.css"
},
{
"revision": "203ea2ff829d9a6f81cc",
"url": "/mrstatic/js/53.c2ea86c0.chunk.js"
},
{
"revision": "1bebcc2cac4800eb1ded",
"url": "/mrstatic/css/54.025e3921.chunk.css"
},
{
"revision": "1bebcc2cac4800eb1ded",
"url": "/mrstatic/js/54.d8bf61b4.chunk.js"
},
{
"revision": "69fd7cab084cdcf43fb3",
"url": "/mrstatic/css/55.ab7f5e40.chunk.css"
},
{
"revision": "69fd7cab084cdcf43fb3",
"url": "/mrstatic/js/55.2165edcc.chunk.js"
},
{
"revision": "d5ecce54291ad9c4925e",
"url": "/mrstatic/css/56.4c85e85c.chunk.css"
},
{
"revision": "d5ecce54291ad9c4925e",
"url": "/mrstatic/js/56.25719836.chunk.js"
},
{
"revision": "8853b7da77c1bab42068",
"url": "/mrstatic/css/57.470b9744.chunk.css"
},
{
"revision": "8853b7da77c1bab42068",
"url": "/mrstatic/js/57.67a640cc.chunk.js"
},
{
"revision": "c2b9fefc4e89caca0e49",
"url": "/mrstatic/css/58.10a4034d.chunk.css"
},
{
"revision": "c2b9fefc4e89caca0e49",
"url": "/mrstatic/js/58.86365e8c.chunk.js"
},
{
"revision": "f5dd8176f956e704999b",
"url": "/mrstatic/css/59.697fa90d.chunk.css"
},
{
"revision": "f5dd8176f956e704999b",
"url": "/mrstatic/js/59.24412a5e.chunk.js"
},
{
"revision": "fe9171365eb6e4a464b4",
"url": "/mrstatic/css/60.eb90513f.chunk.css"
},
{
"revision": "fe9171365eb6e4a464b4",
"url": "/mrstatic/js/60.612e025e.chunk.js"
},
{
"revision": "638e49466f65bd907e59",
"url": "/mrstatic/css/61.5fba4ed0.chunk.css"
},
{
"revision": "638e49466f65bd907e59",
"url": "/mrstatic/js/61.528d1560.chunk.js"
},
{
"revision": "4435b9bb74e74605417c",
"url": "/mrstatic/css/62.e51ea0fc.chunk.css"
},
{
"revision": "4435b9bb74e74605417c",
"url": "/mrstatic/js/62.7af7cc5d.chunk.js"
},
{
"revision": "64fd0b167457064e12ff8a6afcd31720",
"url": "/mrstatic/media/iconfont.64fd0b16.eot"
},
{
"revision": "f2f4294d9a677f58f6f7c1a0ac84c448",
"url": "/mrstatic/media/iconfont.f2f4294d.woff"
},
{
"revision": "99b2454970e48c8bb00578cdca15b3d2",
"url": "/mrstatic/media/iconfont.99b24549.ttf"
},
{
"revision": "5bf7701b4b6358bd06d9c45c26a7d18f",
"url": "/mrstatic/media/iconfont.5bf7701b.svg"
},
{
"revision": "81a489ac63f2f2df5ab412e0782bd54c",
"url": "/mrstatic/media/kanjia_cg_icon.81a489ac.png"
},
{
"revision": "d76ebce726bdf3459fa14e96d84c5b9a",
"url": "/mrstatic/media/formal-banner.d76ebce7.png"
},
{
"revision": "9ab091267ae7c83bd30d0f5ad018a8c9",
"url": "/mrstatic/media/dalibao_bj.9ab09126.png"
},
{
"revision": "80011994e30adf599e5f47fcc81bc06d",
"url": "/mrstatic/media/progress-share-bg.80011994.png"
},
{
"revision": "c79abf5cb7ae8a82009cf68fe44d1078",
"url": "/mrstatic/media/redb_money_bj@2x.c79abf5c.png"
},
{
"revision": "8edaf2ff2566ed17e2dd22cf4f8ad7ae",
"url": "/mrstatic/media/redb_chai_bj@2x.8edaf2ff.png"
},
{
"revision": "6902434f8f18a23319d57d0ac8aaea8c",
"url": "/mrstatic/media/redb_sp_bj@2x.6902434f.png"
},
{
"revision": "79139f6aad350256e151f9f73c226348",
"url": "/mrstatic/media/hb_bj.79139f6a.png"
},
{
"revision": "1eee911b21cd52cd02d7d65a90b3c8e0",
"url": "/index.html"
}
];
\ No newline at end of file
...@@ -24,7 +24,6 @@ class Captcha extends Component { ...@@ -24,7 +24,6 @@ class Captcha extends Component {
width: 'auto', width: 'auto',
onReady: function (instance) { onReady: function (instance) {
// 验证码一切准备就绪,此时可正常使用验证码的相关功能 // 验证码一切准备就绪,此时可正常使用验证码的相关功能
console.log(_this);
_this.setState({ _this.setState({
isReady: true isReady: true
}); });
......
...@@ -634,7 +634,6 @@ ...@@ -634,7 +634,6 @@
background-color: #F3F4F8; background-color: #F3F4F8;
} }
.index-box ~ .year19-index { .index-box ~ .year19-index {
display: none; display: none;
} }
\ No newline at end of file
...@@ -107,6 +107,7 @@ class OutLine extends Component { ...@@ -107,6 +107,7 @@ class OutLine extends Component {
4-已购买直播中 4-已购买直播中
5-可试听且有试听权限 5-可试听且有试听权限
6-可试听但无试听权限 6-可试听但无试听权限
7-新试听功能,点击试听跳转播放页
*/} */}
{ // 试听 { // 试听
!introduce.is_aist && (item.class_status === 6 || item.class_status === 5) && !introduce.is_aist && (item.class_status === 6 || item.class_status === 5) &&
...@@ -115,6 +116,14 @@ class OutLine extends Component { ...@@ -115,6 +116,14 @@ class OutLine extends Component {
<i className='iconfont iconcelluar'></i> <i className='iconfont iconcelluar'></i>
</span> </span>
} }
{ // 点击试听跳转播放页
!introduce.is_aist && item.class_status === 7 &&
<Link
to={`/play/video?id=${introduce.v_course_id + '&video_id=' + item.video_id}`}
className='btn-right-10 audition'> <i className='iconfont iconcelluar'></i>试听</Link>
}
{ // 未购买未开单集购买:上锁标志,点击提示购买 { // 未购买未开单集购买:上锁标志,点击提示购买
!introduce.is_aist && item.class_status === 0 && !introduce.is_aist && item.class_status === 0 &&
<i className='iconfont iconiconfront-74 icon-right-22'></i> <i className='iconfont iconiconfront-74 icon-right-22'></i>
......
...@@ -20,7 +20,7 @@ export default class Experience extends Component { ...@@ -20,7 +20,7 @@ export default class Experience extends Component {
</div> </div>
<img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/r%402x.png" alt=""/> <img src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/h5_python_class/r%402x.png" alt=""/>
</div> </div>
<div className={'btn'} onClick={tryLearn}>立即体验</div> <div className={'btn'} onClick={() => {tryLearn(1)}}>立即体验</div>
</> </>
) )
: ( : (
......
...@@ -12,7 +12,7 @@ import ShareRank from "@components/detail/shareRank" ...@@ -12,7 +12,7 @@ import ShareRank from "@components/detail/shareRank"
import { http, getParam, SendMessageToApp, } from '@/utils' import { http, getParam, SendMessageToApp, } from '@/utils'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { Toast } from "antd-mobile" import { Toast } from "antd-mobile"
import {CallApp} from "@common/index" import { CallApp } from "@common/index"
@connect(state => ({ @connect(state => ({
user: state.user user: state.user
...@@ -35,6 +35,7 @@ class PythonDes extends Component { ...@@ -35,6 +35,7 @@ class PythonDes extends Component {
// 立即报名 // 立即报名
signUp = () => { signUp = () => {
this.statistics(3)
// 已登录 // 已登录
if (!this.props.user.hasError) { if (!this.props.user.hasError) {
this.toDetail() this.toDetail()
...@@ -44,7 +45,8 @@ class PythonDes extends Component { ...@@ -44,7 +45,8 @@ class PythonDes extends Component {
} }
// 立即体验、免费试学 // 立即体验、免费试学
tryLearn = () => { tryLearn = type => {
this.statistics(type)
// 已登录 // 已登录
if (!this.props.user.hasError) { if (!this.props.user.hasError) {
this.toLearn() this.toLearn()
...@@ -169,6 +171,11 @@ class PythonDes extends Component { ...@@ -169,6 +171,11 @@ class PythonDes extends Component {
} }
} }
// 统计
statistics = type => {
http.post(`${API.home}/web/it_click_num/${getParam('id')}`, {type})
}
shouldComponentUpdate(nextProps, nextState, nextContext) { shouldComponentUpdate(nextProps, nextState, nextContext) {
if (this.props.isAppUpdate !== nextProps.isAppUpdate) { if (this.props.isAppUpdate !== nextProps.isAppUpdate) {
...@@ -207,7 +214,10 @@ class PythonDes extends Component { ...@@ -207,7 +214,10 @@ class PythonDes extends Component {
</div> </div>
<div className={'btn__group'}> <div className={'btn__group'}>
<div className={'try__study'} onClick={this.tryLearn}>免费试学</div> <div className={'try__study'} onClick={() => {
this.tryLearn(2)
}}>免费试学
</div>
<div className={'sign__now'} onClick={this.signUp}>立即报名</div> <div className={'sign__now'} onClick={this.signUp}>立即报名</div>
</div> </div>
</div> </div>
......
...@@ -77,6 +77,10 @@ const formikConfig = { ...@@ -77,6 +77,10 @@ const formikConfig = {
username, password, redirect: from && window.location.origin + from.pathname + from.search + from.hash username, password, redirect: from && window.location.origin + from.pathname + from.search + from.hash
}).then(res => { }).then(res => {
if (res.hasError) { if (res.hasError) {
if(res.code === 4004){
history.push(`/passport/binding-tel?username=${username}`)
return
}
Toast.info(res.msg, 2, null, false) Toast.info(res.msg, 2, null, false)
} }
}) })
......
...@@ -39,7 +39,6 @@ class BindingTel extends Component { ...@@ -39,7 +39,6 @@ class BindingTel extends Component {
} }
} }
render() { render() {
const { const {
values, values,
...@@ -119,17 +118,52 @@ const formikConfig = { ...@@ -119,17 +118,52 @@ const formikConfig = {
return errors return errors
}, },
handleSubmit(values, {props}) { handleSubmit(values, {props}) {
http.post(`${API['passport-api']}/bind_mobile`, { const username = getParam('username')
if (username) {
//老账号绑定手机号
http.post(`${API["passport-api"]}/m/personal/bindMobile`, {
phone_num: values.tel,
code: values.veriCode,
type: 1,
area_code: '00' + props.country.num,
user_name: username
}).then(res => {
const {data, errno, msg} = res.data
if (errno === 200) {
props.setCurrentUser({
hasError: false,
data: {
username: data.user_name,
avatar: data.avatar_file,
isVip: parseInt(data.vip),
token: data.access_token,
uid: data.uid
}
})
const {from} = props.location.state || {from: {pathname: '/'}}
props.history.push(from)
} else {
Toast.info(msg, 2, null, false)
}
})
} else {
const uid = getParam('uid')
const params = {
phone_num: values.tel, phone_num: values.tel,
phone_code: values.veriCode, phone_code: values.veriCode,
mkey: getParam('mkey'), mkey: getParam('mkey'),
area_code: '00' + props.country.num, area_code: '00' + props.country.num,
plat: 5 plat: 5,
}).then(res => { type: uid ? 1 : 2
}
if (uid) {
params.uid = uid
}
http.post(`${API['passport-api']}/bind_mobile`, params).then(res => {
const data = res.data const data = res.data
if (data.errno == 200) { if (data.errno == 200) {
if (data.data['is_set_pwd']) {
const {history} = props const {history} = props
if (data.data['is_set_pwd']) {
history.replace(`/passport/set-password`, { history.replace(`/passport/set-password`, {
user: { user: {
hasError: false, hasError: false,
...@@ -141,8 +175,16 @@ const formikConfig = { ...@@ -141,8 +175,16 @@ const formikConfig = {
} }
}) })
} else { } else {
if (uid) {
const redirect = localStorage.getItem('binding_redirect')
if (redirect) {
localStorage.removeItem('binding_redirect')
history.replace(JSON.parse(redirect))
} else {
location.assign(data.data['jump_url']) location.assign(data.data['jump_url'])
} }
}
}
} else { } else {
...@@ -150,6 +192,8 @@ const formikConfig = { ...@@ -150,6 +192,8 @@ const formikConfig = {
} }
}) })
} }
}
} }
export default compose( export default compose(
connect( connect(
......
...@@ -67,7 +67,8 @@ const storeUser = (res, dispatch) => { ...@@ -67,7 +67,8 @@ const storeUser = (res, dispatch) => {
payload = { payload = {
hasError: true, hasError: true,
msg: data.msg, msg: data.msg,
data: {} data: {},
code: data.errno
} }
} }
dispatch(setCurrentUser(payload)) dispatch(setCurrentUser(payload))
......
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