feat: 新增登录接口

This commit is contained in:
2024-12-31 18:05:36 +08:00
parent 741c2d6f85
commit b5e83a998c
8 changed files with 219 additions and 2 deletions

View File

@@ -1,2 +1,35 @@
<?php
// 应用公共文件
// 接口错误返回
if (!function_exists('error')) {
function error($msg = '', $data = [])
{
return \apiret\Api::error($msg, $data);
}
}
// 接口成功返回
if (!function_exists('success')) {
function success($msg = '', $data = [])
{
return \apiret\Api::success($msg, $data);
}
}
// 接口调结果返回
if (!function_exists('result')) {
function result($errno, $msg = '', $data = [])
{
return \apiret\Api::result($errno)->message($msg)->response($data);
}
}
// 密码加盐
if (!function_exists('password_with_salt')) {
function password_with_salt($password, $salt)
{
return md5(hash('sha256', $password . $salt));
}
}