了解最新公司动态及行业资讯
接口名称:获取站点信息
接口标识:site
接口url:https://你的网站/api.php/index/site
接口参数:无
小程序代码
code腾石建站
swan.request({
url: that.globalData.api + "site",
data: {
aid: that.globalData.aid
},
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded', // 默认值
'x-safecode': that.globalData.safecode
},
success: function (res) {
console.log(res)
let siteinfo = res.data.data;
try {
swan.setStorageSync('siteinfo', siteinfo)
} catch (e) {
}
resolve(siteinfo);
console.log("promise读取siteinfo")
}
})
}
})
该接口直接存入storage缓存了,调用方式为:
code腾石建站
var siteinfo = swan.getStorageSync('siteinfo'); //系统站点配置
调用公司名称:{{siteinfo.title}}
调用版权:{{siteinfo.copyright}}
调用描述:{{siteinfo.description}}
上一篇:公司信息company
下一篇:TAG接口