@94ai/softphone 5.0.13 → 5.0.14

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.
@@ -285,42 +285,34 @@ class SoftphoneManager {
285
285
  sgOpen,
286
286
  sgDomain
287
287
  } = props
288
- if (sgOpen) {
289
- if (isDomainOrIP(sgOpen)) {
290
- return sgOpen
288
+ if (isDomainOrIP(sgOpen)) {
289
+ return sgOpen
290
+ }
291
+ if (sgOpen === '1') {
292
+ if (sgDomain === '1') {
293
+ return 'https://seat.teleai.com/sgopenapi'
291
294
  }
292
- if (sgOpen === '1') {
293
- if (sgDomain === '1') {
294
- return 'https://seat.teleai.com/sgopenapi'
295
- } else {
296
- return 'https://seat.teleai.com/openapi'
297
- }
298
- } else if (sgOpen === '0') {
299
- if (sgDomain === '1') {
300
- return 'https://seat.94ai.com/sgopenapi'
301
- } else {
302
- return 'https://seat.94ai.com/openapi'
303
- }
295
+ return 'https://seat.teleai.com/openapi'
296
+ } else {
297
+ if (sgDomain === '1') {
298
+ return 'https://seat.94ai.com/sgopenapi'
304
299
  }
300
+ return 'https://seat.94ai.com/openapi'
305
301
  }
306
- return 'https://seat.94ai.com/openapi'
307
302
  }
308
303
 
309
304
  getBase() {
310
305
  const {
311
306
  sgBase
312
307
  } = props
313
- if (sgBase) {
314
- if (isDomainOrIP(sgBase)) {
315
- return sgBase
316
- }
317
- if (sgBase === '1') {
318
- return 'https://seat.teleai.com/api'
319
- } else if (sgBase === '0') {
320
- return 'https://seat.94ai.com/api'
321
- }
308
+ if (isDomainOrIP(sgBase)) {
309
+ return sgBase
310
+ }
311
+ if (sgBase === '1') {
312
+ return 'https://seat.teleai.com/api'
313
+ } else if (sgBase === '0') {
314
+ return 'https://seat.94ai.com/api'
322
315
  }
323
- return undefined
324
316
  }
325
317
 
326
318
  getIsOem() {
@@ -1,4 +1,7 @@
1
1
  function isDomainOrIP(str) {
2
+ if (!str) {
3
+ return false
4
+ }
2
5
  const ipPattern = /^(\d{1,3}\.){3}\d{1,3}$/
3
6
  const domainPattern = /^[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z]{2,}$/
4
7
  if (ipPattern.test(str)) {