first commit

This commit is contained in:
ytc1012
2025-11-18 18:38:53 +08:00
commit bea9db4488
1582 changed files with 335346 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import { _decorator } from 'cc';
import { HttpInvoke,HttpInvokeType } from "./HttpInvoke";
export class HttpManager {
private static _instance: HttpManager = null;
public static getInstance(): HttpManager {
if (this._instance == null) {
this._instance = new HttpManager();
}
return this._instance;
}
protected _url:string = "";
public setWebUrl(url:string):void{
if(this._url == "" || this._url != url){
this._url = url;
}
}
public doGet(name:string,apiUrl:string,params:any,otherData:any = null):void{
var invoke = new HttpInvoke();
invoke.init(name,otherData);
invoke.doSend(this._url + apiUrl,params,HttpInvokeType.GET);
}
public doPost(name:string,apiUrl:string,params:any,otherData:any = null):void{
var invoke = new HttpInvoke();
invoke.init(name,otherData);
invoke.doSend(this._url + apiUrl,params,HttpInvokeType.POST);
}
}