diff --git a/package.json b/package.json index e728e7a0..8fc7e4d8 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "fast-xml-parser": "^4.3.2", "highlight.js": "^11.9.0", "jsencrypt": "^3.3.2", + "localforage": "^1.10.0", "lodash-es": "^4.17.21", "markdown-it": "^14.1.0", "markmap-common": "^0.16.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bb8c2294..79dc3634 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -89,6 +89,9 @@ importers: jsencrypt: specifier: ^3.3.2 version: 3.3.2 + localforage: + specifier: ^1.10.0 + version: 1.10.0 lodash-es: specifier: ^4.17.21 version: 4.17.21 @@ -3748,6 +3751,9 @@ packages: engines: {node: '>=0.10.0'} hasBin: true + immediate@3.0.6: + resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==} + immer@9.0.21: resolution: {integrity: sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==} @@ -4138,6 +4144,9 @@ packages: lezer-feel@1.4.0: resolution: {integrity: sha512-kNxG7O38gwpuYy+C3JCRxQNTCE2qu9uTuH5dE3EGVnRhIQMe6rPDz0S8t3urLEOsMud6HI795m6zX2ujfUaqTw==} + lie@3.1.1: + resolution: {integrity: sha512-RiNhHysUjhrDQntfYSfY4MU24coXXdEOgw9WGcKHNeEwffDYbF//u87M1EWaMGzuFoSbqW0C9C6lEEhDOAswfw==} + lilconfig@3.1.2: resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} engines: {node: '>=14'} @@ -4169,6 +4178,9 @@ packages: resolution: {integrity: sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==} engines: {node: '>=14'} + localforage@1.10.0: + resolution: {integrity: sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==} + locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -9929,6 +9941,8 @@ snapshots: image-size@0.5.5: {} + immediate@3.0.6: {} + immer@9.0.21: {} immutable@5.0.3: {} @@ -10269,6 +10283,10 @@ snapshots: '@lezer/lr': 1.4.2 min-dash: 4.2.2 + lie@3.1.1: + dependencies: + immediate: 3.0.6 + lilconfig@3.1.2: {} lines-and-columns@1.2.4: {} @@ -10314,6 +10332,10 @@ snapshots: mlly: 1.7.3 pkg-types: 1.2.1 + localforage@1.10.0: + dependencies: + lie: 3.1.1 + locate-path@5.0.0: dependencies: p-locate: 4.1.0 diff --git a/src/api/chat/chat.ts b/src/api/chat/chat.ts new file mode 100644 index 00000000..9d462e76 --- /dev/null +++ b/src/api/chat/chat.ts @@ -0,0 +1,50 @@ +import request from '@/config/axios' + +// 查询用户详情 +export const self = async (params: any) => { + return await request.get({ + url: '/user/self', + params + }) +} + +// 判断用户哪个终端在线 +export const terminalOnline = async (params: any) => { + return await request.get({ + url: '/user/terminal/online', + params + }) +} + +// 朋友列表 +export const friendList = async (params: any) => { + return await request.get({ + url: '/friend/list', + params + }) +} + +// 群列表 +export const groupList = async (params: any) => { + return await request.get({ + url: '/group/list', + params + }) +} + + +// 开启/关闭免打扰状态 +export const friendDnd = async (data: any) => { + return await request.put({ + url: '/friend/dnd', + data + }) +} + +// 开启/关闭群免打扰状态 +export const groupDnd = async (data: any) => { + return await request.put({ + url: '/group/dnd', + data + }) +} diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue index 2aad8661..dea2f98c 100644 --- a/src/components/Pagination/index.vue +++ b/src/components/Pagination/index.vue @@ -1,6 +1,7 @@