插件的基本使用
基本的插件
module.exports = {
get isIOS(){
const iosReg = /iphone|ipad|ipod/i;
return iosReg.test(this.get('user-agent'));
}
} async testPul(){
const { ctx } = this;
ctx.body = ctx.isIOS;
}插件自建
module.exports = {
get isIOS(){
const iosReg = /iphone|ipad|ipod/i;
return iosReg.test(this.get('user-agent'));bb
}
}最后更新于