Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
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
viitto
pptist
Commits
6f6ed66a
Commit
6f6ed66a
authored
Jun 17, 2024
by
zhengke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录
parent
b8991837
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
19 deletions
+37
-19
UserService.ts
src/services/UserService.ts
+2
-2
user.ts
src/store/user.ts
+3
-3
Login.vue
src/views/Auth/Login.vue
+1
-1
passwordLogin.vue
src/views/Auth/components/passwordLogin.vue
+8
-0
wechatLogin.vue
src/views/Auth/components/wechatLogin.vue
+4
-5
Setting.vue
src/views/UserCenter/Setting.vue
+19
-8
No files found.
src/services/UserService.ts
View file @
6f6ed66a
...
...
@@ -33,8 +33,8 @@ class UserServices {
return
Api
.
Post
(
"travel_SetMyNickName"
,
msg
)
}
static
async
setModifyUserPwd
(
oldpwd
:
Number
,
pwd
:
Number
):
Promise
<
HttpResponse
>
{
let
msg
=
{
oldpwd
,
pwd
}
static
async
setModifyUserPwd
(
pwd
:
Number
,
oldpwd
:
Number
|
String
):
Promise
<
HttpResponse
>
{
let
msg
=
{
pwd
,
old
pwd
}
return
Api
.
Post
(
"travel_ModifyUserPwd"
,
msg
)
}
...
...
src/store/user.ts
View file @
6f6ed66a
...
...
@@ -126,12 +126,12 @@ export const useUserStore = defineStore('user', {
if
(
!
this
.
userInfo
.
logo
||
(
!
this
.
userInfo
.
logo
.
includes
(
'http://'
)
&&
!
this
.
userInfo
.
logo
.
includes
(
'https://'
))){
this
.
userInfo
.
logo
=
ENTERPRISE_DEFAULT_HEADER
}
return
{
status
:
'SUCCESS'
,
verify
:
false
}
as
UserLoginResult
return
{
status
:
'SUCCESS'
}
as
UserLoginResult
}
else
{
return
{
status
:
'CHOSEN'
,
data
:
response
.
data
.
data
,
verify
:
false
}
as
UserLoginResult
return
{
status
:
'CHOSEN'
,
data
:
response
.
data
.
data
}
as
UserLoginResult
}
}
else
return
{
status
:
'ERROR'
,
verify
:
response
.
data
.
data
==
1
}
as
UserLoginResult
}
else
return
{
status
:
'ERROR'
}
as
UserLoginResult
}
catch
(
error
)
{}
return
{
status
:
'ERROR'
,
verify
:
true
}
as
UserLoginResult
},
...
...
src/views/Auth/Login.vue
View file @
6f6ed66a
...
...
@@ -267,7 +267,7 @@ const verifyCheckHandler = async ()=>{
needVerify
.
value
=
response
.
data
.
data
==
1
}
else
needVerify
.
value
=
true
}
verifyCheckHandler
()
//
verifyCheckHandler()
</
script
>
<
style
lang=
"scss"
>
.login-box
{
...
...
src/views/Auth/components/passwordLogin.vue
View file @
6f6ed66a
...
...
@@ -100,6 +100,7 @@ const userLoginHandler = async ()=>{
location
.
href
=
'/space'
;
}
else
if
(
result
.
status
==
'CHOSEN'
&&
Array
.
isArray
(
result
.
data
)){
multipleUsers
.
value
=
result
.
data
emit
(
'submitForm'
,
multipleUsers
.
value
)
}
else
{
if
(
!
needVerify
.
value
)
needVerify
.
value
=
result
.
verify
if
(
invisibleHcaptcha
.
value
&&
needVerify
.
value
)
invisibleHcaptcha
.
value
.
reset
()
...
...
@@ -110,4 +111,11 @@ const userLoginHandler = async ()=>{
const
verifyHandler
=
(
token
:
string
,
ekey
:
string
)
=>
{
validateToken
.
value
=
token
}
const
verifyCheckHandler
=
async
()
=>
{
const
response
=
await
UserServices
.
NeedVerifyStatusAsync
()
if
(
response
.
data
.
resultCode
==
ApiResult
.
SUCCESS
){
needVerify
.
value
=
response
.
data
.
data
==
1
}
else
needVerify
.
value
=
true
}
verifyCheckHandler
()
</
script
>
\ No newline at end of file
src/views/Auth/components/wechatLogin.vue
View file @
6f6ed66a
...
...
@@ -9,6 +9,7 @@ import { reactive, ref } from 'vue'
import
{
ElMessage
,
FormInstance
}
from
'element-plus'
;
import
{
ApiResult
}
from
'@/configs/axios'
;
import
UserServices
from
'@/services/UserService'
;
import
{
useUserStore
}
from
'@/store/user'
;
const
loading
=
ref
(
false
)
...
...
@@ -17,6 +18,7 @@ const inviteInfo = ref<any>()
if
(
localStorage
.
getItem
(
"invite"
)){
inviteInfo
.
value
=
JSON
.
parse
(
localStorage
.
getItem
(
"invite"
)??
'{}'
)
}
const
user
=
useUserStore
()
const
qrCode
=
ref
(
'none'
)
const
qrLoading
=
ref
(
false
)
...
...
@@ -40,16 +42,16 @@ const stopTimerHandler = ()=>{
const
getQrcode
=
async
()
=>
{
qrLoading
.
value
=
true
const
result
=
await
UserServices
.
GetShowQrcode
(
1
)
const
result
=
await
UserServices
.
GetShowQrcode
(
0
)
if
(
result
.
data
.
resultCode
==
ApiResult
.
SUCCESS
){
qrCode
.
value
=
result
.
data
.
data
.
url
scene_id
.
value
=
result
.
data
.
data
.
scene_id
beginTimerHandler
()
}
qrLoading
.
value
=
false
}
const
userLoginHandler
=
async
()
=>
{
loading
.
value
=
true
const
result
=
await
user
.
setUserWechatLoginAsync
(
scene_id
.
value
)
if
(
result
.
status
==
'SUCCESS'
){
stopTimerHandler
()
...
...
@@ -59,10 +61,7 @@ const userLoginHandler = async ()=>{
localStorage
.
setItem
(
'sure_invite'
,
JSON
.
stringify
(
inviteInfo
.
value
))
}
location
.
href
=
'/space'
;
}
else
{
ElMessage
.
error
({
message
:
'出错啦,请稍后再试!'
})
}
loading
.
value
=
false
}
getQrcode
()
</
script
>
...
...
src/views/UserCenter/Setting.vue
View file @
6f6ed66a
...
...
@@ -28,6 +28,13 @@
</div>
<el-button>更换手机</el-button>
</div> -->
<div
class=
"setting-item"
>
<div>
<div
class=
"text-dark"
>
账号
</div>
<div
class=
""
>
+86 173****7817
</div>
</div>
<el-button>
更换账号
</el-button>
</div>
<div
class=
"setting-item"
>
<div>
<div
class=
"text-dark"
>
邮箱
</div>
...
...
@@ -52,9 +59,9 @@
<div
class=
"setting-item"
>
<div>
<div
class=
"text-dark"
>
密码
</div>
<div
class=
""
>
已
设置
</div>
<div
class=
""
>
{{isPwd?'未':'已'}}
设置
</div>
</div>
<el-button
@
click=
"bindDatas(2)"
>
更换
密码
</el-button>
<el-button
@
click=
"bindDatas(2)"
>
{{isPwd?'设置':'更换'}}
密码
</el-button>
</div>
</div>
<div
class=
"q-mt-lg setting-body rounded"
>
...
...
@@ -86,11 +93,11 @@
</el-form-item>
</template>
<
template
v-if=
"dialogType==2"
>
<el-form-item
label=
""
prop=
"oldpwd"
>
<el-form-item
label=
""
prop=
"oldpwd"
v-if=
"!isPwd"
>
<el-input
v-model=
"model.oldpwd"
type=
"password"
placeholder=
"原密码"
autocomplete=
"new-password"
show-password
/>
</el-form-item>
<el-form-item
label=
""
prop=
"pwd"
>
<el-input
v-model=
"model.pwd"
type=
"password"
placeholder=
"新密码
"
autocomplete=
"new-password"
show-password
/>
<el-input
v-model=
"model.pwd"
type=
"password"
:placeholder=
"isPwd?'设置密码':'新密码'
"
autocomplete=
"new-password"
show-password
/>
</el-form-item>
</
template
>
<!-- <el-form-item label="">
...
...
@@ -101,7 +108,7 @@
<div
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible = false"
class=
"ppt-button"
size=
"large"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"submitForm(bindFormRef)"
class=
"ppt-button"
size=
"large"
:loading=
"loading"
>
确定
<template
v-if=
"dialogType==1"
>
{{
Mailbox
?
'换绑'
:
'绑定'
}}
</
template
><
template
v-else
>
更换
</
template
>
确定
<template
v-if=
"dialogType==1"
>
{{
Mailbox
?
'换绑'
:
'绑定'
}}
</
template
><
template
v-else
>
{{
isPwd
?
'设置'
:
'更换'
}}
</
template
>
</el-button>
</div>
</template>
...
...
@@ -175,6 +182,8 @@ const rules = reactive<FormRules<RuleForm>>({
]
})
const
isPwd
=
ref
(
0
)
//上传头像地址
const
getUploadActionUrl
=
()
=>
{
let
uid
=
userInfo
.
value
.
id
;
...
...
@@ -223,7 +232,7 @@ const bindHandler = async () =>{
let
response
if
(
dialogType
.
value
==
0
)
response
=
await
UserServices
.
setMyNickNamed
(
userInfo
.
value
.
nickname
)
if
(
dialogType
.
value
==
1
)
response
=
await
UserServices
.
setBindUserEmail
(
model
.
value
.
mail
,
model
.
value
.
code
)
if
(
dialogType
.
value
==
2
)
response
=
await
UserServices
.
setModifyUserPwd
(
model
.
value
.
oldpwd
,
model
.
value
.
pwd
)
if
(
dialogType
.
value
==
2
)
response
=
await
UserServices
.
setModifyUserPwd
(
model
.
value
.
pwd
,
model
.
value
.
old
pwd
)
if
(
dialogType
.
value
==
3
)
response
=
await
UserServices
.
ModifyUserPhoto
(
userInfo
.
value
.
photo
)
if
(
response
){
if
(
response
.
data
.
resultCode
==
ApiResult
.
SUCCESS
){
...
...
@@ -232,7 +241,7 @@ const bindHandler = async () =>{
getInfo
()
}
if
(
dialogType
.
value
==
2
)
{
ElMessage
.
success
({
message
:
'更换密码成功'
})
ElMessage
.
success
({
message
:
`
${
isPwd
.
value
?
'设置'
:
'更换'
}
密码成功`
})
useUser
.
setUserLoginOut
()
}
dialogVisible
.
value
=
false
...
...
@@ -269,7 +278,7 @@ const sendVerifyCode = async () => {
const
bindDatas
=
(
type
:
Number
)
=>
{
dialogType
.
value
=
type
if
(
type
==
1
)
dialogTitle
.
value
=
Mailbox
.
value
?
'更换邮箱'
:
'绑定邮箱'
if
(
type
==
2
)
dialogTitle
.
value
=
'更换密码'
if
(
type
==
2
)
dialogTitle
.
value
=
`
${
isPwd
.
value
?
'设置'
:
'更换'
}
密码`
dialogVisible
.
value
=
true
}
...
...
@@ -287,6 +296,8 @@ const getInfo = async () => {
const
response
=
await
UserServices
.
GetMemberUserInfo
()
if
(
response
.
data
.
resultCode
==
ApiResult
.
SUCCESS
){
Mailbox
.
value
=
response
.
data
.
data
.
mail
console
.
log
(
response
.
data
.
data
,
'-------'
)
isPwd
.
value
=
response
.
data
.
data
.
Pwd
}
}
...
...
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