|
|
@@ -62,6 +62,12 @@ export function parsePowerSwitchStatus (powers) {
|
|
|
|
|
|
export function parseCachePower ({ switchStatus, typeArray = '[]' }) {
|
|
|
if (switchStatus > Power.LOADING) {
|
|
|
+ if (!typeArray) {
|
|
|
+ return {
|
|
|
+ switchStatus: Power.LOADING,
|
|
|
+ powers: []
|
|
|
+ }
|
|
|
+ }
|
|
|
typeArray = JSON.parse(typeArray)
|
|
|
// 默认8个电源
|
|
|
const powers = switchStatus.toString(2).padStart(typeArray.length || 8, '0').split('')
|