Authored by 李奇

fixed:不支持浏览器渲染页添加

... ... @@ -14,6 +14,9 @@ const clientService = require('../models/client-service');
* 在线客服客户端
*/
const index = (req, res) => {
let reg = /MSIE\s?[987]\.0/i;
let userAgent = req.headers['user-agent'];
let unSupport = reg.test(userAgent);
let type = 2;
let imgSize = '86x120';
let encryptedUid = aes.encryptionUid(req.user.uid);
... ... @@ -22,10 +25,16 @@ const index = (req, res) => {
layout: false
};
clientService.getClientData(type, encryptedUid, imgSize)
.then(result => {
res.render('client', Object.assign(data, result));
if(unSupport) {
res.render('unsupport', {
layout: false
});
} else {
clientService.getClientData(type, encryptedUid, imgSize)
.then(result => {
res.render('client', Object.assign(data, result));
});
}
};
/**
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>{{title}}</title>
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="cleartype" content="on">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta content="telephone=no" name="format-detection" />
<meta content="email=no" name="format-detection" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="renderer" content="webkit" />
<style>
.un-support {
text-align: center;
}
</style>
</head>
<body>
<div class="un-support">
<div class="tip">为了保证您使用客服系统的体验,建议您使用谷歌Chrome、IE11等浏览器访问本页面。</div>
<div class="tip">如果您的浏览器支持极速模式,请尝试开启。</div>
</div>
</body>
</html>
... ...
<div class="un-support">
<div class="back"></div>
<div class="tip">为了保证您使用客服系统的体验,建议您使用其他浏览器(谷歌chrome、IE10以上、火狐等)访问本客服页面。</div>
<div class="tip">为了保证您使用客服系统的体验,建议您使用谷歌Chrome、IE11等浏览器访问本页面。</div>
<div class="tip">如果您的浏览器支持极速模式,请尝试开启。</div>
</div>
... ...