diff --git a/contact-frontend/packages/modules/logic/src/store/README.md b/contact-frontend/packages/modules/logic/src/store/README.md index be8424fc..02b03c1c 100644 --- a/contact-frontend/packages/modules/logic/src/store/README.md +++ b/contact-frontend/packages/modules/logic/src/store/README.md @@ -8,3 +8,15 @@ * module 为模块,一个模块对应一个 store,一个 store 对应一个模块 * action 为模块的 action,一个 action 对应一个执行命令指令 (通常以 ``do`` 开头) * getter 为模块的 getter,一个 getter 对应一个获取命令指令 (通常以 ``get / is`` 开头) + +参照: + +module 与 action 的关系应该类似于, 模块名 类似于 npm 执行命令,install 行为对应 actions, xxx 为actions的参数 +``` +npm install xxx +``` + +module 与 getters 的关系应该类似于 +``` +npm --version +``` diff --git a/contact-frontend/packages/modules/logic/src/store/modules/apperance.ts b/contact-frontend/packages/modules/logic/src/store/modules/apperance.ts index 93926bc4..7e6ea7e5 100644 --- a/contact-frontend/packages/modules/logic/src/store/modules/apperance.ts +++ b/contact-frontend/packages/modules/logic/src/store/modules/apperance.ts @@ -2,7 +2,7 @@ import { defineStore } from 'pinia' import { Apperance } from '@cskefu/models' import { useStorage } from '@vueuse/core' -export const useApperance = defineStore('alerts', { +export const useApperance = defineStore('apperance', { state: () => ({ apperance: useStorage('apperance', { lang: 'zh-CN', diff --git a/contact-frontend/packages/modules/logic/src/store/modules/auth.ts b/contact-frontend/packages/modules/logic/src/store/modules/auth.ts index e69de29b..9817b464 100644 --- a/contact-frontend/packages/modules/logic/src/store/modules/auth.ts +++ b/contact-frontend/packages/modules/logic/src/store/modules/auth.ts @@ -0,0 +1,12 @@ +import { defineStore } from 'pinia' + +export const useApperance = defineStore('auth', { + state: () => ({ + currentUser: {}, + }), + actions: { + doLogin() {}, + doLogout() {}, + doSocialLogin() {}, + }, +}) diff --git a/contact-frontend/packages/modules/logic/src/store/modules/navigate.ts b/contact-frontend/packages/modules/logic/src/store/modules/navigate.ts index e69de29b..398632b1 100644 --- a/contact-frontend/packages/modules/logic/src/store/modules/navigate.ts +++ b/contact-frontend/packages/modules/logic/src/store/modules/navigate.ts @@ -0,0 +1,18 @@ +import { defineStore } from 'pinia' + +export const useApperance = defineStore('auth', { + state: () => ({ + currentPathName: '', + }), + actions: { + doWindowOpen(url: string, target?: string, features?: string) { + window.open(url, target, features) + }, + doRouteToByServiceName(serviceName: string) { + console.log(serviceName) + }, + doRouteToByPathName(path: string) { + this.currentPathName = path + }, + }, +}) diff --git a/contact-frontend/packages/modules/models/src/rest-api/.gitkeep b/contact-frontend/packages/modules/models/src/rest-api/.gitkeep new file mode 100644 index 00000000..e69de29b