baseInfo.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. const baseInfo = {
  2. set (info) {
  3. localStorage.setItem('baseInfo', JSON.stringify(info))
  4. },
  5. get (...arg) {
  6. let baseInfo = JSON.parse(localStorage.getItem('baseInfo'))
  7. if (baseInfo === null) {
  8. return null
  9. }
  10. if (arg.length === 0 || arg[0] === '') {
  11. return baseInfo
  12. } else {
  13. return baseInfo[arg[0]]
  14. }
  15. },
  16. clear () {
  17. localStorage.removeItem('baseInfo')
  18. },
  19. menu () {
  20. return this.get('menu')
  21. },
  22. decLevels () {
  23. return this.get('decLevels')
  24. },
  25. empLevels () {
  26. return this.get('empLevels')
  27. },
  28. crownLevels () {
  29. return this.get('crownLevels')
  30. },
  31. regTypes () {
  32. return this.get('regTypes')
  33. },
  34. adminRoles () {
  35. return this.get('adminRoles')
  36. },
  37. superAdminRoleId () {
  38. return this.get('superAdminRoleId')
  39. },
  40. setDaysDiff (daysDiff) {
  41. let baseInfo = {
  42. daysDiff: daysDiff
  43. }
  44. localStorage.setItem('baseInfo', JSON.stringify(baseInfo))
  45. },
  46. daysDiff () {
  47. return this.get('daysDiff')
  48. },
  49. shopWalletType () {
  50. return this.get('shopWalletType')
  51. },
  52. decRoles () {
  53. return this.get('decRoles')
  54. },
  55. subCompanies () {
  56. return this.get('subCompanies')
  57. },
  58. allStatus () {
  59. return this.get('allStatus')
  60. },
  61. dealTypes () {
  62. return this.get('dealTypes')
  63. },
  64. systems () {
  65. return this.get('systems')
  66. },
  67. allOpenBank () {
  68. return this.get('allOpenBank')
  69. },
  70. allNation () {
  71. return this.get('allNation')
  72. },
  73. nowPeriodNum () {
  74. return this.get('nowPeriodNum')
  75. },
  76. exchangeRate () {
  77. return this.get('exchangeRate')
  78. },
  79. }
  80. export default baseInfo