webContent.js 632 B

12345678910111213141516171819202122232425
  1. import { defineStore } from 'pinia'
  2. import { getWebContent } from '@/api/common'
  3. export const webContentStore = defineStore('webContent',
  4. {
  5. state: () => ({
  6. loginBgUrl: '' // 登录页背景图
  7. }),
  8. actions: {
  9. async getSystemWebContent () {
  10. try {
  11. const data = await getWebContent()
  12. this.loginBgUrl = data.pcLoginBackground && data.pcLoginBackground.length ? data.pcLoginBackground[0].img : 'https://minio.menduner.com/dev/menduner/login-bgc.jpg'
  13. } catch (error) {
  14. console.log(error)
  15. }
  16. }
  17. }
  18. },
  19. {
  20. persist: true,
  21. devtools: true
  22. }
  23. )