This commit is contained in:
Aiden 2024-10-24 15:21:06 +08:00
parent 4fff364217
commit 0455590dfe
3 changed files with 8 additions and 11 deletions

View File

@ -141,7 +141,6 @@ onLoad((options) => {
});
const paintingDetail = async () => {
loading.value = true;
const res = await pbDetail({
id: state.id,
pid: state.pid,

View File

@ -18,11 +18,11 @@ export const closeWebview = () => {
// 判断是oa还是墨册
export const OAorMc = () => {
try {
if (window.plus) {
const currentWebView = plus.webview.getWebviewById("wv");
console.log('currentWebView.type',currentWebView.type)
console.log("currentWebView.type", currentWebView.type);
return currentWebView.type;
} catch (e) {
} else {
return "MC";
}
};

View File

@ -3,7 +3,7 @@ import useToast from "@/hooks/toast/useToast.js";
import { OAorMc } from "../index.js";
const { showMessage } = useToast();
console.log(123123, OAorMc());
console.log("OAorMc", OAorMc(), import.meta.env.VITE_API_URL);
const request = new Request({
baseURL:
OAorMc() === "MC"
@ -18,16 +18,16 @@ const request = new Request({
? "application/x-www-form-urlencoded"
: "application/json";
const token = "";
try {
let token = "";
if (window.plus) {
token = plus?.webview.getWebviewById("wv").tokenScan;
} catch (e) {
} else {
token = uni.getStorageSync("store-token");
}
console.log("tokenServer", token);
if (config.isFormData) {
config.headers["Content-Type"] = "multipart/form-data";
config.headers["Authorization"] = token;
config.headers["Authorization"] = token || "";
} else {
config.headers["Authorization"] = token;
}
@ -66,8 +66,6 @@ const request = new Request({
});
const fontRequest = (config) => {
console.log(import.meta);
if (["get", "GET"].includes(config.method)) {
config.params = config.data;
}