From 26de04cc99f7296a0fd4311bee95a3dc16684917 Mon Sep 17 00:00:00 2001 From: smallchill Date: Mon, 18 Feb 2019 09:34:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app.js b/src/app.js index 248a2ee..5507a4a 100644 --- a/src/app.js +++ b/src/app.js @@ -25,15 +25,17 @@ function ergodicRoutes(routes, authKey, authority) { } export function patchRoutes(routes) { - Object.keys(authRoutes).map(authKey => - ergodicRoutes(routes, authKey, authRoutes[authKey].authority) - ); - window.g_routes = routes; + if (authRoutes !== null && authRoutes !== undefined) { + Object.keys(authRoutes).map(authKey => + ergodicRoutes(routes, authKey, authRoutes[authKey].authority) + ); + window.g_routes = routes; + } } export function render(oldRender) { routesAuthority().then(response => { - if (response) { + if (response && response.success) { authRoutes = response.data; } oldRender();