From ec3e9c8b3cd8d31359ce0a25e8eb97d84a55a284 Mon Sep 17 00:00:00 2001 From: luxiaotao1123 <t1341870251@163.com> Date: 星期五, 10 七月 2020 09:10:01 +0800 Subject: [PATCH] # --- src/main/webapp/views/pdaCe/login.html | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/src/main/webapp/views/pdaCe/login.html b/src/main/webapp/views/pdaCe/login.html index ae52528..1db6f01 100644 --- a/src/main/webapp/views/pdaCe/login.html +++ b/src/main/webapp/views/pdaCe/login.html @@ -59,6 +59,9 @@ } }, function (res) { if (res.code === 200) { + // localStorage.setItem("token", res.data.token); + // localStorage.setItem("username", res.data.username); + setCookie("token", res.data.token); window.location.href = "index.html"; } else { alert(res.msg); @@ -67,6 +70,19 @@ }) } + // 璁剧疆cookie + function setCookie(objName, objValue){//娣诲姞cookie + var str = objName + "=" + encodeURIComponent(objValue); + // if (objHours > 0) {//涓�0鏃朵笉璁惧畾杩囨湡鏃堕棿锛屾祻瑙堝櫒鍏抽棴鏃禼ookie鑷姩娑堝け + // var date = new Date(); + // var ms = objHours * 3600 * 1000; + // date.setTime(date.getTime() + ms); + // str += "; expires=" + date.toUTCString(); + // } + str += "; path=/"; + document.cookie = str; + } + function httpRequest(paramObj,fun,errFun) { var xmlhttp = null; /*鍒涘缓XMLHttpRequest瀵硅薄锛� -- Gitblit v1.9.1