mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-05-03 20:47:49 +08:00
修复第一次登录失败的Bug
This commit is contained in:
parent
a01cb91cbd
commit
5d5472db5d
@ -144,7 +144,7 @@ func (c *AccountController) DingTalkLogin() {
|
||||
|
||||
code := c.GetString("code")
|
||||
if code == "" {
|
||||
c.Redirect(conf.URLFor("AccountController.Login"), 302)
|
||||
c.JsonResult(500, "获取身份信息失败", nil)
|
||||
}
|
||||
|
||||
appKey := beego.AppConfig.String("dingtalk_app_key")
|
||||
|
@ -88,6 +88,7 @@
|
||||
<script src="{{cdnjs "/static/layer/layer.js"}}" type="text/javascript"></script>
|
||||
<script src="{{cdnjs "/static/js/dingtalk-jsapi.js"}}" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
if (dd.env.platform !== "notInDingTalk"){
|
||||
dd.ready(function() {
|
||||
dd.runtime.permission.requestAuthCode({
|
||||
@ -112,16 +113,18 @@
|
||||
if (res.errcode !== 0) {
|
||||
layer.msg(res.message)
|
||||
} else {
|
||||
window.location = "/"
|
||||
window.location = "{{ urlfor "HomeController.Index" }}"
|
||||
}
|
||||
},
|
||||
// error: function () {
|
||||
// }
|
||||
error: function (res) {
|
||||
window.location = "{{ urlfor "HomeController.Index" }}"
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
Loading…
Reference in New Issue
Block a user