Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Commit

Permalink
move FRONTEND_APP_VERSION to .env
Browse files Browse the repository at this point in the history
Signed-off-by: cbh778899 <[email protected]>
  • Loading branch information
cbh778899 committed Jun 30, 2024
1 parent ad76d4a commit 82eeb6b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FRONTEND_APP_VERSION = '0.1.3'
5 changes: 5 additions & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ export default defineNuxtConfig({
// })
// }
],
runtimeConfig: {
public: {
FRONTEND_APP_VERSION: process.env.FRONTEND_APP_VERSION
}
},
css: [
'@/assets/css/unit.css'
],
Expand Down
3 changes: 1 addition & 2 deletions tools/getVersions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { FRONTEND_APP_VERSION } from "~/types/version";
import request from "./request";

async function getVersions(ofEnd:'frontend'|'backend') {
if(ofEnd === 'frontend') {
return FRONTEND_APP_VERSION;
return useRuntimeConfig().public.FRONTEND_APP_VERSION
} else if(ofEnd === 'backend') {
return (await request('/version')).version
}
Expand Down
1 change: 0 additions & 1 deletion types/version.ts

This file was deleted.

0 comments on commit 82eeb6b

Please sign in to comment.