migrate vuex modules

This commit is contained in:
AceDataCloud committed 2023-12-28 03:11:04 +08:00
1 parent 9c5ce9acf3
commit f39e155301
17 files changed
+177 -133

No files matched your search

+3 -3
View File
@@ -33,18 +33,18 @@ export default defineComponent({
}
if (this.accessToken && this.refreshToken) {
// store token to global store
await this.$store.dispatch('setToken', {
await this.$store.dispatch('common/setToken', {
refresh: this.refreshToken,
access: this.accessToken
});
console.debug('set token successfully');
const { data: user } = await userOperator.getMe();
await this.$store.dispatch('setUser', user);
await this.$store.dispatch('common/setUser', user);
console.debug('set user successfully');
const { data: applications } = await applicationOperator.getAll({
user_id: user.id
});
await this.$store.dispatch('setApplications', applications);
await this.$store.dispatch('common/setApplications', applications);
console.debug('set applications successfully');
if (this.redirect) {
this.$router.push(this.redirect);