安装一下 ts-md5
npm install ts-md5
引入
import { Md5 } from 'ts-md5'
使用
let result = Md5.hashStr('加密文本')
去看看教程