更新头像添加路径3

This commit is contained in:
yyh931018@qq.com
2022-09-28 17:52:56 +08:00
parent 5ff8911391
commit f78605e5dd

View File

@@ -198,13 +198,12 @@ function getPicUrl($url)
} else { } else {
unset($params['password'], $params['salt']); unset($params['password'], $params['salt']);
} }
//这里需要针对mobile做唯一验证1111
$params['avatar'] = $this->getPicUrl($params['avatar']);
//这里需要针对mobile做唯一验证
$adminValidate = \think\Loader::validate('Student'); $adminValidate = \think\Loader::validate('Student');
$adminValidate->rule([ $adminValidate->rule([
'mobile' => 'regex:1[3-9]\d{9}|unique:student,mobile,' . $row->id, 'mobile' => 'regex:1[3-9]\d{9}|unique:student,mobile,' . $row->id,
]); ]);
$params['avatar'] = $this->getPicUrl($params['avatar']);
$result = $row->validateFailException()->validate('Student.edit')->allowField(true)->save($params); $result = $row->validateFailException()->validate('Student.edit')->allowField(true)->save($params);
Db::commit(); Db::commit();
} catch (ValidateException|PDOException|Exception $e) { } catch (ValidateException|PDOException|Exception $e) {