; layui.use('jquery', function() { $ = layui.jquery; $(function() { layui.data('auth', null); console.log('wo',location.searchObj().menuId) if(location.searchObj().menuId){ console.log(2) $.ajax({ url: 'getMenuBtn', type: 'get', data: { menuId: location.searchObj().menuId || '0' }, success: function(res) { if (res.code == 0) { let auth = res.data[0]; layui.data('auth', { key: 'data', value: auth }) console.log('ee', layui.data('auth').data); } } }); } }); });