Merge branch 'user' into feature/fs
This commit is contained in:
Generated
-34
@@ -1,34 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="MessDetectorOptionsConfiguration">
|
|
||||||
<option name="transferred" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="PHPCSFixerOptionsConfiguration">
|
|
||||||
<option name="transferred" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="PHPCodeSnifferOptionsConfiguration">
|
|
||||||
<option name="highlightLevel" value="WARNING" />
|
|
||||||
<option name="transferred" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="PhpIncludePathManager">
|
|
||||||
<include_path>
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/composer" />
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/psr/log" />
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/psr/container" />
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/nikic/fast-route" />
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/monolog/monolog" />
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/workerman/workerman" />
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/workerman/webman-framework" />
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/workerman/coroutine" />
|
|
||||||
</include_path>
|
|
||||||
</component>
|
|
||||||
<component name="PhpProjectSharedConfiguration" php_language_level="8.1">
|
|
||||||
<option name="suggestChangeDefaultLanguageLevel" value="false" />
|
|
||||||
</component>
|
|
||||||
<component name="PhpStanOptionsConfiguration">
|
|
||||||
<option name="transferred" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="PsalmOptionsConfiguration">
|
|
||||||
<option name="transferred" value="true" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
Generated
-65
@@ -1,65 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ChangeListManager">
|
|
||||||
<list default="true" id="0ddfa776-bdd1-405a-b4bc-fa2ba24b6076" name="更改" comment="" />
|
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
||||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
||||||
</component>
|
|
||||||
<component name="ComposerSettings" synchronizationState="SYNCHRONIZE">
|
|
||||||
<pharConfigPath>$PROJECT_DIR$/webman/composer.json</pharConfigPath>
|
|
||||||
<execution />
|
|
||||||
</component>
|
|
||||||
<component name="PhpWorkspaceProjectConfiguration" interpreter_name="D:\apply\phpstudy_pro\Extensions\php\php8.2.9nts\php.exe">
|
|
||||||
<include_path>
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/composer" />
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/psr/log" />
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/psr/container" />
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/nikic/fast-route" />
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/monolog/monolog" />
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/workerman/workerman" />
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/workerman/webman-framework" />
|
|
||||||
<path value="$PROJECT_DIR$/webman/vendor/workerman/coroutine" />
|
|
||||||
</include_path>
|
|
||||||
</component>
|
|
||||||
<component name="ProjectColorInfo"><![CDATA[{
|
|
||||||
"associatedIndex": 2
|
|
||||||
}]]></component>
|
|
||||||
<component name="ProjectId" id="2u9XI1wtCPZFlrg7FpxEdZXKEWu" />
|
|
||||||
<component name="ProjectViewState">
|
|
||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
|
||||||
<option name="showLibraryContents" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="PropertiesComponent"><![CDATA[{
|
|
||||||
"keyToString": {
|
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
||||||
"last_opened_file_path": "D:/www/webman",
|
|
||||||
"nodejs_package_manager_path": "npm",
|
|
||||||
"vue.rearranger.settings.migration": "true"
|
|
||||||
}
|
|
||||||
}]]></component>
|
|
||||||
<component name="SharedIndexes">
|
|
||||||
<attachedChunks>
|
|
||||||
<set>
|
|
||||||
<option value="bundled-js-predefined-d6986cc7102b-76f8388c3a79-JavaScript-PS-243.24978.50" />
|
|
||||||
<option value="bundled-php-predefined-a98d8de5180a-fbeb0b58ac0f-com.jetbrains.php.sharedIndexes-PS-243.24978.50" />
|
|
||||||
</set>
|
|
||||||
</attachedChunks>
|
|
||||||
</component>
|
|
||||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
|
|
||||||
<component name="TaskManager">
|
|
||||||
<task active="true" id="Default" summary="默认任务">
|
|
||||||
<changelist id="0ddfa776-bdd1-405a-b4bc-fa2ba24b6076" name="更改" comment="" />
|
|
||||||
<created>1741661680676</created>
|
|
||||||
<option name="number" value="Default" />
|
|
||||||
<option name="presentableId" value="Default" />
|
|
||||||
<updated>1741661680676</updated>
|
|
||||||
<workItem from="1741661681853" duration="24000" />
|
|
||||||
</task>
|
|
||||||
<servers />
|
|
||||||
</component>
|
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
|
||||||
<option name="version" value="3" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
@@ -169,6 +169,81 @@ class UserController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param Request $request
|
||||||
|
* @return \support\Response
|
||||||
|
* @throws \Random\RandomException
|
||||||
|
*/
|
||||||
|
public function save(Request $request)
|
||||||
|
{
|
||||||
|
$name = Util::getParam($request, 'name');
|
||||||
|
$sex = Util::getParam($request, 'sex');
|
||||||
|
$position = Util::getParam($request, 'position');
|
||||||
|
$country_id = Util::getParam($request, 'country_id');
|
||||||
|
$sign = Util::getParam($request, 'sign');
|
||||||
|
$id = $request->user['id'];
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'name' => $name,
|
||||||
|
'sex' => $sex,
|
||||||
|
'position' => $position,
|
||||||
|
'country_id' => $country_id,
|
||||||
|
'sign' => $sign,
|
||||||
|
];
|
||||||
|
|
||||||
|
$res = User::where('id', $id)
|
||||||
|
->update($data);
|
||||||
|
|
||||||
|
if ($res) {
|
||||||
|
return Util::success($res, trans('save_success'));
|
||||||
|
} else {
|
||||||
|
return Util::fail($res, trans('save_fail'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
* @param Request $request
|
||||||
|
* @return \support\Response
|
||||||
|
* @throws \Random\RandomException
|
||||||
|
*/
|
||||||
|
public function savePassword(Request $request)
|
||||||
|
{
|
||||||
|
$password = Util::getParam($request, 'password');
|
||||||
|
$email = Util::getParam($request, 'email');
|
||||||
|
$code = Util::getParam($request, 'code');
|
||||||
|
$verification_code = Redis::get("verification_code:{$email}");
|
||||||
|
$id = $request->user['id'];
|
||||||
|
|
||||||
|
if ($code != $verification_code) {
|
||||||
|
return Util::fail([], trans('code_error'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$res = User::where('id', $id)
|
||||||
|
->first();
|
||||||
|
if($res['email'] != $email) {
|
||||||
|
return Util::fail([], trans('email_consistent'));
|
||||||
|
}
|
||||||
|
|
||||||
|
//加密
|
||||||
|
// $hashedPassword = password_hash($password, PASSWORD_DEFAULT);
|
||||||
|
$hashedPassword = password_hash($password, PASSWORD_DEFAULT);
|
||||||
|
|
||||||
|
$data = [
|
||||||
|
'password' => $hashedPassword
|
||||||
|
];
|
||||||
|
|
||||||
|
$res = User::where('id', $id)
|
||||||
|
->update($data);
|
||||||
|
|
||||||
|
if ($res) {
|
||||||
|
return Util::success($res, trans('save_success'));
|
||||||
|
} else {
|
||||||
|
return Util::fail($res, trans('save_fail'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 注册
|
* 注册
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
@@ -182,7 +257,7 @@ class UserController
|
|||||||
if (Util::isEmpty($language)) {
|
if (Util::isEmpty($language)) {
|
||||||
return Util::fail([], 'language' . trans('not_null'));
|
return Util::fail([], 'language' . trans('not_null'));
|
||||||
}
|
}
|
||||||
if (!in_array($language,['en','zh_CN'])) {
|
if (!in_array($language, ['en', 'zh_CN'])) {
|
||||||
return Util::fail([], trans('param_error'));
|
return Util::fail([], trans('param_error'));
|
||||||
}
|
}
|
||||||
$data = [
|
$data = [
|
||||||
|
|||||||
@@ -22,4 +22,5 @@ return [
|
|||||||
'contacts_not_null' => ' Contact person, email, and phone cannot be empty at the same time',
|
'contacts_not_null' => ' Contact person, email, and phone cannot be empty at the same time',
|
||||||
'car_type_not_null' => ' preference_not_null',
|
'car_type_not_null' => ' preference_not_null',
|
||||||
'channel_not_null' => ' channel not null',
|
'channel_not_null' => ' channel not null',
|
||||||
|
'email_consistent' => ' Inconsistent email addresses',
|
||||||
];
|
];
|
||||||
@@ -22,4 +22,5 @@ return [
|
|||||||
'contacts_not_null' => ' 联系人,邮箱,电话不能同时为空',
|
'contacts_not_null' => ' 联系人,邮箱,电话不能同时为空',
|
||||||
'car_type_not_null' => ' 偏好不能为空',
|
'car_type_not_null' => ' 偏好不能为空',
|
||||||
'channel_not_null' => ' 渠道不能为空',
|
'channel_not_null' => ' 渠道不能为空',
|
||||||
|
'email_consistent' => ' 邮箱不一致',
|
||||||
];
|
];
|
||||||
Reference in New Issue
Block a user