Files
TsxVueClassApi/src/application/logic/page/home.logic.ts
2025-12-08 13:54:20 +08:00

53 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* Copyright (c) 2020. bmy
* Email2271608011@qq.com
* Githubhttps://github.com/helpcode
*/
import { Autowired } from "@ann/ioc.annotation";
import { UserService, ResponseType } from "@service/user.service";
import { BaseLogic } from "@logic/base.logic";
import { Methods, VueCustomize } from "@logic/base.type";
export class HomeLogic<T extends VueCustomize> extends BaseLogic<T> implements Methods {
@Autowired()
public readonly UserService!: UserService;
public title: string = "12222";
public List: ResponseType[] = [
{ user_id: 1, user_name: '测试1' },
{ user_id: 2, user_name: '测试2' },
];
constructor() {
super();
}
/**
* 页面初始化调用的方法
*/
public async StartUp(): Promise<void> {
// 在StartUp方法中访问$route和$router
console.log("StartUp - this: ", this);
console.log("StartUp - this.$route: ", this.$route);
console.log("StartUp - this.$router: ", this.$router);
await this.getData();
}
/**
* 请求首页数据
*/
public async getData(): Promise<void> {
// this.List = await this.UserService.UserList({ type: 1, page: 1 });
// console.log("this.List: ", this.List);
// let res = await this.UserService.login({ type: 2, page: 2 });
// console.log("this.res: ", res);
//
// await this._.$router.push('/About')
}
}