Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
82b53bc3
Commit
82b53bc3
authored
Jun 05, 2024
by
侯体倬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
store 数据丢失后获取缓存
parent
3b8fcf1e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
src/App.vue
+1
-0
src/utils/request.js
+4
-2
No files found.
src/App.vue
View file @
82b53bc3
...
...
@@ -50,6 +50,7 @@ export default {
this
.
extConfig
=
shopItem
[
process
.
env
.
NODE_ENV
];
}
wx
.
setStorageSync
(
"extConfig"
,
JSON
.
stringify
(
this
.
extConfig
));
wx
.
setStorageSync
(
"mixid"
,
this
.
extConfig
.
mixid
);
// 行为收集初始化
this
.
$mpBehavior
.
init
(
"mayi-moblie-shop-mp"
,
this
.
extConfig
.
shopid
,
{
...
...
src/utils/request.js
View file @
82b53bc3
...
...
@@ -2,9 +2,11 @@ import store from '../store/index'
// 获取请求头
const
getRequestHeader
=
(
extraHeader
=
{})
=>
{
const
mixid
=
store
.
state
.
mixid
||
wx
.
getStorageSync
(
'mixid'
);
// 共用请求头
const
BASE_HEADER
=
{
"Shop-Mixid"
:
store
.
state
.
mixid
,
"Shop-Mixid"
:
mixid
,
"Authorization"
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
,
"Offline-Shop-Code"
:
wx
.
getStorageSync
(
'offlineShopCode'
)
||
""
,
"Area-Id"
:
wx
.
getStorageSync
(
'location'
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
'location'
)).
id
:
''
,
...
...
@@ -12,7 +14,7 @@ const getRequestHeader = (extraHeader = {}) => {
}
// 判断是否存在导购员 id
const
setGuideEmployeeId
=
wx
.
getStorageSync
(
store
.
state
.
mixid
+
'setGuideEmployeeId'
);
const
setGuideEmployeeId
=
wx
.
getStorageSync
(
mixid
+
'setGuideEmployeeId'
);
if
(
setGuideEmployeeId
)
{
BASE_HEADER
[
'Guide-Employee-Id'
]
=
setGuideEmployeeId
;
}
...
...
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