im-ui-mobile 0.0.49 → 0.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/im-chat-item/im-chat-item.vue +5 -5
- package/index.js +0 -1
- package/package.json +1 -1
- package/types/index.d.ts +5 -2
- package/utils/auth.js +0 -32
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
|
|
27
27
|
<script setup lang="ts">
|
|
28
28
|
import ImHeadImage from '../im-head-image/im-head-image.vue'
|
|
29
|
-
import datetime from '../../
|
|
30
|
-
import dom from '../../types/utils/dom'
|
|
31
|
-
import messageType from '../../types/utils/messageType'
|
|
32
|
-
import { MESSAGE_TYPE } from '../../types
|
|
33
|
-
import emoji from '../../types/utils/emoji';
|
|
29
|
+
import { datetime, dom, messageType, emoji } from '../../index'
|
|
30
|
+
// import dom from '../../types/utils/dom'
|
|
31
|
+
// import messageType from '../../types/utils/messageType'
|
|
32
|
+
import { MESSAGE_TYPE } from '../../types'
|
|
33
|
+
// import emoji from '../../types/utils/emoji';
|
|
34
34
|
|
|
35
35
|
interface Props {
|
|
36
36
|
chat?: any;
|
package/index.js
CHANGED
|
@@ -43,7 +43,6 @@ const install = (app, options = {}) => {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
import eventBus from "./utils/eventBus.js";
|
|
46
|
-
import * as auth from "./utils/auth.js";
|
|
47
46
|
import datetime from "./utils/datetime.js";
|
|
48
47
|
import { emoji, Emoji } from "./utils/emoji.js";
|
|
49
48
|
import * as dom from "./utils/dom.js";
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -46,7 +46,6 @@ declare module 'im-ui-mobile' {
|
|
|
46
46
|
eventBus,
|
|
47
47
|
datetime,
|
|
48
48
|
Emoji,
|
|
49
|
-
MESSAGE_TYPE, RTC_STATE, TERMINAL_TYPE, MESSAGE_STATUS,
|
|
50
49
|
dom,
|
|
51
50
|
messageType,
|
|
52
51
|
Requester,
|
|
@@ -57,6 +56,8 @@ declare module 'im-ui-mobile' {
|
|
|
57
56
|
// 枚举类型
|
|
58
57
|
RTC_STATE,
|
|
59
58
|
MESSAGE_TYPE,
|
|
59
|
+
TERMINAL_TYPE,
|
|
60
|
+
MESSAGE_STATUS,
|
|
60
61
|
|
|
61
62
|
// 类型常量
|
|
62
63
|
RtcMode,
|
|
@@ -81,4 +82,6 @@ declare module 'im-ui-mobile' {
|
|
|
81
82
|
UserInfo,
|
|
82
83
|
Response
|
|
83
84
|
}
|
|
84
|
-
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export { MESSAGE_TYPE, RTC_STATE, TERMINAL_TYPE, MESSAGE_STATUS }
|
package/utils/auth.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export const setToken = (value) => {
|
|
2
|
-
uni.setStorageSync("accessToken", value);
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
export const getToken = () => {
|
|
6
|
-
return uni.getStorageSync("accessToken") || "";
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const setRefreshToken = (value) => {
|
|
10
|
-
uni.setStorageSync("refreshToken", value);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const getRefreshToken = () => {
|
|
14
|
-
return uni.getStorageSync("refreshToken") || "";
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const clearToken = () => {
|
|
18
|
-
uni.removeStorageSync("accessToken");
|
|
19
|
-
uni.removeStorageSync("refreshToken");
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const setAuth = (data) => {
|
|
23
|
-
setToken(data.accessToken)
|
|
24
|
-
setRefreshToken(data.refreshToken)
|
|
25
|
-
uni.setStorageSync('expired', +new Date() + Number(data.expiresIn) * 60 * 60)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export const isAuthed = () => {
|
|
29
|
-
const expired = uni.getStorageSync('expired')
|
|
30
|
-
const token = getToken()
|
|
31
|
-
return !(!expired || expired < +new Date() || !token)
|
|
32
|
-
}
|