\App\ModelsLogUserPassword

用户密码日志

职责:密码修改台账的审计记录载体——注册/新建/导入的初始设置、修改、 重置(管理员重置/找回密码)每次落一行;password_hash 与用户表 同值(加盐 bcrypt 哈希,不可逆),绝不存明文(安全红线)。 仅个人中心「我的记录·密码修改」页签消费,写路径仅 WritePasswordLog。

Summary

Methods
Properties
Constants
timestampCasts()
$timestamps
$id
$user_id
$user_name
$password_hash
$change_type
$operator
$client_ip
$user_agent
$server_ip
$instance_id
$trace_id
$session_id
$create_time
CHANGE_TYPE_INITIAL
CHANGE_TYPE_CHANGED
CHANGE_TYPE_RESET
serializeDate()
casts()
$table
$hidden
$fillable
N/A
No private methods found
No private properties found
N/A

Constants

CHANGE_TYPE_INITIAL

CHANGE_TYPE_INITIAL = 0

修改类型:初始设置(注册 / 管理员新建 / 导入)

CHANGE_TYPE_CHANGED

CHANGE_TYPE_CHANGED = 1

修改类型:修改(管理员编辑用户改密)

CHANGE_TYPE_RESET

CHANGE_TYPE_RESET = 2

修改类型:重置(管理员重置 / 找回密码)

Properties

$timestamps

$timestamps

$id

$id : int

主键ID

Type

int

$user_id

$user_id : int

用户ID

Type

int

$user_name

$user_name : string

用户名

Type

string

$password_hash

$password_hash : string

加盐哈希(与用户表同值,绝无明文)

Type

string

$change_type

$change_type : int

类型:0 初始设置,1 修改,2 重置

Type

int

$operator

$operator : string

操作来源:本人/管理员姓名/系统导入

Type

string

$client_ip

$client_ip : string

客户端 IP

Type

string

$user_agent

$user_agent : string

User-Agent

Type

string

$server_ip

$server_ip : string

服务器 IP

Type

string

$instance_id

$instance_id : string

实例标识

Type

string

$trace_id

$trace_id : string|null

链路追踪 ID

Type

string|null

$session_id

$session_id : string|null

会话指纹(token_id 的 SHA-256 派生,防泄露劫持;原始值禁止入日志)

Type

string|null

$create_time

$create_time : string

创建时间

┌────────────────── 分区导航(按此顺序阅读)──────────────────┐ 分区 1 · 常量 修改类型 CHANGE_TYPE_* 分区 2 · 表名与属性 $table / $fillable / casts └────────────────────────────────────────────────────────────┘

Type

string

$table

$table

$hidden

$hidden

$fillable

$fillable

Methods

timestampCasts()

timestampCasts() : array<string,string>

全库统一的时间列 cast 段(单源:约 22 个模型 casts() 内重复的两行)。 使用方模型 casts() 内 `return array_merge(self::timestampCasts(), [...])`。

Returns

array

serializeDate()

serializeDate(\DateTimeInterface  $date) : string

所有日期属性统一按 "年-月-日 时:分:秒" 序列化。

Parameters

\DateTimeInterface $date

Returns

string —

casts()

casts() : array

Returns

array —