Bound state in the continuum (BIC) can realize a significant near-field enhancement. By breaking the in-plane symmetry, a terahertz metasurface exciting a quasi-BIC based on the electric dipole resonance is proposed in this paper. The metasurface can achieve high-performance refractive index sensing. In addition, through the sweep of the specific geometric parameter, the recognition of the terahertz molecular fingerprint is realized. This dual-function metasurface can promote the development of terahertz sensing.