refactor: 修改导航新增唯一标识处理

This commit is contained in:
2025-03-07 10:24:54 +08:00
parent 999f136efb
commit 574839a26e

View File

@@ -75,12 +75,16 @@ class Navigation
public function save() public function save()
{ {
$post = request()->post([ $post = request()->post([
'unique_label' => '',
'name', 'name',
'at_platform' => 'pc', 'at_platform' => 'pc',
'desc', 'desc',
'status' => 1 'status' => 1
]); ]);
$data = array_merge($post, ['language_id' => request()->lang_id, 'unique_label' => uniqid("NAV_")]); if (empty($post['unique_label'])) {
$post['unique_label'] = uniqid("NAV_");
}
$data = array_merge($post, ['language_id' => request()->lang_id]);
$validate = new NavigationValidate; $validate = new NavigationValidate;
if (!$validate->scene('add')->check($data)) { if (!$validate->scene('add')->check($data)) {