fix
This commit is contained in:
parent
e7ed00472d
commit
37c099ebf8
@ -1,8 +1,13 @@
|
||||
<script>
|
||||
export default {
|
||||
onLaunch: function () {},
|
||||
onLaunch: function () {
|
||||
const token = window?.plus?.storage.getItem("token");
|
||||
uni.setStorageSync("token", token);
|
||||
},
|
||||
onShow: function () {
|
||||
console.log("App Show");
|
||||
const token = window?.plus?.storage.getItem("token");
|
||||
uni.setStorageSync("token", token);
|
||||
},
|
||||
onHide: function () {
|
||||
console.log("App Hide");
|
||||
|
@ -120,12 +120,12 @@ onLoad((options) => {
|
||||
console.log("options", options);
|
||||
state.id = options.id;
|
||||
state.pid = options.pid;
|
||||
const token =
|
||||
window?.plus?.storage.getItem("token") ||
|
||||
uni.getStorageSync("store-token");
|
||||
console.log("token", token);
|
||||
const token = window?.plus?.storage.getItem("token");
|
||||
if (!uni.setStorageSync("token", token)) {
|
||||
uni.setStorageSync("token", token);
|
||||
}
|
||||
// 已经登录了
|
||||
if (token) {
|
||||
if (uni.getStorageSync("token") || uni.getStorageSync("store-token")) {
|
||||
paintingDetail();
|
||||
getBtngetRules();
|
||||
}
|
||||
|
@ -2,7 +2,11 @@ import Request from "./request/index.js";
|
||||
import useToast from "@/hooks/toast/useToast.js";
|
||||
import { OAorMc } from "../index.js";
|
||||
const { showMessage } = useToast();
|
||||
console.log(window?.plus?.storage.getItem("token"));
|
||||
console.log(
|
||||
"token",
|
||||
window?.plus?.storage.getItem("token"),
|
||||
uni.getStorageSync("token")
|
||||
);
|
||||
const request = new Request({
|
||||
baseURL:
|
||||
OAorMc() === "MC"
|
||||
@ -18,9 +22,7 @@ const request = new Request({
|
||||
: "application/json";
|
||||
|
||||
const token =
|
||||
window?.plus?.storage.getItem("token") ||
|
||||
uni.getStorageSync("store-token") ||
|
||||
"";
|
||||
uni.getStorageSync("token") || uni.getStorageSync("store-token") || "";
|
||||
if (config.isFormData) {
|
||||
config.headers["Content-Type"] = "multipart/form-data";
|
||||
config.headers["Authorization"] = token;
|
||||
|
Loading…
Reference in New Issue
Block a user