Commit c930584c8693fd2f2b984e80d47c0c3caf1663fd
Merge branch 'fix/phone-enter' into 'main_dev'
fix: 修复移动端无法进入组态 See merge request yunteng/thingskit-scada!256
Showing
2 changed files
with
10 additions
and
2 deletions
@@ -165,7 +165,15 @@ function getProxyPrefix() { | @@ -165,7 +165,15 @@ function getProxyPrefix() { | ||
165 | return window.urlParams.isProxyMode ? window.urlParams.proxyPrefix : '' | 165 | return window.urlParams.isProxyMode ? window.urlParams.proxyPrefix : '' |
166 | } | 166 | } |
167 | 167 | ||
168 | -const drawioConfig = JSON.parse(localStorage.getItem('.drawio-config') || null) | 168 | +const drawioConfig = ( |
169 | + () => { | ||
170 | + try { | ||
171 | + return JSON.parse(localStorage.getItem('.drawio-config') || null) | ||
172 | + } catch { | ||
173 | + return {} | ||
174 | + } | ||
175 | + } | ||
176 | +)() | ||
169 | 177 | ||
170 | const localLang = drawioConfig?.language | 178 | const localLang = drawioConfig?.language |
171 | 179 |
@@ -39,7 +39,7 @@ export function getShareRefreshToken(): string { | @@ -39,7 +39,7 @@ export function getShareRefreshToken(): string { | ||
39 | } | 39 | } |
40 | 40 | ||
41 | export function getLocale() { | 41 | export function getLocale() { |
42 | - const { language } = (JSON.parse(localStorage.getItem('.drawio-config') || '') || {}) as DrawioConfig | 42 | + const { language } = (JSON.parse(localStorage.getItem('.drawio-config') || '{}') || {}) as DrawioConfig |
43 | 43 | ||
44 | return language | 44 | return language |
45 | } | 45 | } |