baseInfo.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. regTypes () {
  29. return this.get('regTypes')
  30. },
  31. adminRoles () {
  32. return this.get('adminRoles')
  33. },
  34. superAdminRoleId () {
  35. return this.get('superAdminRoleId')
  36. },
  37. setDaysDiff (daysDiff) {
  38. let baseInfo = {
  39. daysDiff: daysDiff
  40. }
  41. localStorage.setItem('baseInfo', JSON.stringify(baseInfo))
  42. },
  43. daysDiff () {
  44. return this.get('daysDiff')
  45. },
  46. shopWalletType () {
  47. return this.get('shopWalletType')
  48. },
  49. decRoles () {
  50. return this.get('decRoles')
  51. },
  52. subCompanies () {
  53. return this.get('subCompanies')
  54. },
  55. allStatus () {
  56. return this.get('allStatus')
  57. },
  58. dealTypes () {
  59. return this.get('dealTypes')
  60. },
  61. systems () {
  62. return this.get('systems')
  63. },
  64. allOpenBank () {
  65. return this.get('allOpenBank')
  66. },
  67. allNation () {
  68. return this.get('allNation')
  69. },
  70. nowPeriodNum () {
  71. return this.get('nowPeriodNum')
  72. },
  73. exchangeRate () {
  74. return this.get('exchangeRate')
  75. },
  76. }
  77. export default baseInfo