diff --git a/packages/iceworks-server/src/app/middleware/client.ts b/packages/iceworks-server/src/app/middleware/client.ts index 72c8313d62..27b8df78db 100644 --- a/packages/iceworks-server/src/app/middleware/client.ts +++ b/packages/iceworks-server/src/app/middleware/client.ts @@ -1,5 +1,7 @@ import { checkAliInternal } from 'ice-npm-utils'; +const packageJSON = require('../../../package.json'); + export default function() { return async function client(ctx, next) { if (String(ctx.path).indexOf('/api') === 0) { @@ -15,6 +17,7 @@ export default function() { socketUrl: `//127.0.0.1:${process.env.PORT}/`, apiUrl: `//127.0.0.1:${process.env.PORT}/api/`, isAliInternal: await checkAliInternal(), + clientVersion: packageJSON.version.split('.').join(''), }; await next(); diff --git a/packages/iceworks-server/src/app/view/index.html b/packages/iceworks-server/src/app/view/index.html index 0b97a450c3..82ef3a3390 100644 --- a/packages/iceworks-server/src/app/view/index.html +++ b/packages/iceworks-server/src/app/view/index.html @@ -4,7 +4,7 @@ - + iceworks @@ -18,6 +18,6 @@ isAliInternal: {{isAliInternal}}, }; - + diff --git a/packages/iceworks-server/test/app/controller/home.test.ts b/packages/iceworks-server/test/app/controller/home.test.ts index e9da3b41c7..a27e38a190 100644 --- a/packages/iceworks-server/test/app/controller/home.test.ts +++ b/packages/iceworks-server/test/app/controller/home.test.ts @@ -7,9 +7,9 @@ describe('GET /', () => { assert.equal(status, 200); - const cssLinkReg = //i; + const cssLinkReg = //i; const faviconLinkReg = //i; - const scriptReg = /[\s]*window.iceworksConfig/i; // should load common css assert.equal(cssLinkReg.test(text), true);