We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1、 代码未改动时,提示 appID 不能为空, 看代码是在 setting.html 中没有传入 appId,
removeWebDB1Data(){ popup.confirm({title:'确定清空1日之前所有数据吗?',yes:()=>{ util.ajax({ url:`${config.baseApi}api/v1/remove/deleteDb1WebData`, data: { type: 'wx', appId: this.appId }, success:data=>{ popup.alert({title:'操作成功!'}) } }) }}) }, removeWebDB2Data(number){ popup.confirm({ title: `确定清空${number}日之前所有数据吗?`, yes: () => { util.ajax({ url: `${config.baseApi}api/v1/remove/deleteDb2WebData`, data:{ number: number, type: 'wx', appId: this.appId }, success: data => { popup.alert({ title: '操作成功!' }) } }) } }) },
上面是贴了改后的,看了网页项目的代码改的
2、 这样改了又是报错,报remove 为 undefind 。看了代码后,原因是分项目分表后,表名是要appId的,这里明显没有传,但是直接(appId)是不可以了,因为model不存在,所以改后代码如下:
async deleteDb2WebData(appId, number, type = 'web') { number = number * 1; const interval = parser.parseExpression(this.app.config.pvuvip_task_day_time); const endTime = new Date(new Date(interval.prev().toString()).getTime() - number * 86400000); const query = { create_time: { $lt: endTime } }; let result = null; if (type === 'web') { // Ajax const remove1 = Promise.resolve(this.app.models.WebAjaxs(appId).remove(query).exec()); // Pages const remove2 = Promise.resolve(this.app.models.WebPages(appId).remove(query).exec()); // Environment const remove3 = Promise.resolve(this.app.models.WebEnvironment(appId).remove(query).exec()); // Errors const remove4 = Promise.resolve(this.app.models.WebErrors(appId).remove(query).exec()); // Resource const remove5 = Promise.resolve(this.app.models.WebResource(appId).remove(query).exec()); result = await Promise.all([ remove1, remove2, remove3, remove4, remove5 ]); } else if (type === 'wx') { // Ajax const remove1 = Promise.resolve(this.app.models.WxAjaxs(appId).remove(query).exec()); // Pages const remove2 = Promise.resolve(this.app.models.WxPages(appId).remove(query).exec()); // Errors const remove3 = Promise.resolve(this.app.models.WxErrors(appId).remove(query).exec()); result = await Promise.all([ remove1, remove2, remove3 ]); } return result; }
上面代码的路径是 service/remove.js
已上改完就可以了,没有提pull request,看作者也不怎么更新,但是人加能开源就不错了,自己能动手的就不要键盘侠
good night!
The text was updated successfully, but these errors were encountered:
这边我会抽时间看看,修复完成会回复你
Sorry, something went wrong.
No branches or pull requests
1、 代码未改动时,提示 appID 不能为空,
看代码是在 setting.html 中没有传入 appId,
上面是贴了改后的,看了网页项目的代码改的
2、 这样改了又是报错,报remove 为 undefind 。看了代码后,原因是分项目分表后,表名是要appId的,这里明显没有传,但是直接(appId)是不可以了,因为model不存在,所以改后代码如下:
上面代码的路径是 service/remove.js
已上改完就可以了,没有提pull request,看作者也不怎么更新,但是人加能开源就不错了,自己能动手的就不要键盘侠
good night!
The text was updated successfully, but these errors were encountered: