Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
boyueCEnd
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
游洁
boyueCEnd
Commits
2627d3e2
Commit
2627d3e2
authored
Nov 27, 2025
by
youjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重置密码
parent
8fe15180
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
625 additions
and
94 deletions
+625
-94
zh-CN.ts
src/i18n/locales/zh-CN.ts
+7
-0
index.ts
src/router/index.ts
+7
-2
UserService.ts
src/services/UserService.ts
+13
-11
user.ts
src/stores/user.ts
+2
-2
providerTypeEnum.ts
src/utils/providerTypeEnum.ts
+53
-0
forgePassword.vue
src/views/auth/forgePassword.vue
+0
-61
accountCenter.vue
src/views/personalCenter/accountCenter.vue
+22
-18
editEmail.vue
src/views/personalCenter/accountCenter/editEmail.vue
+0
-0
perForgePassword.vue
src/views/personalCenter/accountCenter/perForgePassword.vue
+521
-0
resetPassword.vue
src/views/personalCenter/accountCenter/resetPassword.vue
+0
-0
No files found.
src/i18n/locales/zh-CN.ts
View file @
2627d3e2
...
...
@@ -190,6 +190,13 @@ export default {
return
:
'返回'
,
oldPassword
:
'旧密码'
,
placeholderNewPassword
:
'请输入新密码'
,
phoneCaptcha
:
'手机验证码'
,
wechat
:
'微信'
,
accountPassword
:
'账号密码'
,
unBindSuccess
:
'解绑成功'
,
unBindError
:
'解绑失败'
,
nextStepSetPassword
:
'下一步设置密码'
,
returnStep
:
'返回上一步'
,
},
// HTTP 错误状态码
httpError
:
{
...
...
src/router/index.ts
View file @
2627d3e2
...
...
@@ -58,12 +58,17 @@ const router = createRouter({
{
path
:
'/resetPassword'
,
meta
:
{
title
:
"page.resetPassword"
},
component
:
()
=>
import
(
'../views/personalCenter/resetPassword.vue'
)
component
:
()
=>
import
(
'../views/personalCenter/
accountCenter/
resetPassword.vue'
)
},
{
path
:
'/editEmail/:forward?'
,
meta
:
{
title
:
"page.editEmail"
},
component
:
()
=>
import
(
'../views/personalCenter/editEmail.vue'
)
component
:
()
=>
import
(
'../views/personalCenter/accountCenter/editEmail.vue'
)
},
{
path
:
'/perForgePassword/:email?'
,
meta
:
{
title
:
"page.editEmail"
},
component
:
()
=>
import
(
'../views/personalCenter/accountCenter/perForgePassword.vue'
)
},
]
},
...
...
src/services/UserService.ts
View file @
2627d3e2
...
...
@@ -246,8 +246,6 @@ export interface ResetPasswordDto {
* 更新密码请求参数
*/
export
interface
NewPasswordResponseDto
{
/** 租户ID */
tenantId
:
string
/** 旧密码 */
oldPassword
:
string
/** 新密码 */
...
...
@@ -431,9 +429,9 @@ class UserService {
* @param tenantId 租户ID
* @returns
*/
static
async
wechatThirdConfigAsync
(
tenantId
:
string
,
provider
Type
:
number
,
token
:
string
):
Promise
<
HttpResponse
>
{
static
async
wechatThirdConfigAsync
(
tenantId
:
string
,
provider
:
number
,
token
:
string
):
Promise
<
HttpResponse
>
{
const
data
=
{
provider
Type
provider
}
// OtaRequest 的响应拦截器会返回 response.data
const
response
=
await
OtaRequest
.
get
(
...
...
@@ -600,13 +598,17 @@ class UserService {
newPassword
:
string
,
):
Promise
<
HttpResponse
>
{
const
data
:
NewPasswordResponseDto
=
{
tenantId
,
oldPassword
,
newPassword
,
}
const
response
=
await
OtaRequest
.
post
(
'/account/password'
,
data
'/member-auth/password'
,
data
,
{
headers
:
tenantId
?
{
'__tenant'
:
tenantId
}
:
{}
}
)
return
response
as
unknown
as
HttpResponse
}
...
...
@@ -650,13 +652,13 @@ class UserService {
/**
* 解绑外部登录账号
* @param tenantId 租户ID(可选)
* @param
ProviderType
外部id
* @param
provider
外部id
*/
static
async
externalunbindBind
(
tenantId
:
string
,
ProviderType
:
string
):
Promise
<
HttpResponse
>
{
static
async
externalunbindBind
(
tenantId
:
string
,
provider
:
string
):
Promise
<
HttpResponse
>
{
const
data
=
{
ProviderType
provider
}
const
response
=
await
OtaRequest
.
ge
t
(
const
response
=
await
OtaRequest
.
pos
t
(
'/member-auth/external-unbind-bind'
,
data
,
{
...
...
src/stores/user.ts
View file @
2627d3e2
...
...
@@ -243,9 +243,9 @@ export const useUserStore = defineStore('user', {
* 获取微信appid
* @param tenantId 租户ID
*/
async
getUserWechatAppIdAsync
(
tenantId
:
string
,
provider
Type
:
number
):
Promise
<
UserLoginResult
>
{
async
getUserWechatAppIdAsync
(
tenantId
:
string
,
provider
:
number
):
Promise
<
UserLoginResult
>
{
try
{
const
response
=
await
UserService
.
wechatThirdConfigAsync
(
tenantId
,
provider
Type
,
this
.
token
)
const
response
=
await
UserService
.
wechatThirdConfigAsync
(
tenantId
,
provider
,
this
.
token
)
return
{
status
:
'SUCCESS'
,
verify
:
false
,
...
...
src/utils/providerTypeEnum.ts
0 → 100644
View file @
2627d3e2
import
i18n
from
'@/i18n'
const
ProviderTypeEnum
=
Object
.
freeze
({
PASSWORD
:
{
value
:
'Password'
,
desc
:
i18n
.
global
.
t
(
'personal.accountPassword'
),
icon
:
''
,
color
:
''
},
GOOGLE
:
{
value
:
'Google'
,
desc
:
'Google'
,
icon
:
''
,
color
:
''
},
WECHAT
:
{
value
:
'WeChat'
,
desc
:
i18n
.
global
.
t
(
'personal.wechat'
),
icon
:
''
,
color
:
''
},
LINE
:
{
value
:
'Line'
,
desc
:
'Line'
,
icon
:
''
,
color
:
''
},
PHONE
:
{
value
:
'PhoneCaptcha'
,
desc
:
i18n
.
global
.
t
(
'personal.phoneCaptcha'
),
icon
:
''
,
color
:
''
},
QQ
:
{
value
:
'QQ'
,
desc
:
'QQ'
,
icon
:
''
,
color
:
''
},
GITEE
:
{
value
:
'Gitee'
,
desc
:
'Gitee'
,
icon
:
''
,
color
:
''
},
FACEBOOK
:
{
value
:
'Facebook'
,
desc
:
'Facebook'
,
icon
:
''
,
color
:
''
}
})
export
default
ProviderTypeEnum
\ No newline at end of file
src/views/auth/forgePassword.vue
View file @
2627d3e2
...
...
@@ -33,7 +33,6 @@
size=
"large"
:placeholder=
"t('login.verifyCodeRequired')"
:maxLength=
"6"
@
input=
"handleCodeInput"
>
<
template
#
suffix
>
<a-divider
direction=
"vertical"
class=
"text-[16px] text-[#EEEFEB]"
></a-divider>
...
...
@@ -320,56 +319,6 @@ const handleSendCode = async () => {
}
}
// 处理验证码输入
const
handleCodeInput
=
()
=>
{
return
// 重置验证状态
codeValidateStatus
.
value
=
''
codeValidateMessage
.
value
=
''
// 当输入6位时自动验证
if
(
formData
.
code
.
length
===
6
)
{
verifyCode
()
}
}
// 验证验证码(在用户输入完6位后自动验证)
const
verifyCode
=
async
()
=>
{
if
(
!
formData
.
code
||
formData
.
code
.
length
!==
6
)
{
return
}
try
{
const
result
=
await
UserService
.
verifyEmailCodeAsync
(
formData
.
email
,
formData
.
code
,
formData
.
tenantId
||
'default'
,
formData
.
scene
||
'ResetPassword'
)
if
(
result
.
isValid
)
{
codeValidateStatus
.
value
=
'success'
codeValidateMessage
.
value
=
t
(
'login.codeVerified'
)
emailVerified
.
value
=
true
verificationToken
.
value
=
result
.
temporaryToken
||
''
lastVerifiedEmail
.
value
=
formData
.
email
formData
.
temporaryToken
=
result
.
temporaryToken
||
''
Message
.
success
(
t
(
'login.codeVerified'
))
}
else
{
codeValidateStatus
.
value
=
'error'
codeValidateMessage
.
value
=
result
.
message
||
t
(
'login.codeInvalid'
)
emailVerified
.
value
=
false
verificationToken
.
value
=
''
}
}
catch
(
error
:
any
)
{
console
.
error
(
'验证码验证失败:'
,
error
)
codeValidateStatus
.
value
=
'error'
codeValidateMessage
.
value
=
error
.
message
||
t
(
'login.codeVerifyFailed'
)
emailVerified
.
value
=
false
verificationToken
.
value
=
''
}
}
const
handlePrevious
=
()
=>
{
currentStep
.
value
--
}
...
...
@@ -382,16 +331,6 @@ const handleNext = () => {
Message
.
warning
(
t
(
'login.pleaseComplete'
))
return
}
// 检查邮箱是否已验证
// if (!emailVerified.value)
{
// Message.warning(t('login.pleaseVerifyEmail'))
// return
//
}
// 检查验证码
// if (!formData.code || codeValidateStatus.value !== 'success')
{
// Message.warning(t('login.pleaseVerifyCode'))
// return
//
}
}
else
if
(
currentStep
.
value
===
2
)
{
if
(
!
formData
.
password
||
!
formData
.
newPassword
)
{
Message
.
warning
(
t
(
'login.pleaseComplete'
))
...
...
src/views/personalCenter/accountCenter.vue
View file @
2627d3e2
...
...
@@ -13,14 +13,24 @@
<span
v-if=
"userInfor?.email==''"
class=
"customColor-text-7"
>
{{
t
(
'personal.notYetBin'
)
}}
</span>
<span
v-else
class=
"SourceHanSansCN"
>
<span>
{{
t
(
'personal.securityLevel'
)
}}
:
</span>
<span
class=
"customPrimary-9"
>
{{
t
(
'personal.low'
)
}}
</span>
<span
class=
"customPrimary-9"
>
<template
v-if=
"userInfor?.passwordSecurity
<2
"
>
{{
t
(
'personal.low'
)
}}
</
template
>
<
template
v-else-if=
"userInfor?.passwordSecurity==2"
>
{{
t
(
'personal.medium'
)
}}
</
template
>
<
template
v-else-if=
"userInfor?.passwordSecurity==3"
>
{{
t
(
'personal.high'
)
}}
</
template
>
</span>
</span>
</div>
<div
class=
"w-[415px] leading-[20px] SourceHanSansCN"
>
<div
class=
"w-[325px] customColor-text-7"
>
{{ t('personal.passwordSecurityTip') }}
</div>
</div>
<div
class=
"flex-1 flex justify-end items-end"
>
<a-button
@
click=
"goPage('/
f
orgePassword/'+userInfor.email)"
<a-button
@
click=
"goPage('/
perF
orgePassword/'+userInfor.email)"
type=
"primary"
size=
"large"
class=
"acc-button !h-[34px] !rounded-[8px] !text-sm !px-[13px]"
>
...
...
@@ -158,6 +168,7 @@ import { Message } from '@arco-design/web-vue'
import
{
query
}
from
'@/utils/common'
import
{
useRouter
}
from
'vue-router'
import
UserService
from
'@/services/UserService'
import
providerTypeEnum
from
'@/utils/providerTypeEnum'
const
{
t
}
=
useI18n
();
const
router
=
useRouter
()
...
...
@@ -170,16 +181,6 @@ const systemConfig = reactive({
const
loginType
=
ref
(
userStore
.
loginType
)
const
userInfor
=
ref
<
any
>
(
userStore
.
personalInfor
)
const
orderList
=
ref
<
any
>
([])
const
currentStatus
=
ref
(
0
)
const
queryParams
=
ref
<
any
>
({
pageIndex
:
1
,
pageSize
:
10
,
orderStatus
:
currentStatus
.
value
,
})
const
loading
=
ref
(
true
)
// 绑定Google账号
const
googleButtonContainer
=
ref
(
null
);
...
...
@@ -211,18 +212,21 @@ const goPage = (path: string) => {
const
unBindWeChatAccount
=
async
(
type
:
number
)
=>
{
loading
.
value
=
true
let
ProviderType
=
null
as
string
let
provider
=
null
as
string
if
(
type
==
2
){
ProviderType
=
WeChatInfor
.
value
.
id
provider
=
WeChatInfor
.
value
.
provider
}
else
if
(
type
==
1
){
ProviderType
=
LnlineInfor
.
value
.
id
provider
=
LnlineInfor
.
value
.
provider
}
else
if
(
type
==
3
){
ProviderType
=
GoogleInfor
.
value
.
id
provider
=
GoogleInfor
.
value
.
provider
}
try
{
const
response
=
await
UserService
.
externalunbindBind
(
systemConfig
.
tenantId
,
ProviderType
)
if
(
response
.
status
==
'SUCCESS'
){
const
response
=
await
UserService
.
externalunbindBind
(
systemConfig
.
tenantId
,
provider
)
if
(
response
){
Message
.
success
(
t
(
'personal.unBindSuccess'
))
getPersonalInfor
()
}
else
{
Message
.
error
(
t
(
'personal.unBindError'
))
}
}
catch
(
error
:
any
)
{
Message
.
error
(
error
.
message
||
t
(
'login.bindGoogleFailed'
))
...
...
src/views/personalCenter/editEmail.vue
→
src/views/personalCenter/
accountCenter/
editEmail.vue
View file @
2627d3e2
File moved
src/views/personalCenter/accountCenter/perForgePassword.vue
0 → 100644
View file @
2627d3e2
This diff is collapsed.
Click to expand it.
src/views/personalCenter/resetPassword.vue
→
src/views/personalCenter/
accountCenter/
resetPassword.vue
View file @
2627d3e2
File moved
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