From f378078319bc480a6808890688942c5f774a234a Mon Sep 17 00:00:00 2001 From: smallchill Date: Fri, 15 Feb 2019 16:04:35 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/authority.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/authority.js b/src/utils/authority.js index 9996f57..fee394c 100644 --- a/src/utils/authority.js +++ b/src/utils/authority.js @@ -38,6 +38,10 @@ export function setRoutes(routes) { localStorage.setItem('sword-routes', JSON.stringify(routes)); } +export function getButtons() { + return JSON.parse(localStorage.getItem('sword-buttons')) || []; +} + export function getButton(code) { const buttons = getButtons(); const data = buttons.filter(d => { @@ -46,10 +50,6 @@ export function getButton(code) { return data.length === 0 ? [] : data[0].buttons; } -export function getButtons() { - return JSON.parse(localStorage.getItem('sword-buttons')) || []; -} - export function setButtons(buttons) { localStorage.removeItem('sword-buttons'); localStorage.setItem('sword-buttons', JSON.stringify(buttons));