diff --git a/utils/service/index.js b/utils/service/index.js index 9ebb143..848a07f 100644 --- a/utils/service/index.js +++ b/utils/service/index.js @@ -32,12 +32,14 @@ const request = new Request({ // response.config.headers["Authorization"] = response.data.data.Token; // } if (response.data.code === 401) { - const id = uni.getStorageSync("id",id); - const pid = uni.getStorageSync("pid",pid); - console.log("id",id) + uni.clearStorageSync() + const params = new URLSearchParams(window.location.search) + const id = params.get('id') + const pid = params.get('pid') uni.navigateTo({ - url: "/pages/login/index?id=" + id + "&pid=" + pid, + url: "/pages/login/index?id="+id+'&pid='+pid, }); + return false } if ([200, 201, 204].includes(response.status)) { return response.config.responseType === "blob" ? response : response;