forked from wangjiadong/comp
Compare commits
No commits in common. '62628df4e97941ff734c078189b4f88dc6ab91fa' and 'fe0a559802222d3674fee7ea8a05c94dd54606ae' have entirely different histories.
62628df4e9
...
fe0a559802
5 changed files with 3 additions and 57 deletions
@ -1,35 +0,0 @@ |
|||||||
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