index.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <GlobalFooter class="i-copyright" :links="links" :copyright="copyright" />
  3. </template>
  4. <script>
  5. import { copyright } from '@/api/account';
  6. export default {
  7. name: 'i-copyright',
  8. data () {
  9. return {
  10. links: [
  11. {
  12. title: '官网',
  13. key: '官网',
  14. href: 'https://www.crmeb.com',
  15. blankTarget: true
  16. },
  17. {
  18. title: '社区',
  19. key: '社区',
  20. href: 'http://q.crmeb.com',
  21. blankTarget: true
  22. },
  23. {
  24. title: '文档',
  25. key: '文档',
  26. href: 'http://doc.crmeb.com',
  27. blankTarget: true
  28. }
  29. ],
  30. copyright: ''
  31. }
  32. },
  33. mounted () {
  34. this.getCopyright();
  35. },
  36. methods: {
  37. getCopyright () {
  38. copyright().then(res=>{
  39. this.copyright += res.data.copyrightContext?res.data.copyrightContext:'Copyright © 2014-2023 ';
  40. this.getVersion(res);
  41. }).catch(err=>{
  42. this.$Message.error(err.msg)
  43. })
  44. },
  45. getVersion (res) {
  46. this.$store.dispatch('store/db/get', {
  47. dbName: 'sys',
  48. path: 'user.info',
  49. user: true
  50. }).then(data => {
  51. this.copyright += (data.version && !res.data.copyrightContext) ? data.version : '';
  52. })
  53. }
  54. }
  55. }
  56. </script>
  57. <style lang="less">
  58. .i-copyright{
  59. flex: 0 0 auto;
  60. z-index: 1;
  61. }
  62. </style>