import { onLoad } from '@dcloudio/uni-app';

/** 页面生命周期 - onLoad */
export const useOnLoad = (callback: Function) => {
	const app = getApp();
	onLoad((options) => {
		if (app.globalData.logSuccess) {
			callback(options);
		} else {
			app.loginReadyCallBack = () => {
				callback(options);
			};
		}
	});
};
