forked from wangjiadong/comp
Compare commits
2 Commits
fe0a559802
...
62628df4e9
Author | SHA1 | Date |
---|---|---|
significative | 62628df4e9 | 2 months ago |
significative | 91352652fe | 2 months ago |
5 changed files with 57 additions and 3 deletions
@ -0,0 +1,35 @@ |
||||
import { defineStore } from 'pinia'; |
||||
import axios from 'axios'; |
||||
const setting = { |
||||
id: '', |
||||
createBy: '', |
||||
createTime: '', |
||||
updateBy: '', |
||||
updateTime: '', |
||||
sysOrgCode: '', |
||||
name: '', |
||||
logo: '', |
||||
newsPage: '', |
||||
recordNumber: '', |
||||
copyright: '', |
||||
certificate: '', |
||||
composition: '', |
||||
}; |
||||
async function getSetting(setting) { |
||||
console.count('请求---'); |
||||
|
||||
const res = await axios({ method: 'post', url: `${import.meta.env.VITE_GLOB_DOMAIN_URL}/sysconfiguration/sysConfiguration/findconfig` }); |
||||
Object.assign(setting, res.data.result); |
||||
setting.logo = import.meta.env.VITE_GLOB_DOMAIN_URL + '/' + setting.logo; |
||||
} |
||||
|
||||
export const useSettingStore = defineStore('setting', { |
||||
state: () => { |
||||
getSetting(setting); |
||||
const getDescriptor = (prop: string) => { |
||||
return { get: () => setting[prop] }; |
||||
}; |
||||
|
||||
return { setting, getDescriptor }; |
||||
}, |
||||
}); |
Loading…
Reference in new issue