Commit ff71e8ed authored by 陈珊's avatar 陈珊

getCookie

parent 7bf14c0e
...@@ -132,7 +132,7 @@ new Vue({ ...@@ -132,7 +132,7 @@ new Vue({
GetSessionInfo(){ GetSessionInfo(){
let _this = this; let _this = this;
let data = { let data = {
token: sessionStorage.getItem("op_code") token: getCookie("op_code")
// token: "ADA90463-7ABE-4564-83A6-B6BB278975D0" // token: "ADA90463-7ABE-4564-83A6-B6BB278975D0"
} }
$.ajax({ $.ajax({
......
...@@ -54,3 +54,17 @@ function sort(obj) { ...@@ -54,3 +54,17 @@ function sort(obj) {
} }
return str; return str;
} }
function getCookie(cookieName) {
const strCookie = document.cookie
const cookieList = strCookie.split(';')
for(let i = 0; i < cookieList.length; i++) {
const arr = cookieList[i].split('=')
if (cookieName === arr[0].trim()) {
return arr[1]
}
}
return ''
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment