export const  TOKEN_KEYAuto = 'AppTokenmini_AutoCourse'; // 金康健自动发课token 信息

/**
 * 随机字符串
 * 
 */
export function generateRandomString(length) {
	let result = '';
	const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
	const charactersLength = characters.length;

	for (let i = 0; i < length; i++) {
		result += characters.charAt(Math.floor(Math.random() * charactersLength));
	}
	return result;
}

export function isLoginCourseAuto() {
	return new Promise((resolve, reject) => {
		let token = uni.getStorageSync(TOKEN_KEYAuto);
		if (token==null||token==undefined||token=="" ) {
			resolve(false);
		} else {
			resolve(true);
		}
	}); 
}