Add frontend version

This commit is contained in:
Louis Lam
2022-06-28 21:55:05 +08:00
parent 8542e6cbb9
commit e36b65c2df
3 changed files with 41 additions and 1 deletions

View File

@@ -601,6 +601,28 @@ export default {
return result;
},
/**
* Frontend Version
* It should be compiled to a static value while building the frontend.
* Please see ./config/vite.config.js, it is defined via vite.js
* @returns {string}
*/
frontendVersion() {
// eslint-disable-next-line no-undef
return FRONTEND_VERSION;
},
/**
* Are both frontend and backend in the same version?
* @returns {boolean}
*/
isFrontendBackendVersionMatched() {
if (!this.info.version) {
return true;
}
return this.info.version === this.frontendVersion;
}
},
watch: {