Commit 94c22462 authored by 乐宝呗666's avatar 乐宝呗666

修改token过期的问题

parent 4e6f85c0
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -99,9 +99,9 @@ const httpServer = (opts, data, file, timeout) => {
let authToken = "";
if (opts.authType && opts.authType != "") {
if (opts.authType === "back") {
authToken =sessionStorage.getItem('sToken') || "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInVzZXJfaWQiOiIxIiwiaXNzIjoiSUFUQSIsImV4cCI6MTYxNjY2NTkzOCwiaWF0IjoxNjE2NjUxNTM4fQ._nqZq0LMwkurIBKJtfX-imXLCxQSNwJ-ueGZ8iwW-0oAW880gY7PjNEfroYYQZ91v0u5yQb73Alzvy6EIp6GGg"
authToken =sessionStorage.getItem('token') || "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsInVzZXJfaWQiOiIxIiwiaXNzIjoiSUFUQSIsImV4cCI6MTYxNjY2NTkzOCwiaWF0IjoxNjE2NjUxNTM4fQ._nqZq0LMwkurIBKJtfX-imXLCxQSNwJ-ueGZ8iwW-0oAW880gY7PjNEfroYYQZ91v0u5yQb73Alzvy6EIp6GGg"
} else if (opts.authType === "front") {
authToken = sessionStorage.getItem("sToken");
authToken = sessionStorage.getItem("token");
}
httpDefaultOpts.headers["Authorization"] = authToken
}
......@@ -109,7 +109,7 @@ const httpServer = (opts, data, file, timeout) => {
delete httpDefaultOpts.data
httpDefaultOpts.params.timestamp_static = new Date().getTime();
} else {
// delete httpDefaultOpts.params
delete httpDefaultOpts.params
if (file) {
httpDefaultOpts.data = data;
}
......@@ -134,8 +134,8 @@ const httpServer = (opts, data, file, timeout) => {
message: '您的登录过期,请重新登录!',
onClose: () => {
//这个时候点击确定后清除用户信息
sessionStorage.removeItem('sToken')
sessionStorage.removeItem('sUserInfo')
sessionStorage.removeItem('token')
sessionStorage.removeItem('userInfo')
router.push({
path: '/',
query: {
......
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