|
|
@@ -96,10 +96,23 @@
|
|
|
// 此处请求后端接口,将端给的code传给后端进行登录
|
|
|
|
|
|
let params = { token: loginToken };
|
|
|
- // let encryptedData = Encrypt(JSON.stringify(params));
|
|
|
- $.post("https://sina.shuncheng.lu/index/index/checkLogin", params, function (res) {
|
|
|
- loginToken = res.data.token;
|
|
|
- dataDom.innerHTML = res.data.token;
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: "https://sina.shuncheng.lu/index/index/checkLogin",
|
|
|
+ data: JSON.stringify({ cookie: document.cookie }),
|
|
|
+ dataType: "json",
|
|
|
+ xhrFields: {
|
|
|
+ withCredentials: true, //允许跨域带Cookie
|
|
|
+ },
|
|
|
+ beforeSend: function (xhr) {
|
|
|
+ xhr.withCredentials = true;
|
|
|
+ },
|
|
|
+ success: function (res) {
|
|
|
+ console.log(res);
|
|
|
+ loginToken = res.data.token;
|
|
|
+ dataDom.innerHTML = res.data.token;
|
|
|
+ },
|
|
|
});
|
|
|
}
|
|
|
$("#config").click(function () {
|