use pinia to replace vuex, code refactor

This commit is contained in:
MaysWind
2023-06-10 23:13:31 +08:00
parent 0d84f2857f
commit 46d85e92cd
80 changed files with 4972 additions and 4859 deletions
+9 -3
View File
@@ -41,8 +41,14 @@
</template>
<script>
import { mapStores } from 'pinia';
import { useUserStore } from '@/stores/user.js';
import licenses from '@/lib/licenses.js';
export default {
computed: {
...mapStores(useUserStore),
version() {
return 'v' + this.$version;
},
@@ -51,13 +57,13 @@ export default {
return this.$buildTime;
}
return this.$utilities.formatUnixTime(this.$buildTime, this.$locale.getLongDateTimeFormat());
return this.$locale.formatUnixTimeToLongDateTime(this.userStore, this.$buildTime);
},
licenseLines() {
return this.$licenses.license.replaceAll(/\r/g, '').split('\n');
return licenses.getLicense().replaceAll(/\r/g, '').split('\n');
},
thirdPartyLicenses() {
return this.$licenses.thirdPartyLicenses;
return licenses.getThirdPartyLicenses();
}
}
}