修复客服嵌入问题并更新前端构建产物
- 管理端前端设备判定改为按宽高比(嵌入竖屏容器时正确使用手机版布局) - 统计上报跨源读取 parent.location 报错防护(降级用 referrer) - 续接会话时校验客服在线,离线不再误入聊天页 - 聊天记录整理与消息发送的用户资料缺失空值防护,避免接口 400 - entrypoint 数据库导入加空库守卫,容器重启/线上更新不再重置数据
This commit is contained in:
+6
-6
@@ -23,15 +23,15 @@
|
||||
this.handleMatchMedia()
|
||||
},
|
||||
handleMatchMedia () {
|
||||
const matchMedia = window.matchMedia
|
||||
// 竖屏(宽高比 < 1)走手机版布局,横屏走 PC 布局。
|
||||
// 嵌入竖屏 iframe(如游戏内客服)时由宿主容器形状决定,不受绝对宽度阈值影响
|
||||
const w = document.documentElement.clientWidth || window.innerWidth
|
||||
const h = document.documentElement.clientHeight || window.innerHeight
|
||||
|
||||
if (matchMedia('(max-width: 600px)').matches) {
|
||||
var deviceWidth = document.documentElement.clientWidth || window.innerWidth;
|
||||
let css = 'calc(100vw/7.5)'
|
||||
if (h > 0 && w / h < 1) {
|
||||
const css = 'calc(100vw/7.5)'
|
||||
document.documentElement.style.fontSize = css;
|
||||
this.setDevice('Mobile')
|
||||
} else if (matchMedia('(max-width: 992px)').matches) {
|
||||
this.setDevice('Tablet')
|
||||
} else {
|
||||
this.setDevice('Desktop')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user