mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-12 19:51:39 +08:00
后台管理前端结构调整;管理员后台添加第三方账号绑定
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<button class="btn-third-party" id="btn_gitee" onclick="thirdPartyLogin('gitee')">Gitee</button>
|
||||
<button class="btn-third-party" id="btn_oschina" onclick="thirdPartyLogin('OSCHINA')">OSCHINA</button>
|
||||
<button class="btn-third-party" id="btn_feishu" onclick="thirdPartyLogin('feishu')">飞书</button>
|
||||
<button class="btn-third-party" id="btn_github" onclick="thirdPartyLogin('GitHub')">GitHub(不稳定)</button>
|
||||
<button class="btn-third-party" id="btn_qq" onclick="thirdPartyLogin('qq')">QQ</button>
|
||||
<script>
|
||||
// 第三方授权登录逻辑
|
||||
function thirdPartyLogin(platform) {
|
||||
getRequest("/third-party/login", { platform: platform })
|
||||
.then(function (response) {
|
||||
var axiosData = response.data;
|
||||
var status = axiosData.status;
|
||||
var data = axiosData.data;
|
||||
if (status === "success") {
|
||||
location.href = data;
|
||||
} else {
|
||||
alert(`出错啦!${data.errMsg} (错误码: ${data.errCode}) `);
|
||||
}
|
||||
}).catch(function (error) {
|
||||
console.log(error);
|
||||
alert("无法连接到服务器,请检查网络连接!");
|
||||
});
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user