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'
...
@@ -12,7 +12,7 @@ import { setSystem_info } from '~/utils/cache/storageApi'
import
getUpdateManager
from
'./utils/lib/wxUpdateManager'
import
getUpdateManager
from
'./utils/lib/wxUpdateManager'
// 埋点
// 埋点
import
'./utils/track/Track'
//
import './utils/track/Track'
import
eventbus
from
'./utils/evenbus'
import
eventbus
from
'./utils/evenbus'
...
...
login/index/components/Box/Box.js
View file @
e13c521
// login/index/components/LoginBox.js
// login/index/components/LoginBox.js
import
USERAPI
from
'~/api/usersApi/index'
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
let
thisPage
Component
({
Component
({
options
:
{
options
:
{
...
@@ -175,17 +180,27 @@ Component({
...
@@ -175,17 +180,27 @@ 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
{
wx
.
$router
.
go
(
'login.accountItems'
)
USERAPI
.
selectAccountLogin
({
USERAPI
.
selectAccountLogin
({
id
:
loginUserInfoList
[
0
].
uuid
,
id
:
loginUserInfoList
[
0
].
uuid
,
sessionId
sessionId
}).
then
(
res
=>
{
}).
then
(
res
=>
{
console
.
log
(
res
)
setUserInfo
(
loginUserInfoList
[
0
]
)
setSessionId
(
sessionId
)
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
||
'系统异常'
)
...
...
login/index/index.js
View file @
e13c521
...
@@ -9,7 +9,6 @@ Page({
...
@@ -9,7 +9,6 @@ Page({
disabled
:
true
disabled
:
true
},
},
onRoute
(
options
){
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
\ 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
({
Page
({
/**
/**
...
@@ -26,23 +32,26 @@ Page({
...
@@ -26,23 +32,26 @@ Page({
*/
*/
onShow
()
{
onShow
()
{
wx
.
$api
.
showLoading
()
wx
.
$api
.
showLoading
()
const
{
const
sessionId
=
getSessionId
(),
sessionId
,
{
}
=
wx
.
$storage
.
get
(),
{
url
,
url
,
targetPath
=
url
?
decodeURIComponent
(
url
)
:
''
targetPath
=
decodeURIComponent
(
url
)
}
=
this
.
options
}
=
this
.
options
console
.
log
(
targetPath
)
wx
.
nextTick
(()
=>
{
wx
.
nextTick
(()
=>
{
if
(
sessionId
)
{
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
{
}
else
{
wx
.
$router
.
reLaunch
(
'login.index'
,
{
let
obj
=
{}
targetPath
if
(
targetPath
)
obj
.
targetPath
=
targetPath
}
)
wx
.
$router
.
reLaunch
(
'login.index'
,
obj
)
}
}
})
})
},
},
/**
/**
...
@@ -71,12 +80,5 @@ Page({
...
@@ -71,12 +80,5 @@ Page({
*/
*/
onReachBottom
()
{
onReachBottom
()
{
},
/**
* 用户点击右上角分享
*/
onShareAppMessage
()
{
}
}
})
})
\ No newline at end of file
\ No newline at end of file
project.private.config.json
View file @
e13c521
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
{
{
"name"
:
"携带目标页面"
,
"name"
:
"携带目标页面"
,
"pathName"
:
"login/loading/loading"
,
"pathName"
:
"login/loading/loading"
,
"query"
:
"url=
pages%2Ftab%2Findex%2Findex
%3Fid%3D123"
,
"query"
:
"url=
%2Fpages%2Ftab%2Foutput%2Foutput
%3Fid%3D123"
,
"launchMode"
:
"default"
,
"launchMode"
:
"default"
,
"scene"
:
null
"scene"
:
null
}
}
...
...
router/router.js
View file @
e13c521
...
@@ -20,6 +20,7 @@ class Router {
...
@@ -20,6 +20,7 @@ class Router {
wx
.
onAppRoute
(
e
=>
{
wx
.
onAppRoute
(
e
=>
{
let
thisPage
=
this
.
getPageInstance
()
let
thisPage
=
this
.
getPageInstance
()
if
(
thisPage
)
{
if
(
thisPage
)
{
thisPage
.
options
=
this
[
_query
]
this
.
setNavigationBarTitleText
(
thisPage
)
this
.
setNavigationBarTitleText
(
thisPage
)
let
onRoute
=
thisPage
.
onRoute
let
onRoute
=
thisPage
.
onRoute
typeof
onRoute
===
'function'
&&
onRoute
(
this
[
_query
])
typeof
onRoute
===
'function'
&&
onRoute
(
this
[
_query
])
...
...
utils/cache/storage.js
View file @
e13c521
...
@@ -52,17 +52,16 @@ class Storage {
...
@@ -52,17 +52,16 @@ class Storage {
*/
*/
get
=
(
key
,
syncFlag
=
true
)
=>
{
get
=
(
key
,
syncFlag
=
true
)
=>
{
// 有值默认取key值
// 有值默认取key值
// debugger
if
(
key
)
{
if
(
key
)
{
// 判断值是否是指定的对象值
// 判断值是否是指定的对象值
let
tmpKey
=
this
.
checkKeyType
(
key
,
1
)
let
tmpKey
=
this
.
checkKeyType
(
key
,
1
)
let
isObjectKey
=
STORAGE_OBJECTkEY
[
tmpKey
]
let
isObjectKey
=
STORAGE_OBJECTkEY
[
tmpKey
]
console
.
log
(
key
)
//
console.log(key)
console
.
log
(
isObjectKey
)
//
console.log(isObjectKey)
if
(
isObjectKey
)
{
if
(
isObjectKey
)
{
return
this
.
getObjectKeyValue
(
isObjectKey
)
return
this
.
getObjectKeyValue
(
isObjectKey
)
}
else
{
}
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
{
}
else
{
return
this
.
getObjectKeyValue
(
DEFAULT_GET_STORAGEKEY
)
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