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 e13c521e
authored
Oct 11, 2022
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
解决合并冲突
2 parents
cbc1396a
37806a6b
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
62 additions
and
32 deletions
app.js
login/index/components/Box/Box.js
login/index/index.js
login/lib/index.js
login/loading/loading.js
project.private.config.json
router/router.js
utils/cache/storage.js
app.js
View file @
e13c521
...
...
@@ -12,7 +12,7 @@ import { setSystem_info } from '~/utils/cache/storageApi'
import
getUpdateManager
from
'./utils/lib/wxUpdateManager'
// 埋点
import
'./utils/track/Track'
//
import './utils/track/Track'
import
eventbus
from
'./utils/evenbus'
...
...
login/index/components/Box/Box.js
View file @
e13c521
// login/index/components/LoginBox.js
import
USERAPI
from
'~/api/usersApi/index'
import
{
setSessionId
}
from
'~/utils/cache/storageApi'
import
{
setSessionId
,
setUserInfo
}
from
'~/utils/cache/storageApi'
import
{
setRouteData
}
from
'~/login/lib/index'
let
thisPage
Component
({
options
:
{
...
...
@@ -175,17 +180,27 @@ Component({
const
{
loginUserInfoList
,
sessionId
}
=
data
}
=
data
,
{
options
:
{
targetPath
}
}
=
thisPage
if
(
loginUserInfoList
.
length
>
1
)
{
wx
.
$router
.
go
(
'login.accountItems'
)
}
else
{
wx
.
$router
.
go
(
'login.accountItems'
)
USERAPI
.
selectAccountLogin
({
id
:
loginUserInfoList
[
0
].
uuid
,
sessionId
}).
then
(
res
=>
{
console
.
log
(
res
)
}).
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
||
'系统异常'
)
...
...
login/index/index.js
View file @
e13c521
...
...
@@ -9,7 +9,6 @@ Page({
disabled
:
true
},
onRoute
(
options
){
console
.
log
(
options
)
},
/**
* 生命周期函数--监听页面加载
...
...
login/lib/index.js
0 → 100644
View file @
e13c521
export
const
setRouteData
=
targetPath
=>
{
let
[
url
,
query
]
=
targetPath
.
split
(
'?'
),
obj
=
{}
if
(
query
)
{
const
[
key
,
val
]
=
query
.
split
(
'='
)
obj
=
{
[
key
]:
val
}
}
return
{
url
,
obj
}
}
\ No newline at end of file
login/loading/loading.js
View file @
e13c521
import
{
setRouteData
}
from
'../lib/index'
import
{
getSessionId
,
}
from
'~/utils/cache/storageApi'
Page
({
/**
...
...
@@ -26,23 +32,26 @@ Page({
*/
onShow
()
{
wx
.
$api
.
showLoading
()
const
{
sessionId
,
}
=
wx
.
$storage
.
get
(),
{
url
,
targetPath
=
decodeURIComponent
(
url
)
}
=
this
.
options
console
.
log
(
targetPath
)
const
sessionId
=
getSessionId
(),
{
url
,
targetPath
=
url
?
decodeURIComponent
(
url
)
:
''
}
=
this
.
options
wx
.
nextTick
(()
=>
{
if
(
sessionId
)
{
// wx.$router.reLaunch('login.index')
let
url
=
'pages.index'
,
obj
=
{}
if
(
targetPath
)
{
url
=
setRouteData
(
targetPath
).
url
obj
=
setRouteData
(
targetPath
).
obj
}
wx
.
$router
.
reLaunch
(
url
,
obj
)
}
else
{
wx
.
$router
.
reLaunch
(
'login.index'
,
{
targetPath
}
)
let
obj
=
{}
if
(
targetPath
)
obj
.
targetPath
=
targetPath
wx
.
$router
.
reLaunch
(
'login.index'
,
obj
)
}
})
},
/**
...
...
@@ -71,12 +80,5 @@ Page({
*/
onReachBottom
()
{
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
()
{
}
})
\ No newline at end of file
project.private.config.json
View file @
e13c521
...
...
@@ -17,7 +17,7 @@
{
"name"
:
"携带目标页面"
,
"pathName"
:
"login/loading/loading"
,
"query"
:
"url=
pages%2Ftab%2Findex%2Findex
%3Fid%3D123"
,
"query"
:
"url=
%2Fpages%2Ftab%2Foutput%2Foutput
%3Fid%3D123"
,
"launchMode"
:
"default"
,
"scene"
:
null
}
...
...
router/router.js
View file @
e13c521
...
...
@@ -20,6 +20,7 @@ class Router {
wx
.
onAppRoute
(
e
=>
{
let
thisPage
=
this
.
getPageInstance
()
if
(
thisPage
)
{
thisPage
.
options
=
this
[
_query
]
this
.
setNavigationBarTitleText
(
thisPage
)
let
onRoute
=
thisPage
.
onRoute
typeof
onRoute
===
'function'
&&
onRoute
(
this
[
_query
])
...
...
utils/cache/storage.js
View file @
e13c521
...
...
@@ -52,17 +52,16 @@ class Storage {
*/
get
=
(
key
,
syncFlag
=
true
)
=>
{
// 有值默认取key值
// debugger
if
(
key
)
{
// 判断值是否是指定的对象值
let
tmpKey
=
this
.
checkKeyType
(
key
,
1
)
let
isObjectKey
=
STORAGE_OBJECTkEY
[
tmpKey
]
console
.
log
(
key
)
console
.
log
(
isObjectKey
)
//
console.log(key)
//
console.log(isObjectKey)
if
(
isObjectKey
)
{
return
this
.
getObjectKeyValue
(
isObjectKey
)
}
else
{
throw
new
Error
(
`Storage
${
this
.
types
[
1
]}
func
: key must be register`
)
throw
new
Error
(
`Storage
${
this
.
types
[
1
]}
${
key
}
: key must be register`
)
}
}
else
{
return
this
.
getObjectKeyValue
(
DEFAULT_GET_STORAGEKEY
)
...
...
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