1. 登陸成功設置cookie (服務端 通過 json返回 token)
//設置cookie document.cookie = "JSESSIONID="+data.data.token+";path=/;domain="+urlcore.split('://')[1].split(':')[0];
注: data.data.token 服務端返回的token
urlcore 接口訪問統一路徑 例子:http://127.0.0.1:8080/api......
2.請求相應接口時 設置withCredentials為true
如下為 jquery的ajax設置方式:
... dataType: 'json', xhrFields: { withCredentials: true }, ...