1.安装模块
npm install gravatar --save
2.使用
根目录/routes/api/users.js
const gravatar = require('gravatar'); ... const avatar = gravatar.url(ctx.request.body.email, { s: '200', r: 'pg', d: 'mm' });
3.登录官网上传头像
https://en.gravatar.com/
4.效果图
.
1.安装模块
npm install gravatar --save
2.使用
根目录/routes/api/users.js
const gravatar = require('gravatar'); ... const avatar = gravatar.url(ctx.request.body.email, { s: '200', r: 'pg', d: 'mm' });
3.登录官网上传头像
https://en.gravatar.com/
4.效果图
.