Commit a8030a50 authored by chenqikuai's avatar chenqikuai

fix: 修复头像链接传输

parent 461b4034
import Bridge from "@/utils/jsBridge2" import Bridge from '@/utils/jsBridge2'
import { Toast } from 'vant'; import { Toast } from 'vant'
import { enableLive } from '@/service/StaffService/index' import { enableLive } from '@/service/StaffService/index'
export const sendLive = () => { export const sendLive = () => {
...@@ -16,37 +16,63 @@ export const sendLive = () => { ...@@ -16,37 +16,63 @@ export const sendLive = () => {
// allow: true, // allow: true,
// time_section: '30000' // time_section: '30000'
// }) // })
enableLive().then(res => { enableLive()
if (res.code === 200) { .then((res) => {
allow = res.data.allow if (res.code === 200) {
time_section = res.data.time_section allow = res.data.allow
} time_section = res.data.time_section
new Bridge().bridge_live({ }
phone: JSON.parse(window.localStorage.getItem('USER_MSG') as string)?.userInfo.phone, new Bridge().bridge_live({
avatar: window.location.host + require('../assets/icons/avatar.png'), phone: JSON.parse(window.localStorage.getItem('USER_MSG') as string)
allow, ?.userInfo.phone,
time_section avatar:
window.location.protocol +
'//' +
window.location.host +
require('../assets/icons/avatar.png'),
allow,
time_section,
})
console.log(
{
phone: JSON.parse(window.localStorage.getItem('USER_MSG') as string)
?.userInfo.phone,
avatar:
window.location.protocol +
'//' +
window.location.host +
require('../assets/icons/avatar.png'),
allow,
time_section,
},
'show live',
)
}) })
console.log({ .catch(() => {
phone: JSON.parse(window.localStorage.getItem('USER_MSG') as string)?.userInfo.phone, new Bridge().bridge_live({
avatar: window.location.host + require('../assets/icons/avatar.png'), phone: JSON.parse(window.localStorage.getItem('USER_MSG') as string)
allow, ?.userInfo.phone,
time_section avatar:
}, 'show live'); window.location.protocol +
'//' +
}).catch(() => { window.location.host +
new Bridge().bridge_live({ require('../assets/icons/avatar.png'),
phone: JSON.parse(window.localStorage.getItem('USER_MSG') as string)?.userInfo.phone, allow,
avatar: window.location.host + require('../assets/icons/avatar.png'), time_section,
allow, })
time_section console.log(
{
phone: JSON.parse(window.localStorage.getItem('USER_MSG') as string)
?.userInfo.phone,
avatar:
window.location.protocol +
'//' +
window.location.host +
require('../assets/icons/avatar.png'),
allow,
time_section,
},
'show live',
)
}) })
console.log({ }
phone: JSON.parse(window.localStorage.getItem('USER_MSG') as string)?.userInfo.phone,
avatar: window.location.host + require('../assets/icons/avatar.png'),
allow,
time_section
},'show live');
})
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment