mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-21 01:10:39 +08:00
第三方登录回调后登陆系统用户逻辑基本完成
This commit is contained in:
43
bookshelfplus-frontend/views/callback.html
Normal file
43
bookshelfplus-frontend/views/callback.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<title><%=title%></title>
|
||||
<!-- <script src="/assets/lib/jquery/3.6.0/jquery.min.js"></script> -->
|
||||
<script src="/assets/lib/axios/0.26.1/axios.min.js"></script>
|
||||
<script src="/assets/javascripts/httpRequest.js"></script>
|
||||
<script>
|
||||
// API地址
|
||||
const APIHOST = '<%= global.site.api.prefix %>';
|
||||
axios.defaults.baseURL = APIHOST;
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<p id="displayText">
|
||||
正在跳转中,请稍后...
|
||||
</p>
|
||||
<script>
|
||||
getRequest("/third-party/callback/<%=platform%>" + location.search)
|
||||
.then(function (response) {
|
||||
var axiosData = response.data;
|
||||
var status = axiosData.status;
|
||||
var data = axiosData.data;
|
||||
if (status === "success") {
|
||||
console.log(data)
|
||||
} else {
|
||||
alert(`出错啦!${data.errMsg} (错误码: ${data.errCode}) `);
|
||||
location.replace("/login");
|
||||
}
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
document.getElementById("displayText").innerHTML="系统错误,请稍后再试!";
|
||||
document.getElementById("displayText").style.color="red";
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
Reference in New Issue
Block a user