fix
This commit is contained in:
parent
00da50d7ff
commit
2a1f3f6876
@ -145,12 +145,14 @@ const backScan = () => {
|
||||
closeWebview();
|
||||
};
|
||||
const runTimeEnv = () => {
|
||||
if (plus) {
|
||||
const currentWebView = plus.webview.getWebviewById("wv");
|
||||
return currentWebView.RunTime === "app";
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
if (plus) {
|
||||
const currentWebView = plus.webview.getWebviewById("wv");
|
||||
return currentWebView.RunTime === "app";
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} catch (e) {}
|
||||
};
|
||||
const getBtngetRules = async () => {
|
||||
const res = await getRules({});
|
||||
|
@ -128,7 +128,7 @@ onLoad((options) => {
|
||||
// 已经登录了
|
||||
if (
|
||||
uni.getStorageSync("token") ||
|
||||
plus.webview.getWebviewById("wv").tokenScan ||
|
||||
window?.plus?.webview.getWebviewById("wv").tokenScan ||
|
||||
uni.getStorageSync("store-token")
|
||||
) {
|
||||
paintingDetail();
|
||||
|
@ -111,6 +111,11 @@ const doneSet = async () => {
|
||||
showMessage({ type: "sucess", message: "入库成功" });
|
||||
isButtonDisabled.value = true;
|
||||
buttonText.value = "已入库";
|
||||
if (runTimeEnv()) {
|
||||
setTimeout(() => {
|
||||
closeWebview();
|
||||
}, 2000);
|
||||
}
|
||||
} else {
|
||||
showMessage({ type: "error", message: res.msg });
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ console.log(
|
||||
window?.plus?.storage.getItem("token"),
|
||||
uni.getStorageSync("token")
|
||||
);
|
||||
console.log("webview", plus.webview.getWebviewById("wv").tokenScan);
|
||||
console.log("webview", window?.plus?.webview.getWebviewById("wv").tokenScan);
|
||||
const request = new Request({
|
||||
baseURL:
|
||||
OAorMc() === "MC"
|
||||
@ -24,7 +24,7 @@ const request = new Request({
|
||||
|
||||
const token =
|
||||
uni.getStorageSync("token") ||
|
||||
plus.webview.getWebviewById("wv").tokenScan ||
|
||||
window?.plus?.webview.getWebviewById("wv").tokenScan ||
|
||||
uni.getStorageSync("store-token") ||
|
||||
"";
|
||||
if (config.isFormData) {
|
||||
|
Loading…
Reference in New Issue
Block a user