From 701a37b63633852954601229c03cf7145a293b0c Mon Sep 17 00:00:00 2001 From: sunhao Date: Wed, 20 Mar 2019 11:03:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=20env=E4=B8=AD=20=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=20nonce=20=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/render.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/render.ts b/src/utils/render.ts index ebbe7bd..5a15937 100644 --- a/src/utils/render.ts +++ b/src/utils/render.ts @@ -24,12 +24,13 @@ function makeLoginPageUrl(toPath: string) { return newUrl } -function getWindowEnv(renderEnv: string[]) { +function getWindowEnv(renderEnv: string[], nonce: string) { const env = renderEnv.reduce(function(obj: any, key) { obj[key] = process.env[key] return obj }, {}) env.VUE_ENV = 'client' + env.NONCE = nonce return serialize(env, { isJSON: true }) } @@ -54,7 +55,7 @@ function getContextHead( : '' const nonceStr = nonce ? `nonce="${nonce}"` : '' return ``