Skip to content

Commit

Permalink
perf: 优化存储调用
Browse files Browse the repository at this point in the history
  • Loading branch information
rehiy committed Dec 2, 2023
1 parent 136c067 commit dcadb56
Show file tree
Hide file tree
Showing 14 changed files with 4 additions and 62 deletions.
4 changes: 0 additions & 4 deletions src/app.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<script lang="ts">
import { Component, Vue } from "@/apps/basic"
import layoutStore from "@/store/layout"
@Component
export default class AppRoot extends Vue {
public layout = layoutStore()
public created() {
this.layout.fetchConfig()
}
Expand Down
4 changes: 2 additions & 2 deletions src/apps/basic.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Vue as BaseVue } from "vue-facing-decorator"

import UseCache from '@/store/cache'
import useCache from '@/store/cache'
import layoutStore from "@/store/layout"
import sessionStore from "@/store/session"

export * from "vue-facing-decorator"

export class Vue extends BaseVue {
public cache = UseCache()
public cache = useCache()
public layout = layoutStore()
public session = sessionStore()
}
3 changes: 0 additions & 3 deletions src/apps/certbot/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ import Api, { NaApi } from "@/api"
import { CaTypeList, CertbotOrig } from "@/api/native/certbot"
import { DomainItem } from "@/api/native/domain"
import sessionStore from "@/store/session"
@Component({
emits: ["submit"],
expose: ["open"],
})
export default class CertbotCreate extends Vue {
public session = sessionStore()
public CaTypeList = CaTypeList
// 域名列表
Expand Down
4 changes: 0 additions & 4 deletions src/apps/dashboard/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ import { Component, Vue } from "@/apps/basic"
import { NaApi } from "@/api"
import { UserSummary } from "@/api/native/passport"
import sessionStore from "@/store/session"
import SysLoad from "@/cloud/worker/sys_load.vue"
import SysInfo from "@/cloud/worker/sys_info.vue"
@Component({
components: { SysLoad, SysInfo }
})
export default class DashboardIndex extends Vue {
public session = sessionStore()
// 初始化
public created() {
Expand Down
3 changes: 0 additions & 3 deletions src/apps/domain/list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ import { Component, Vue } from "@/apps/basic"
import { NaApi } from "@/api"
import { DomainModels, DomainItem } from "@/api/native/domain"
import UseCache from '@/store/cache'
@Component
export default class DomainList extends Vue {
public DomainModels = DomainModels
public cache = UseCache()
public loading = true
Expand Down
4 changes: 0 additions & 4 deletions src/apps/home/index.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<script lang="ts">
import { Component, Vue } from "@/apps/basic"
import sessionStore from "@/store/session"
@Component
export default class HomeIndex extends Vue {
public session = sessionStore()
public created() {
if (this.session.Username) {
this.$router.push("/dashboard")
Expand Down
6 changes: 1 addition & 5 deletions src/apps/layout/console.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script lang="ts">
import { Component, Vue } from "@/apps/basic"
import layoutStore from "@/store/layout"
import Header from "./header.vue"
import Content from "./content.vue"
import Footer from "./footer.vue"
Expand All @@ -11,9 +9,7 @@ import Sidebar from "./sidebar.vue"
@Component({
components: { Header, Content, Footer, Sidebar }
})
export default class LayoutConsole extends Vue {
public layout = layoutStore()
}
export default class LayoutConsole extends Vue { }
</script>

<template>
Expand Down
6 changes: 1 addition & 5 deletions src/apps/layout/footer.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<script lang="ts">
import { Component, Vue } from "@/apps/basic"
import layoutStore from "@/store/layout"
@Component
export default class LayoutFooter extends Vue {
public layout = layoutStore()
}
export default class LayoutFooter extends Vue { }
</script>

<template>
Expand Down
7 changes: 0 additions & 7 deletions src/apps/layout/header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@
import { Component, Vue } from "@/apps/basic"
import { NaApi } from "@/api"
import cacheStore from "@/store/cache"
import layoutStore from "@/store/layout"
import sessionStore from "@/store/session"
@Component
export default class LayoutHeader extends Vue {
public cache = cacheStore()
public layout = layoutStore()
public session = sessionStore()
// 侧边栏折叠
public collapseChange() {
this.layout.setCollapse(!this.layout.Collapse)
Expand Down
8 changes: 0 additions & 8 deletions src/apps/layout/sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,8 @@
import { Component, Vue } from "@/apps/basic"
import { onBeforeRouteUpdate, RouteLocationNormalized } from "vue-router"
import layoutStore from "@/store/layout"
import sessionStore from "@/store/session"
@Component
export default class LayoutSidebar extends Vue {
public layout = layoutStore()
public session = sessionStore()
// 菜单列表
public items: MenuItem[] = []
// 初始化
Expand Down
2 changes: 0 additions & 2 deletions src/apps/machine/list.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { NaApi } from "@/api"
import { MachineModels, MachineItem } from "@/api/native/machine"
import { WorkerItem } from "@/api/native/workhub"
import UseCache from '@/store/cache'
import ScriptQuick from "@/apps/script/quick.vue"
import WorkhubWorkerInstall from "@/apps/workhub/worker_install.vue"
Expand All @@ -16,7 +15,6 @@ import MachineUpdate from "./update.vue"
})
export default class MachineList extends Vue {
public MachineModels = MachineModels
public cache = UseCache()
public loading = true
Expand Down
6 changes: 0 additions & 6 deletions src/apps/passport/login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,10 @@ import { FormInstanceFunctions, FormRules, SubmitContext, Data as TData } from "
import Api, { NaApi } from "@/api"
import { UserLogin } from "@/api/native/passport"
import layoutStore from "@/store/layout"
import sessionStore from "@/store/session"
@Component
export default class PassportLogin extends Vue {
public loading = false
public layout = layoutStore()
public session = sessionStore()
// 创建表单
@Ref
Expand Down
3 changes: 0 additions & 3 deletions src/apps/passport/profile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ import { VueCropper } from "vue-cropper"
import Api, { NaApi } from "@/api"
import { UserUpdate } from "@/api/native/passport"
import sessionStore from "@/store/session"
@Component
export default class PassportProfile extends Vue {
public session = sessionStore()
public loading = true
// 初始化
Expand Down
6 changes: 0 additions & 6 deletions src/apps/passport/register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,10 @@ import { FormInstanceFunctions, FormRules, SubmitContext, Data as TData } from "
import Api, { NaApi } from "@/api"
import { UserRegister } from "@/api/native/passport"
import layoutStore from "@/store/layout"
import sessionStore from "@/store/session"
@Component
export default class PassportRegister extends Vue {
public loading = false
public layout = layoutStore()
public session = sessionStore()
// 创建表单
@Ref
Expand Down

0 comments on commit dcadb56

Please sign in to comment.