协议调试
This commit is contained in:
@@ -5,9 +5,9 @@ import { BaseData } from "./BaseData";
|
||||
|
||||
export class WalletData extends BaseData {
|
||||
// 余额
|
||||
private _balance = 0;
|
||||
private _balance: number = 0;
|
||||
// vip失效时间戳
|
||||
private _vipExpire = 0;
|
||||
private _vipExpire: number = 0;
|
||||
|
||||
public reset(): void {
|
||||
this._balance = 0;
|
||||
|
||||
@@ -108,6 +108,24 @@ export class MachineInfoService {
|
||||
if (s.length > 64) s = s.slice(0, 64);
|
||||
return s || "Unknown";
|
||||
}
|
||||
|
||||
/** 获取机器系统标识 1: android 2:ios; 3: windows */
|
||||
public getMachineOs(): number {
|
||||
if (EDITOR) {
|
||||
return 3; // 在 Cocos Creator 编辑器里运行
|
||||
}
|
||||
|
||||
if (sys.platform === sys.Platform.ANDROID) {
|
||||
return 1;
|
||||
}
|
||||
if (sys.platform === sys.Platform.IOS) {
|
||||
return 2;
|
||||
}
|
||||
if (sys.platform === sys.Platform.WIN32) {
|
||||
return 3;
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
export default MachineInfoService;
|
||||
|
||||
@@ -25,9 +25,8 @@ export class ApiClient {
|
||||
let jsonData: any;
|
||||
|
||||
if (ep.needsAuth && this.token) {
|
||||
headers["Authorization"] = `Bearer ${this.token}`;
|
||||
headers["Authorization"] = `${this.token}`;
|
||||
}
|
||||
|
||||
// 编码
|
||||
if (ep.codec === "json") {
|
||||
jsonData = (ep.method === "GET") ? req : JsonCodec.encode(req);
|
||||
|
||||
Reference in New Issue
Block a user