Commit eb6ee53b authored by xhx's avatar xhx

fix

parent 7b11c98a
......@@ -6,3 +6,10 @@ export function getStaffOnDutyStatus() {
method: 'get',
})
}
export function enableLive() {
return baseAxios({
url: '/staff/enable_live',
method: 'get'
})
}
......@@ -19,6 +19,8 @@ baseAxios.interceptors.response.use(
} else if (ret.code === 1000) {
Toast('您好,非常抱歉,该网点暂无营业人员。')
} else if (ret.code !== 200) {
console.log(baseRet.transformResponse)
// if (baseRet.config.url === '/staff/enable_live') return baseRet.data
Toast.fail(ret.msg)
}
return baseRet.data
......
import Bridge from "@/utils/jsBridge2"
import { Toast } from 'vant';
import {enableLive} from '@/service/StaffService/index'
export default [
......@@ -48,10 +49,28 @@ export default [
Toast('请先登录')
return
}
console.log('bridge')
new Bridge().bridge_live({
phone: JSON.parse(window.localStorage.getItem('USER_MSG') as string)?.userInfo.phone,
avatar: window.location.host + require('../../../assets/icons/avatar.png')
let allow = false
let time_section = ''
enableLive().then(res => {
if (res.code === 200) {
allow = res.data.allow
time_section = res.data.time_section
} else {
}
new Bridge().bridge_live({
phone: JSON.parse(window.localStorage.getItem('USER_MSG') as string)?.userInfo.phone,
avatar: window.location.host + require('../../../assets/icons/avatar.png'),
allow,
time_section
})
}).catch(() => {
new Bridge().bridge_live({
phone: JSON.parse(window.localStorage.getItem('USER_MSG') as string)?.userInfo.phone,
avatar: window.location.host + require('../../../assets/icons/avatar.png'),
allow,
time_section
})
})
},
},
......
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