feat(admin,front): 新增师傅资料修改功能,支持头像和接单手机号

- 新增 master/saveProfile 接口用于保存师傅资料
- 新增前端页面入口,允许已认证师傅修改头像和手机号
- 新增头像验证逻辑,确保头像属于当前用户且不超过10MB
- 新增 masterProfilePayload 工具函数验证手机号格式
- 优化会员中心账号页面,新增头像上传和展示功能
- 修复头像URL处理逻辑,支持CDN地址转换
这个提交包含在:
2026-11-20 11:10:34 +08:00
父节点 3d86db0bf4
当前提交 07f3349dd0
共有 15 个文件被更改,包括 1211 次插入 和 18 次删除

查看文件

@@ -35,6 +35,17 @@ class Base extends Api
return (int)$this->auth->id;
}
/** 验证新头像属于当前账号,且是符合限制的图片附件。 */
protected function validateAvatar($url)
{
$attachment = Db::name('attachment')->where('user_id', $this->uid())
->where('category', 'avatar')->where('url', $url)->find();
if (!$attachment || (int)$attachment['filesize'] > 10 * 1024 * 1024
|| !in_array(strtolower((string)$attachment['mimetype']), ['image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/bmp'], true)) {
$this->error('头像无效,请重新上传不超过10MB的图片');
}
}
/**
* 师傅档案
*/