feat: prepare Zhinian desktop client for pilot release
This commit is contained in:
@@ -42,11 +42,39 @@ const mockElectron = {
|
||||
isDev: true,
|
||||
};
|
||||
|
||||
const mockYinian = {
|
||||
auth: {
|
||||
createImageCaptcha: vi.fn(),
|
||||
restoreSession: vi.fn(),
|
||||
getSessionState: vi.fn(),
|
||||
loginWithSms: vi.fn(),
|
||||
loginWithPassword: vi.fn(),
|
||||
logout: vi.fn(),
|
||||
getSavedCredentials: vi.fn(),
|
||||
saveCredentials: vi.fn(),
|
||||
clearSavedCredentials: vi.fn(),
|
||||
},
|
||||
app: {
|
||||
getServerStatus: vi.fn(),
|
||||
getConfig: vi.fn(),
|
||||
switchHotel: vi.fn(),
|
||||
},
|
||||
skills: {
|
||||
sync: vi.fn(),
|
||||
listLocal: vi.fn(),
|
||||
getRegistry: vi.fn(),
|
||||
},
|
||||
};
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
Object.defineProperty(window, 'electron', {
|
||||
value: mockElectron,
|
||||
writable: true,
|
||||
});
|
||||
Object.defineProperty(window, 'yinian', {
|
||||
value: mockYinian,
|
||||
writable: true,
|
||||
});
|
||||
}
|
||||
|
||||
// Mock matchMedia
|
||||
|
||||
Reference in New Issue
Block a user