接口标识:site
接口url:https://你的网站/api.php/index/site
接口参数:无
小程序代码
该接口直接存入storage缓存了,调用方式为:
- 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")
- }
- })
- }
- })
调用公司名称:{{siteinfo.title}}
- var siteinfo = swan.getStorageSync('siteinfo'); //系统站点配置
调用版权:{{siteinfo.copyright}}
调用描述:{{siteinfo.description}}