Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
Internet-hospital
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
yuguo
Internet-hospital
Commits
f1c4920f
Commit
f1c4920f
authored
Feb 28, 2026
by
yuguo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
4ae56601
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
296 additions
and
181 deletions
+296
-181
.claude/settings.local.json
.claude/settings.local.json
+5
-1
server/internal/service/admin/user_crud_service.go
server/internal/service/admin/user_crud_service.go
+19
-1
web/src/app/(main)/patient/layout.tsx
web/src/app/(main)/patient/layout.tsx
+33
-11
web/src/pages/patient/Home/index.tsx
web/src/pages/patient/Home/index.tsx
+130
-116
web/src/pages/patient/Profile/index.tsx
web/src/pages/patient/Profile/index.tsx
+109
-52
No files found.
.claude/settings.local.json
View file @
f1c4920f
...
...
@@ -14,7 +14,11 @@
"Bash(npx tailwindcss:*)"
,
"Bash(npx next:*)"
,
"Bash(PGPASSWORD=T5sSfTZ6XYTD9bfC psql:*)"
,
"Bash(npm install:*)"
"Bash(npm install:*)"
,
"Bash(kill:*)"
,
"Bash(go run:*)"
,
"Bash(npm run:*)"
,
"Bash(lsof:*)"
]
}
}
server/internal/service/admin/user_crud_service.go
View file @
f1c4920f
...
...
@@ -4,6 +4,7 @@ import (
"context"
"fmt"
"github.com/google/uuid"
"golang.org/x/crypto/bcrypt"
"internet-hospital/internal/model"
)
...
...
@@ -46,7 +47,9 @@ func (s *Service) CreatePatient(ctx context.Context, req *CreatePatientRequest)
return
fmt
.
Errorf
(
"密码加密失败: %w"
,
err
)
}
userID
:=
uuid
.
New
()
.
String
()
user
:=
&
model
.
User
{
ID
:
userID
,
Phone
:
req
.
Phone
,
Password
:
string
(
hashedPassword
),
RealName
:
req
.
RealName
,
...
...
@@ -56,7 +59,22 @@ func (s *Service) CreatePatient(ctx context.Context, req *CreatePatientRequest)
Age
:
req
.
Age
,
}
return
s
.
db
.
Create
(
user
)
.
Error
tx
:=
s
.
db
.
Begin
()
if
err
:=
tx
.
Create
(
user
)
.
Error
;
err
!=
nil
{
tx
.
Rollback
()
return
err
}
profile
:=
&
model
.
PatientProfile
{
ID
:
uuid
.
New
()
.
String
(),
UserID
:
userID
,
}
if
err
:=
tx
.
Create
(
profile
)
.
Error
;
err
!=
nil
{
tx
.
Rollback
()
return
err
}
return
tx
.
Commit
()
.
Error
}
// UpdatePatient 更新患者信息
...
...
web/src/app/(main)/patient/layout.tsx
View file @
f1c4920f
...
...
@@ -7,7 +7,7 @@ import {
HomeOutlined
,
UserOutlined
,
MedicineBoxOutlined
,
FileTextOutlined
,
HeartOutlined
,
SettingOutlined
,
LogoutOutlined
,
BellOutlined
,
RobotOutlined
,
VideoCameraOutlined
,
PayCircleOutlined
,
ShoppingCartOutlined
,
FolderOpenOutlined
,
ShoppingCartOutlined
,
FolderOpenOutlined
,
SearchOutlined
,
}
from
'
@ant-design/icons
'
;
import
{
useUserStore
}
from
'
@/store/userStore
'
;
...
...
@@ -16,17 +16,39 @@ const { Text } = Typography;
const
menuItems
=
[
{
key
:
'
/patient/home
'
,
icon
:
<
HomeOutlined
/>,
label
:
'
首页
'
},
{
key
:
'
/patient/doctors
'
,
icon
:
<
MedicineBoxOutlined
/>,
label
:
'
医生列表
'
},
{
key
:
'
/patient/pre-consult
'
,
icon
:
<
RobotOutlined
/>,
label
:
'
AI预问诊
'
},
{
key
:
'
/patient/consult
'
,
icon
:
<
VideoCameraOutlined
/>,
label
:
'
问诊
'
},
{
key
:
'
/patient/prescription
'
,
icon
:
<
FileTextOutlined
/>,
label
:
'
处方
'
},
{
key
:
'
/patient/payment
'
,
icon
:
<
PayCircleOutlined
/>,
label
:
'
支付
'
},
{
key
:
'
/patient/pharmacy/order
'
,
icon
:
<
ShoppingCartOutlined
/>,
label
:
'
药品配送
'
},
{
key
:
'
/patient/chronic
'
,
icon
:
<
HeartOutlined
/>,
label
:
'
慢病管理
'
},
{
key
:
'
/patient/health-records
'
,
icon
:
<
FolderOpenOutlined
/>,
label
:
'
健康档案
'
},
{
key
:
'
consult-services
'
,
icon
:
<
VideoCameraOutlined
/>,
label
:
'
问诊服务
'
,
children
:
[
{
key
:
'
/patient/doctors
'
,
icon
:
<
SearchOutlined
/>,
label
:
'
找医生
'
},
{
key
:
'
/patient/pre-consult
'
,
icon
:
<
RobotOutlined
/>,
label
:
'
AI预问诊
'
},
{
key
:
'
/patient/consult
'
,
icon
:
<
VideoCameraOutlined
/>,
label
:
'
我的问诊
'
},
],
},
{
key
:
'
rx-pharmacy
'
,
icon
:
<
MedicineBoxOutlined
/>,
label
:
'
处方购药
'
,
children
:
[
{
key
:
'
/patient/prescription
'
,
icon
:
<
FileTextOutlined
/>,
label
:
'
电子处方
'
},
{
key
:
'
/patient/pharmacy/order
'
,
icon
:
<
ShoppingCartOutlined
/>,
label
:
'
药品配送
'
},
{
key
:
'
/patient/payment
'
,
icon
:
<
PayCircleOutlined
/>,
label
:
'
支付管理
'
},
],
},
{
key
:
'
health-mgmt
'
,
icon
:
<
HeartOutlined
/>,
label
:
'
健康管理
'
,
children
:
[
{
key
:
'
/patient/chronic
'
,
icon
:
<
HeartOutlined
/>,
label
:
'
慢病管理
'
},
{
key
:
'
/patient/health-records
'
,
icon
:
<
FolderOpenOutlined
/>,
label
:
'
健康档案
'
},
],
},
{
key
:
'
/patient/profile
'
,
icon
:
<
UserOutlined
/>,
label
:
'
个人中心
'
},
];
// 所有可路由的 key 列表(用于选中匹配)
const
allRouteKeys
=
[
'
/patient/home
'
,
'
/patient/doctors
'
,
'
/patient/pre-consult
'
,
'
/patient/consult
'
,
'
/patient/prescription
'
,
'
/patient/pharmacy/order
'
,
'
/patient/payment
'
,
'
/patient/chronic
'
,
'
/patient/health-records
'
,
'
/patient/profile
'
,
];
export
default
function
PatientLayout
({
children
}:
{
children
:
React
.
ReactNode
})
{
const
router
=
useRouter
();
const
pathname
=
usePathname
();
...
...
@@ -52,8 +74,8 @@ export default function PatientLayout({ children }: { children: React.ReactNode
};
const
getSelectedKeys
=
()
=>
{
const
match
=
menuItems
.
find
(
item
=>
currentPath
.
startsWith
(
item
.
key
));
return
match
?
[
match
.
key
]
:
[];
const
match
=
allRouteKeys
.
find
(
k
=>
currentPath
.
startsWith
(
k
));
return
match
?
[
match
]
:
[];
};
return
(
...
...
web/src/pages/patient/Home/index.tsx
View file @
f1c4920f
This diff is collapsed.
Click to expand it.
web/src/pages/patient/Profile/index.tsx
View file @
f1c4920f
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment