修改代码兼容低版本

newCac1.0
fanluyan 7 months ago
parent cc492003b3
commit ad57243c3a

@ -1,15 +1,27 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang=""> <html lang="">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<meta http-equiv="pragma" content="no-cache" />
<meta
http-equiv="cache-control"
content="no-cache, no-store, must-revalidate"
/>
<meta http-equiv="expires" content="0" />
<link rel="icon" href="<%= BASE_URL %>favicon.ico" />
<title><%= htmlWebpackPlugin.options.title %></title> <title><%= htmlWebpackPlugin.options.title %></title>
</head> </head>
<body> <body>
<noscript> <noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> <strong
>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
properly without JavaScript enabled. Please enable it to
continue.</strong
>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->

@ -283,7 +283,14 @@ export default {
this.deviceTitle = JSON.parse(deviceInfoVal); this.deviceTitle = JSON.parse(deviceInfoVal);
} else { } else {
// 使 res.data[0].id // 使 res.data[0].id
this.deviceTypeVal = res.data[0]?.id; // 使 res.data[0] undefined //this.deviceTypeVal = res.data[0]?.id; // 使 res.data[0] undefined
this.deviceTypeVal =
res.data &&
Array.isArray(res.data) &&
res.data.length > 0 &&
res.data[0] !== null
? res.data[0].id
: undefined;
this.deviceTitle = res.data[0].mc; this.deviceTitle = res.data[0].mc;
// areaVal localStorage // areaVal localStorage
localStorage.setItem( localStorage.setItem(
@ -368,7 +375,11 @@ export default {
this.areaVal = JSON.parse(storedAreaVal); this.areaVal = JSON.parse(storedAreaVal);
} else { } else {
// 使 res.data[0].id // 使 res.data[0].id
this.areaVal = res.data[0]?.id; // 使 res.data[0] undefined
this.areaVal =
res.data && res.data.length > 0 && res.data[0] !== null
? res.data[0].id
: undefined;
// areaVal localStorage // areaVal localStorage
localStorage.setItem("areaVal", JSON.stringify(this.areaVal)); localStorage.setItem("areaVal", JSON.stringify(this.areaVal));

Loading…
Cancel
Save