diff --git a/src/App.vue b/src/App.vue index b325c96..b015168 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,9 +2,9 @@ export default { onLaunch: function () {}, onShow: function () { - console.log("App Show"); const token = window?.plus?.storage.getItem("token"); uni.setStorageSync("token", token); + console.log("App Show", uni.getStorageSync("token")); }, onHide: function () { console.log("App Hide"); diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index 07435dc..ab4691d 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -121,9 +121,10 @@ onLoad((options) => { state.id = options.id; state.pid = options.pid; const token = window?.plus?.storage.getItem("token"); - if (!uni.setStorageSync("token", token)) { + if (!uni.getStorageSync("token")) { uni.setStorageSync("token", token); } + console.log("token", uni.getStorageSync("token")); // 已经登录了 if (uni.getStorageSync("token") || uni.getStorageSync("store-token")) { paintingDetail(); diff --git a/utils/service/index.js b/utils/service/index.js index ba60b48..5d63f44 100644 --- a/utils/service/index.js +++ b/utils/service/index.js @@ -3,7 +3,7 @@ import useToast from "@/hooks/toast/useToast.js"; import { OAorMc } from "../index.js"; const { showMessage } = useToast(); console.log( - "token", + "tokenServer", window?.plus?.storage.getItem("token"), uni.getStorageSync("token") );