Initial commit
Made-with: Cursor
This commit is contained in:
32
srde/miniprogram/app.ts
Normal file
32
srde/miniprogram/app.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
// SRDE Risk Control Mini Program
|
||||
interface IAccountState {
|
||||
total_capital: number;
|
||||
current_capital: number;
|
||||
current_drawdown: number;
|
||||
max_drawdown: number;
|
||||
consecutive_losses: number;
|
||||
trading_locked_until: string | null;
|
||||
status: 'tradable' | 'compressed' | 'locked';
|
||||
}
|
||||
|
||||
interface IAppOption {
|
||||
globalData: {
|
||||
token: string | null;
|
||||
account: IAccountState | null;
|
||||
accountLoadedAt: number;
|
||||
};
|
||||
}
|
||||
|
||||
App<IAppOption>({
|
||||
globalData: {
|
||||
token: wx.getStorageSync('srde_token') || null,
|
||||
account: null,
|
||||
accountLoadedAt: 0,
|
||||
},
|
||||
onLaunch() {
|
||||
const token = wx.getStorageSync('srde_token');
|
||||
if (token) {
|
||||
this.globalData.token = token;
|
||||
}
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user