In this article, a distributed adaptive continuous-time optimization algorithm based on the Laplacian-gradient method and adaptive control is designed for resource allocation problem with the resource constraint and the local convex set constraints. In order to deal with local convex sets, a distance-based exact penalty function method is adopted to reformulate the resource allocation problem instead of the widely used projection operator method. By using the nonsmooth analysis and set-valued LaSalle invariance principle, it is proven that the proposed algorithm is capable of solving the nonsmooth resource allocation problem. Finally, two simulation examples are presented to substantiate the theoretical results.