modified
This commit is contained in:
parent
28f854f89c
commit
ff13a53022
@ -16,13 +16,14 @@ export default () => {
|
|||||||
var conversation = currentConversation();
|
var conversation = currentConversation();
|
||||||
fetchData({id:conversation.id, title: conversation.name }, function(data) {
|
fetchData({id:conversation.id, title: conversation.name }, function(data) {
|
||||||
if(data.code==200){
|
if(data.code==200){
|
||||||
if (navigator.userAgent.match(/Android/i)
|
|
||||||
|| navigator.userAgent.match(/webOS/i)
|
if (window.navigator.userAgent.match(/Android/i)
|
||||||
|| navigator.userAgent.match(/iPhone/i)
|
|| window.navigator.userAgent.match(/webOS/i)
|
||||||
|| navigator.userAgent.match(/iPad/i)
|
|| window.navigator.userAgent.match(/iPhone/i)
|
||||||
|| navigator.userAgent.match(/iPod/i)
|
|| window.navigator.userAgent.match(/iPad/i)
|
||||||
|| navigator.userAgent.match(/BlackBerry/i)
|
|| window.navigator.userAgent.match(/iPod/i)
|
||||||
|| navigator.userAgent(/Windows Phone/i)) {
|
|| window.navigator.userAgent.match(/BlackBerry/i)
|
||||||
|
|| window.navigator.userAgent.match(/Windows Phone/i)) {
|
||||||
window.location.href = data.url;
|
window.location.href = data.url;
|
||||||
} else {
|
} else {
|
||||||
window.open(data.url);
|
window.open(data.url);
|
||||||
|
@ -24,13 +24,8 @@ export function baseUrl(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getToken(){
|
export function getToken(){
|
||||||
|
|
||||||
const sessionId = localStorage.getItem('AnsnidSessionId') || generateSessionId();
|
const sessionId = localStorage.getItem('AnsnidSessionId') || generateSessionId();
|
||||||
|
|
||||||
localStorage.setItem('AnsnidSessionId', sessionId)
|
localStorage.setItem('AnsnidSessionId', sessionId)
|
||||||
|
|
||||||
console.log(sessionId)
|
|
||||||
|
|
||||||
return sessionId;
|
return sessionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,6 +50,9 @@ export function fetchData(data: Data | null, callback: (data: ResponseData) => v
|
|||||||
fetch(url, fetchOptions).then(response => response.json().then(data => {
|
fetch(url, fetchOptions).then(response => response.json().then(data => {
|
||||||
callback(data);
|
callback(data);
|
||||||
})).catch(error => {
|
})).catch(error => {
|
||||||
|
|
||||||
|
console.log(error)
|
||||||
|
|
||||||
throw new Error('Request failed', {
|
throw new Error('Request failed', {
|
||||||
cause: error?.error,
|
cause: error?.error,
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user