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);
+1 -1
View File
@@ -105,7 +105,7 @@ export default defineComponent({
async onFetchApplications() {
this.initializing = true;
const { data: applications } = await applicationOperator.getAll({
user_id: this.$store.state.user.id,
user_id: this.$store.state.common.user.id,
api_id: [
CHAT_MODEL_CHATGPT.apiId,
CHAT_MODEL_CHATGPT_16K.apiId,
+2 -2
View File
@@ -73,7 +73,7 @@ export default defineComponent({
return {
applications: [],
channel: MIDJOURNEY_CHANNEL_FAST,
preset: this.$store.getters.midjourney.preset,
preset: this.$store.state.midjourney.preset,
prompt: '',
elements: [],
ignore: '',
@@ -103,7 +103,7 @@ export default defineComponent({
async onFetchApplications() {
this.initializing = true;
const { data: applications } = await applicationOperator.getAll({
user_id: this.$store.state.user.id,
user_id: this.$store.state.common.user.id,
api_id: [MIDJOURNEY_CHANNEL_FAST.apiId, MIDJOURNEY_CHANNEL_RELAX.apiId, MIDJOURNEY_CHANNEL_TURBO.apiId]
});
this.initializing = false;
+2 -2
View File
@@ -90,7 +90,7 @@ export default defineComponent({
return {
applications: [],
channel: MIDJOURNEY_CHANNEL_FAST,
preset: this.$store.getters.midjourney.preset || {},
preset: this.$store.state.midjourney.preset || {},
prompt: '',
elements: [],
ignore: '',
@@ -177,7 +177,7 @@ export default defineComponent({
async onFetchApplications() {
this.initializing = true;
const { data: applications } = await applicationOperator.getAll({
user_id: this.$store.state.user.id,
user_id: this.$store.state.common.user.id,
api_id: [MIDJOURNEY_CHANNEL_FAST.apiId, MIDJOURNEY_CHANNEL_RELAX.apiId, MIDJOURNEY_CHANNEL_TURBO.apiId]
});
this.initializing = false;