Commit eb6ee53b authored by xhx's avatar xhx

fix

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