35 lines
769 B
TypeScript
35 lines
769 B
TypeScript
import { defineStore } from 'pinia';
|
|
import { getOssConfig } from '@/api/common';
|
|
|
|
interface OssConfigState {
|
|
ossConfig: any; // 根据实际数据类型定义接口
|
|
}
|
|
|
|
export const useOssConfigStore = defineStore('ossConfig', {
|
|
state: (): OssConfigState => ({
|
|
ossConfig: null,
|
|
}),
|
|
getters: {
|
|
getConfig() {
|
|
return this.ossConfig;
|
|
},
|
|
},
|
|
actions: {
|
|
setOssConfigState(info) {
|
|
this.ossConfig = info;
|
|
},
|
|
setOssConfig() {
|
|
// return new Promise((resolve, reject) => {
|
|
// getOssConfig()
|
|
// .then((res) => {
|
|
// this.setOssConfigState(res);
|
|
// resolve(res);
|
|
// })
|
|
// .catch((error) => {
|
|
// reject(error);
|
|
// });
|
|
// });
|
|
},
|
|
},
|
|
});
|