import { BaseLogic } from "@logic/Base.logic"; import { Autowired } from "@ann/Ioc.annotation"; import { Methods, VueCustomize } from "@logic/Base.type"; import { ToolServiceImpl } from "@impl/Tool.service.impl"; import { UpdateListParams, UpdateListResponseModel } from "@service/type/res/Tool.res"; export class AppVsersionLogic extends BaseLogic implements Methods { @Autowired public toolServiceImpl!: ToolServiceImpl; public params: UpdateListParams = { count: this.count, page: this.page, update_version: '', update_force: '' } public updateList: Array = []; public isShowAddNewUpdate: boolean = false; public updateForce: boolean = false; public addNewsuUpdate: UpdateListResponseModel = { update_version: "", update_version_code: null, update_down_url: "", update_content: "", update_force: 0 } constructor(_: T) { super(); this._ = _; } public async StartUp(): Promise { await this.GetUpdateList(); } // apk上传接口 public async UploadFile(file: File): Promise { var formdata = new FormData(); formdata.append("file", file); let res = await this.toolServiceImpl.UploadFile(formdata); console.log("====== res: ", res) this.addNewsuUpdate.update_down_url = res.img_url; } // 发布新的app版本 public async SetaddNewsuUpdate(): Promise { let res = await this.toolServiceImpl.addNewUpdate(this.addNewsuUpdate); await this.GetUpdateList() this.isShowAddNewUpdate = false; } // 获取app版本列表 public async GetUpdateList(): Promise { let res = await this.toolServiceImpl.UpdateList(this.params); this.updateList = res.result; console.log(res) } public async deleteUpdate(item: UpdateListResponseModel): Promise { console.log(item) await this.toolServiceImpl.deleteUpdate(item); await this.GetUpdateList() } }