mirror of
https://github.com/fumiama/paper-manager.git
synced 2026-06-27 22:30:28 +08:00
add 您已加入 to workbench
This commit is contained in:
@@ -29,7 +29,7 @@ type getUserInfoResult struct {
|
|||||||
Desc string `json:"desc"`
|
Desc string `json:"desc"`
|
||||||
HomePath string `json:"homePath"`
|
HomePath string `json:"homePath"`
|
||||||
Roles []role `json:"roles"`
|
Roles []role `json:"roles"`
|
||||||
Date string `json:"date"`
|
Date int64 `json:"date"`
|
||||||
Last string `json:"last"`
|
Last string `json:"last"`
|
||||||
Contact string `json:"contact"`
|
Contact string `json:"contact"`
|
||||||
}
|
}
|
||||||
@@ -65,7 +65,7 @@ func getUserInfo(token string) (*getUserInfoResult, error) {
|
|||||||
return "/dashboard/workbench"
|
return "/dashboard/workbench"
|
||||||
}(),
|
}(),
|
||||||
Roles: []role{{RoleName: user.Role.Nick(), Value: user.Role.String()}},
|
Roles: []role{{RoleName: user.Role.Nick(), Value: user.Role.String()}},
|
||||||
Date: time.Unix(user.Date, 0).Format(chineseDateLayout),
|
Date: user.Date,
|
||||||
Last: time.Unix(user.Last, 0).Format(chineseDateLayout),
|
Last: time.Unix(user.Last, 0).Format(chineseDateLayout),
|
||||||
Contact: hideContact(user.Cont),
|
Contact: hideContact(user.Cont),
|
||||||
}, nil
|
}, nil
|
||||||
|
|||||||
@@ -15,9 +15,13 @@
|
|||||||
<span class="text-secondary"> {{ userinfo.desc }} </span>
|
<span class="text-secondary"> {{ userinfo.desc }} </span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-1 justify-end md:mt-0 mt-4">
|
<div class="flex flex-1 justify-end md:mt-0 mt-4">
|
||||||
|
<div class="flex flex-col justify-center text-right md:mr-10 mr-4">
|
||||||
|
<span class="text-secondary"> 您已加入 </span>
|
||||||
|
<span class="text-2xl"> {{ enterDays }}天 </span>
|
||||||
|
</div>
|
||||||
<div class="flex flex-col justify-center text-right md:mr-10 mr-4">
|
<div class="flex flex-col justify-center text-right md:mr-10 mr-4">
|
||||||
<span class="text-secondary"> 课程组人数 </span>
|
<span class="text-secondary"> 课程组人数 </span>
|
||||||
<span class="text-2xl"> {{ userscount }} </span>
|
<span class="text-2xl"> {{ userscount }}人 </span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -31,6 +35,10 @@
|
|||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const userinfo = computed(() => userStore.getUserInfo)
|
const userinfo = computed(() => userStore.getUserInfo)
|
||||||
|
const enterDays = computed(() => {
|
||||||
|
const date: Date = new Date(new Date().getTime() - userStore.getUserInfo.date * 1000)
|
||||||
|
return date.getDay()
|
||||||
|
})
|
||||||
const userscount = ref(0)
|
const userscount = ref(0)
|
||||||
getUsersCount().then((value: number) => {
|
getUsersCount().then((value: number) => {
|
||||||
userscount.value = value
|
userscount.value = value
|
||||||
|
|||||||
2
frontend/vben/types/store.d.ts
vendored
2
frontend/vben/types/store.d.ts
vendored
@@ -30,7 +30,7 @@ export interface UserInfo {
|
|||||||
desc?: string
|
desc?: string
|
||||||
homePath?: string
|
homePath?: string
|
||||||
roles: RoleInfo[]
|
roles: RoleInfo[]
|
||||||
date: string
|
date: number
|
||||||
last: string
|
last: string
|
||||||
contact: string
|
contact: string
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user