With the rapid growth of data traffic, low earth orbit (LEO) satellite communication networks have gradually ushered in a new trend of development due to its advantages of low latency, wide coverage, and high capacity. However, as a result of the limited on-board resources and rapidly changing traffic demand, it is increasingly urgent to design an efficient resource-allocation scheme to satisfy the traffic demand. In this paper, we propose two resource allocation algorithms in the multi-satellite system based on beam-hopping technology. In the offline case, it is assumed that the channel gains in all time-slots are known in advance, and we propose a heuristic algorithm to allocate time and frequency resources, and a successive convex approximation (SCA) algorithm to allocate power resources. In the online case, it is assumed that only the instant channel gains information is known; therefore, we apply the dynamic programming (DP) algorithm to maximize the system throughput. The simulation results prove that the proposed resource-allocation algorithms based on beam-hopping technology have better performance than the traditional average allocation method, and the online algorithm has acceptable performance loss compared with the offline algorithm.