message:Error: app.json: app.json
Expecting 'EOF','}',',',']', got INVALID
34 | },
35 | "sitemapLocation": "sitemap.json"
> 36 | }
| ^
37 | methods:{
38 | onLoad: function() {
39 | wx.showShareMenu({
appid: wx80e98dce9175773d
openid: o6zAJsyrqDqDDROniZ1pww_ZHZ7M
ideVersion: 1.06.2210310
osType: win32-x64
time: 2023-01-01 20:55:03
37行开始的代码删除掉
截图看看app.json的36行下面源码是什么,按道理不应该出现37行的代码。
onLoad: function() {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
if (wx.createInterstitialAd) {
interstitialAd = wx.createInterstitialAd({
adUnitId: ' '
})
interstitialAd.onLoad(() => {})
interstitialAd.onError((err) => {})
interstitialAd.onClose(() => {})
}
},
onShow: function() {
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
if (!app.checkIsLogin()) {
this.setData({
hasUserInfo: false,
})
}
if (app.globalData.hasUserInfo) {
this.setData({
userInfo: app.globalData.userInfo,
hasUserInfo: app.globalData.hasUserInfo,
})
}
this.getDailyFreeParseNum(),
this.getTotalParseNum();
if (interstitialAd) {
interstitialAd.show().catch((err) => {
console.error(err)
})
}
},
getUserInfo(e) {
if (e.detail.errMsg !== 'getUserInfo:ok') {
wx.showToast({
title: '未授权,登录失败',
icon: 'none'
})
return false;
}
wx.showLoading({
title: "正在登录",
mask: true
});
app.getUserInfo(res => {
this.setData({
userInfo: app.globalData.userInfo,
hasUserInfo: app.globalData.hasUserInfo,
})
wx.hideLoading();
})
},
getDailyFreeParseNum() {
var num;
var today = util.formatDate(new Date(), '');
var lastParseDate = wx.getStorageSync('lastParseDate');
if (lastParseDate != today) {
wx.setStorageSync('lastParseDate', today);
wx.setStorageSync('dailyFreeParseNum', app.globalData.defaultDailyFreeParseNum);
num = app.globalData.defaultDailyFreeParseNum;
} else {
num = wx.getStorageSync('dailyFreeParseNum');
}
this.setData({
dailyFreeParseNum: num
})
}
}