Compare commits
No commits in common. "83dee1a811d8edaab656e4f92365bfbd2e583112" and "e7ed00472dd029a168ba0df2d1d0015cb8631c77" have entirely different histories.
83dee1a811
...
e7ed00472d
@ -3,8 +3,6 @@ export default {
|
|||||||
onLaunch: function () {},
|
onLaunch: function () {},
|
||||||
onShow: function () {
|
onShow: function () {
|
||||||
console.log("App Show");
|
console.log("App Show");
|
||||||
const token = window?.plus?.storage.getItem("token");
|
|
||||||
uni.setStorageSync("token", token);
|
|
||||||
},
|
},
|
||||||
onHide: function () {
|
onHide: function () {
|
||||||
console.log("App Hide");
|
console.log("App Hide");
|
||||||
|
@ -120,12 +120,12 @@ onLoad((options) => {
|
|||||||
console.log("options", options);
|
console.log("options", options);
|
||||||
state.id = options.id;
|
state.id = options.id;
|
||||||
state.pid = options.pid;
|
state.pid = options.pid;
|
||||||
const token = window?.plus?.storage.getItem("token");
|
const token =
|
||||||
if (!uni.setStorageSync("token", token)) {
|
window?.plus?.storage.getItem("token") ||
|
||||||
uni.setStorageSync("token", token);
|
uni.getStorageSync("store-token");
|
||||||
}
|
console.log("token", token);
|
||||||
// 已经登录了
|
// 已经登录了
|
||||||
if (uni.getStorageSync("token") || uni.getStorageSync("store-token")) {
|
if (token) {
|
||||||
paintingDetail();
|
paintingDetail();
|
||||||
getBtngetRules();
|
getBtngetRules();
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,7 @@ import Request from "./request/index.js";
|
|||||||
import useToast from "@/hooks/toast/useToast.js";
|
import useToast from "@/hooks/toast/useToast.js";
|
||||||
import { OAorMc } from "../index.js";
|
import { OAorMc } from "../index.js";
|
||||||
const { showMessage } = useToast();
|
const { showMessage } = useToast();
|
||||||
console.log(
|
console.log(window?.plus?.storage.getItem("token"));
|
||||||
"token",
|
|
||||||
window?.plus?.storage.getItem("token"),
|
|
||||||
uni.getStorageSync("token")
|
|
||||||
);
|
|
||||||
const request = new Request({
|
const request = new Request({
|
||||||
baseURL:
|
baseURL:
|
||||||
OAorMc() === "MC"
|
OAorMc() === "MC"
|
||||||
@ -22,7 +18,9 @@ const request = new Request({
|
|||||||
: "application/json";
|
: "application/json";
|
||||||
|
|
||||||
const token =
|
const token =
|
||||||
uni.getStorageSync("token") || uni.getStorageSync("store-token") || "";
|
window?.plus?.storage.getItem("token") ||
|
||||||
|
uni.getStorageSync("store-token") ||
|
||||||
|
"";
|
||||||
if (config.isFormData) {
|
if (config.isFormData) {
|
||||||
config.headers["Content-Type"] = "multipart/form-data";
|
config.headers["Content-Type"] = "multipart/form-data";
|
||||||
config.headers["Authorization"] = token;
|
config.headers["Authorization"] = token;
|
||||||
|
Loading…
Reference in New Issue
Block a user