@phonghq/go-chat 1.0.38 → 1.0.40
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/dist/go-chat.es.js +6047 -6034
- package/dist/go-chat.umd.js +14 -14
- package/dist/test/utils/chat/auth.js +0 -1
- package/dist/test/utils/chat/call.js +18 -12
- package/package.json +1 -1
|
@@ -41,7 +41,6 @@ export const getProfile = async () => {
|
|
|
41
41
|
export const checkTenantPhone = async () => {
|
|
42
42
|
const id = localStorage.getItem('chat_id');
|
|
43
43
|
const res = await axios.get(`/api/v1/message/tenant/get-info?tenant_name=${id}`);
|
|
44
|
-
console.log(res, '5555555555555555');
|
|
45
44
|
if (res.error || !res?.data)
|
|
46
45
|
throw new Error(res.error);
|
|
47
46
|
if (dataProfile.value)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import axios from '../../plugins/axios';
|
|
2
2
|
import { dataProfile } from '../../utils/chat/auth';
|
|
3
|
+
import { useError } from '../../composable/useError';
|
|
4
|
+
const { showError } = useError();
|
|
3
5
|
const BARE_WEBSOCKET_URL = 'https://web-socket.dev01.dtsmart.dev';
|
|
4
6
|
// const BARE_WEBSOCKET_URL = 'https://web-socket-test.dev01.dtsmart.dev'
|
|
5
7
|
// const BARE_WEBSOCKET_URL = 'http://192.168.1.173:3000'
|
|
@@ -138,18 +140,22 @@ export const getPlivoAccessToken = async () => {
|
|
|
138
140
|
return result?.accessToken;
|
|
139
141
|
};
|
|
140
142
|
export const createSipAccount = async (data) => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
143
|
+
try {
|
|
144
|
+
const url = BARE_WEBSOCKET_URL + '/ws/create-sip-account';
|
|
145
|
+
const response = await fetch(url, {
|
|
146
|
+
method: 'POST',
|
|
147
|
+
body: JSON.stringify(data),
|
|
148
|
+
headers: {
|
|
149
|
+
['Content-Type']: 'application/json'
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
if (!response.ok) {
|
|
153
|
+
throw new Error(`Response status: ${response.status}`);
|
|
147
154
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
155
|
+
const result = await response.json();
|
|
156
|
+
return result;
|
|
157
|
+
}
|
|
158
|
+
catch (e) {
|
|
159
|
+
showError('We’re having trouble connecting the call. Please try again in a moment');
|
|
151
160
|
}
|
|
152
|
-
const result = await response.json();
|
|
153
|
-
console.log(result);
|
|
154
|
-
return result;
|
|
155
161
|
};
|