保存
This commit is contained in:
21
mail-vue/src/store/setting.js
Normal file
21
mail-vue/src/store/setting.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { settingQuery} from "@/request/setting.js";
|
||||
|
||||
export const useSettingStore = defineStore('setting', {
|
||||
state: () => ({
|
||||
domainList: [],
|
||||
settings: {
|
||||
title: '-'
|
||||
}
|
||||
}),
|
||||
actions: {
|
||||
async initSetting() {
|
||||
if (this.domainList.length === 0) {
|
||||
const data = await settingQuery()
|
||||
this.domainList.push(...data.domainList)
|
||||
delete data.domainList
|
||||
this.settings = data
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user