diff --git a/src/config/index.js b/src/config/index.ts similarity index 100% rename from src/config/index.js rename to src/config/index.ts diff --git a/src/store/pinia.js b/src/store/pinia.ts similarity index 93% rename from src/store/pinia.js rename to src/store/pinia.ts index 824bce7..73774c8 100644 --- a/src/store/pinia.js +++ b/src/store/pinia.ts @@ -56,11 +56,11 @@ export const useBaseStore = defineStore('base', { getters: {}, actions: { async init() { - let r = await panel() + const r = await panel() if (r.success) { this.userinfo = r.data } - let r2 = await friends() + const r2 = await friends() if (r2.success) { this.users = r2.data } @@ -80,7 +80,7 @@ export const useBaseStore = defineStore('base', { this.excludeRoutes.push(val.value) } } else { - let resIndex = this.excludeRoutes.findIndex((v) => v === val.value) + const resIndex = this.excludeRoutes.findIndex((v) => v === val.value) if (resIndex !== -1) { this.excludeRoutes.splice(resIndex, 1) } diff --git a/src/utils/bus.js b/src/utils/bus.ts similarity index 88% rename from src/utils/bus.js rename to src/utils/bus.ts index 0a2d156..30bd63c 100644 --- a/src/utils/bus.js +++ b/src/utils/bus.ts @@ -16,11 +16,11 @@ export default { this.eventMap.set(eventType, [cb]) }, off(eventType, fn) { - let cbs = this.eventMap.has(eventType) + const cbs = this.eventMap.has(eventType) if (cbs) { if (fn) { - let cbs = this.eventMap.get(eventType) - let rIndex = cbs.findIndex((v) => v === fn) + const cbs = this.eventMap.get(eventType) + const rIndex = cbs.findIndex((v) => v === fn) if (rIndex > -1) { cbs.splice(rIndex, 1) } @@ -34,7 +34,7 @@ export default { this.eventMap = new Map() }, emit(eventType, val) { - let cbs = this.eventMap.get(eventType) + const cbs = this.eventMap.get(eventType) if (cbs) { cbs.map((cb) => cb(val)) } diff --git a/src/utils/const_var.js b/src/utils/const_var.ts similarity index 100% rename from src/utils/const_var.js rename to src/utils/const_var.ts diff --git a/src/utils/enums.js b/src/utils/enums.ts similarity index 100% rename from src/utils/enums.js rename to src/utils/enums.ts diff --git a/src/utils/hooks/useNav.js b/src/utils/hooks/useNav.ts similarity index 100% rename from src/utils/hooks/useNav.js rename to src/utils/hooks/useNav.ts