Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ae8ee0d6
authored
Oct 11, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交登录
1 parent
e13c521e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
21 deletions
login/index/components/Box/Box.js
utils/request/request.js
login/index/components/Box/Box.js
View file @
ae8ee0d
...
@@ -149,13 +149,22 @@ Component({
...
@@ -149,13 +149,22 @@ Component({
password
:
formData
.
password
password
:
formData
.
password
}
}
this
.
setBtnLoading
()
this
.
setBtnLoading
()
console
.
log
(
target
)
USERAPI
[
target
](
obj
).
then
(({
USERAPI
[
target
](
obj
).
then
(({
code
,
code
,
data
,
data
,
message
message
})
=>
{
})
=>
{
this
.
setBtnLoading
(
false
)
this
.
setBtnLoading
(
false
)
if
(
code
==
'0'
)
{}
else
{
if
(
code
==
'0'
)
{
if
(
loginType
==
1
)
this
.
selectAccountLogin
({
id
:
data
.
loginUserInfoList
[
0
].
uuid
,
sessionId
:
data
.
sessionId
})
else
{
console
.
log
(
data
)
}
}
else
{
if
(
loginType
==
1
)
this
.
setData
({
if
(
loginType
==
1
)
this
.
setData
({
smsError
:
true
smsError
:
true
})
})
...
@@ -180,29 +189,13 @@ Component({
...
@@ -180,29 +189,13 @@ Component({
const
{
const
{
loginUserInfoList
,
loginUserInfoList
,
sessionId
sessionId
}
=
data
,
{
}
=
data
options
:
{
targetPath
}
}
=
thisPage
if
(
loginUserInfoList
.
length
>
1
)
{
if
(
loginUserInfoList
.
length
>
1
)
{
wx
.
$router
.
go
(
'login.accountItems'
)
wx
.
$router
.
go
(
'login.accountItems'
)
}
else
{
}
else
this
.
selectAccountLogin
({
USERAPI
.
selectAccountLogin
({
id
:
loginUserInfoList
[
0
].
uuid
,
id
:
loginUserInfoList
[
0
].
uuid
,
sessionId
sessionId
}).
then
(
res
=>
{
setUserInfo
(
loginUserInfoList
[
0
])
setSessionId
(
sessionId
)
if
(
targetPath
)
{
const
{
url
,
obj
}
=
setRouteData
(
targetPath
)
wx
.
$router
.
reLaunch
(
url
,
obj
)
}
else
wx
.
$router
.
go
(
'pages.index'
)
})
})
}
}
else
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
}
else
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
this
.
setBtnLoading
(
false
)
this
.
setBtnLoading
(
false
)
}).
catch
(({
}).
catch
(({
...
@@ -253,6 +246,40 @@ Component({
...
@@ -253,6 +246,40 @@ Component({
})
=>
{
})
=>
{
if
(
confirm
)
this
.
init
()
if
(
confirm
)
this
.
init
()
})
})
},
selectAccountLogin
({
id
,
sessionId
})
{
const
{
options
:
{
targetPath
}
}
=
thisPage
USERAPI
.
selectAccountLogin
({
id
,
sessionId
}).
then
(({
code
,
data
,
message
})
=>
{
if
(
code
==
'0'
)
{
setUserInfo
(
data
.
loginUserInfoList
[
0
])
setSessionId
(
data
.
sessionId
)
if
(
targetPath
)
{
const
{
url
,
obj
}
=
setRouteData
(
targetPath
)
wx
.
$router
.
reLaunch
(
url
,
obj
)
}
else
wx
.
$router
.
go
(
'pages.index'
)
}
else
wx
.
$api
.
showToast
(
message
||
'系统异常'
)
}).
catch
(({
errMsg
})
=>
{
wx
.
$api
.
showToast
(
errMsg
||
'系统异常'
)
})
}
}
},
},
lifetimes
:
{
lifetimes
:
{
...
...
utils/request/request.js
View file @
ae8ee0d
...
@@ -25,8 +25,6 @@ class Request {
...
@@ -25,8 +25,6 @@ class Request {
'content-type'
:
'application/x-www-form-urlencoded'
'content-type'
:
'application/x-www-form-urlencoded'
}
:
}
:
{}
{}
const
merchantId
=
wx
.
$storage
.
get
(
'srcm_shopmall_merchant_id'
)
if
(
merchantId
)
header
.
merchantId
=
merchantId
let
projectName
=
this
.
getRopProject
(
params
.
method
)
let
projectName
=
this
.
getRopProject
(
params
.
method
)
if
(
!
projectName
)
projectName
=
this
.
getRopProject
(
params
.
method
)
if
(
!
projectName
)
projectName
=
this
.
getRopProject
(
params
.
method
)
const
path
=
pathEnum
[
projectName
]
const
path
=
pathEnum
[
projectName
]
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment