修改代码兼容低版本

newCac1.0
fanluyan 7 months ago
parent cc492003b3
commit ad57243c3a

@ -1,15 +1,27 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<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>
</head>
<body>
<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>
<div id="app"></div>
<!-- built files will be auto injected -->

@ -283,7 +283,14 @@ export default {
this.deviceTitle = JSON.parse(deviceInfoVal);
} else {
// 使 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;
// areaVal localStorage
localStorage.setItem(
@ -368,7 +375,11 @@ export default {
this.areaVal = JSON.parse(storedAreaVal);
} else {
// 使 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
localStorage.setItem("areaVal", JSON.stringify(this.areaVal));

Loading…
Cancel
Save