The Pacific Islanders made the perfect start as Josua Tuisova produced a brilliant solo finish to score a fourth-minute try.
Fiji took advantage of a yellow card for Wales hooker Ken Owens shortly after and Kini Murimurivalu added a second try.
Wales fought its way back to 14-10 at the break with two converted tries from Adams, but it had to come from behind again at 17-14 with Adams’ third try and a Liam Williams score to see off the Fijians.
The win ensured that if Wales beats unfancied Uruguay Sunday in its final group game it will finish top of Pool D.
After its early scare, and with Fijian lock Tevita Cavubati in the sin bin, Wales got on the board through Adams after he gathered an expertly judged cross kick from Dan Biggar on 17 minutes.
In an eventful first half, Fiji was shown another yellow card — the third in 28 minutes — as Semi Kunatani was penalized for repeated infringements and numerous warnings.
Once again, Wales wasted no time making Fiji pay as Adams scored his second try to put his side in front.
Fiji started the second half quickly, and its pressure eventually paid off as Wales’ flanker James Davies was shown the games’ fourth yellow card and Fiji took advantage immediately with a penalty try.
An ugly collision between two Wales players caused Biggar to leave for a head injury assessment before Adams completed his hat-trick with another expertly taken try.
Wales finished strongly, and Williams wrapped up the victory with a bonus point for scoring four tries.