Commit 2481bf73 authored by xiabin's avatar xiabin

修改支付后的弹窗问题

parent d00b25bc
...@@ -280,13 +280,13 @@ function actionResetPasswordSuccess() ...@@ -280,13 +280,13 @@ function actionResetPasswordSuccess()
/** /**
* 设置登录后回调url * 设置登录后回调url
* @param $url
* @throws \yii\web\ForbiddenHttpException * @throws \yii\web\ForbiddenHttpException
*/ */
public public
function actionSetReturnUrl($url) function actionSetReturnUrl()
{ {
if (Yii::$app->request->isAjax) { if (Yii::$app->request->isAjax) {
$url = Yii::$app->request->post('returnUrl');
Yii::$app->user->setReturnUrl($url); Yii::$app->user->setReturnUrl($url);
Utils::ajaxResponse(TRUE); Utils::ajaxResponse(TRUE);
} else { } else {
......
...@@ -199,10 +199,19 @@ ...@@ -199,10 +199,19 @@
window.location.href = url; window.location.href = url;
}, },
login(){ login(){
var returnUrl = __BASE_URL__ + 'home/video?courseId=' + this.coursewareInfo.course_id + '&pay=1'; var returnUrl = __BASE_URL__ + 'home/video?pay=1&courseId=' + this.coursewareInfo.course_id;
returnUrl = encodeURI(returnUrl);
var url = __BASE_URL__ + 'site/set-return-url?url=' + returnUrl; var url = __BASE_URL__ + 'site/set-return-url?url=' + returnUrl;
$.getJSON(url, function () { $.ajax({
window.location.href = __BASE_URL__ + 'site/login'; type:'POST',
url:url,
data: {
returnUrl:returnUrl
},
dataType: "json",
success:function () {
window.location.href = __BASE_URL__ + 'site/login';
}
}).error(function () { }).error(function () {
layer.alert('设置登录回调url错误', {'icon': 2, 'title': '提示'}) layer.alert('设置登录回调url错误', {'icon': 2, 'title': '提示'})
}); });
......
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