You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

126 lines
2.3 KiB

9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
9 months ago
8 months ago
9 months ago
9 months ago
  1. import { reactive, ref } from 'vue'
  2. import { defineStore } from 'pinia'
  3. export const mainWrapperStore = defineStore("mainWrapper", () => {
  4. })
  5. export const homePageStore = defineStore("homePage", () => {
  6. const idShow = reactive({
  7. show_menu: false,
  8. show_carousel: true,
  9. show_author: true,
  10. show_anchornDown: true
  11. })
  12. return {idShow}
  13. })
  14. export const blogStore = defineStore("blog", () => {
  15. const delControl = reactive({
  16. open: false,
  17. ids: ""
  18. })
  19. return { delControl }
  20. })
  21. export const diaryStore = defineStore("diary", () => {
  22. const delControl = reactive({
  23. open: false,
  24. ids: ""
  25. })
  26. return { delControl }
  27. })
  28. export const classticStore = defineStore("classtic", () => {
  29. const addControl = reactive({
  30. open: false,
  31. title: "",
  32. mode: "",
  33. ids: ""
  34. })
  35. const delControl = reactive({
  36. open: false,
  37. ids: ""
  38. })
  39. const editControl = reactive({
  40. open: false,
  41. ids: "",
  42. title: ""
  43. })
  44. return { addControl, delControl, editControl }
  45. })
  46. export const comLinkStore = defineStore("comLink", () => {
  47. const addControl = reactive({
  48. open: false,
  49. title: "",
  50. mode: "",
  51. ids: ""
  52. })
  53. const delControl = reactive({
  54. open: false,
  55. ids: ""
  56. })
  57. const editControl = reactive({
  58. open: false,
  59. ids: "",
  60. title: ""
  61. })
  62. return { addControl, delControl, editControl }
  63. })
  64. export const typeStore = defineStore("type", () => {
  65. const addControl = reactive({
  66. open: false,
  67. title: "",
  68. ids: ""
  69. })
  70. const delControl = reactive({
  71. open: false,
  72. ids: ""
  73. })
  74. const editControl = reactive({
  75. open: false,
  76. ids: "",
  77. title: ""
  78. })
  79. return { addControl, delControl, editControl }
  80. })
  81. export const labelStore = defineStore("label", () => {
  82. const addControl = reactive({
  83. open: false,
  84. title: "",
  85. ids: ""
  86. })
  87. const delControl = reactive({
  88. open: false,
  89. ids: ""
  90. })
  91. const editControl = reactive({
  92. open: false,
  93. ids: "",
  94. title: ""
  95. })
  96. return { addControl, delControl, editControl }
  97. })
  98. export const useAuthStore = defineStore("auth", () => {
  99. const tokenValue = ref("")
  100. function setToken(token: string) {
  101. tokenValue.value = token
  102. }
  103. function removeToken() {
  104. localStorage.removeItem('token');
  105. }
  106. return { setToken, removeToken }
  107. })