

const SUCCESS_CODE = '00000'
const TOKEN_ERR_CODE = ''


function apiVerify ({res, success, error, alertServerErrMsg, clearAdminInfo,errorMsg}){
	let {code, data, msg} = res.data
	if(SUCCESS_CODE === code){
		success(data)
		return data
	} else if(TOKEN_ERR_CODE === code){
		
	} else {
		error && error(res.data)
		if (errorMsg) {
			alertServerErrMsg(msg)
		}
	}
}

export {
	SUCCESS_CODE,
	TOKEN_ERR_CODE,
	apiVerify
}