@Component public class UserAgentDirective extends AbstractTemplateDirective
参数列表
userAgent
:user agent,为空时取当前请求的user agent
返回结果
object.id
:id
object.ip
:客户端ip
object.browser
:浏览器
object.browserGroup
:浏览器分组
object.browserType
:浏览器类型
object.browserVersion
:浏览器版本
object.operatingSystem
:操作系统
object.operatingSystemGroup
:操作系统分组
object.deviceType
:设备类型
object.userAgent
:user agent
<@tools.userAgent>${a.deviceType}</@tools.userAgent>
<script> $.getJSON('${site.dynamicPath}api/directive/tools/userAgent', function(data){ console.log(data.deviceType); }); </script>
ADVANCED, AUTH_TOKEN, AUTH_USER_ID, siteComponent
log
构造器和说明 |
---|
UserAgentDirective() |
限定符和类型 | 方法和说明 |
---|---|
void |
execute(RenderHandler handler) |
execute, expose, getAdvanced, getApp, getSite, getUserId, needAppToken, needUserToken, supportAdvanced
execute, getName, getNamespace, getShortName, httpEnabled, setName, setNamespace, setShortName
public void execute(RenderHandler handler) throws java.io.IOException, freemarker.template.TemplateException
java.io.IOException
freemarker.template.TemplateException