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
cff7e169
Commit
cff7e169
authored
Jun 11, 2024
by
侯体倬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
store 数据丢失后获取缓存
parent
0089c776
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
src/App.vue
+1
-0
src/utils/request.js
+3
-3
No files found.
src/App.vue
View file @
cff7e169
...
@@ -47,6 +47,7 @@ export default {
...
@@ -47,6 +47,7 @@ export default {
this
.
extConfig
=
shopItem
[
process
.
env
.
NODE_ENV
];
this
.
extConfig
=
shopItem
[
process
.
env
.
NODE_ENV
];
}
}
wx
.
setStorageSync
(
"extConfig"
,
JSON
.
stringify
(
this
.
extConfig
));
wx
.
setStorageSync
(
"extConfig"
,
JSON
.
stringify
(
this
.
extConfig
));
wx
.
setStorageSync
(
"mixid"
,
this
.
extConfig
.
mixid
);
console
.
log
(
"extConfig->"
,
this
.
extConfig
);
console
.
log
(
"extConfig->"
,
this
.
extConfig
);
...
...
src/utils/request.js
View file @
cff7e169
...
@@ -12,7 +12,7 @@ export async function requestGET(url, options) {
...
@@ -12,7 +12,7 @@ export async function requestGET(url, options) {
data
:
options
,
data
:
options
,
method
:
"GET"
,
method
:
"GET"
,
header
:
{
header
:
{
"Shop-Mixid"
:
store
.
state
.
mixid
,
"Shop-Mixid"
:
store
.
state
.
mixid
||
wx
.
getStorageSync
(
'mixid'
)
,
"Offline-Shop-Code"
:
wx
.
getStorageSync
(
'offlineShopCode'
)
||
""
,
"Offline-Shop-Code"
:
wx
.
getStorageSync
(
'offlineShopCode'
)
||
""
,
"Authorization"
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
,
"Authorization"
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
,
"Region-id"
:
wx
.
getStorageSync
(
'location'
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
'location'
)).
systemRegionId
:
''
,
"Region-id"
:
wx
.
getStorageSync
(
'location'
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
'location'
)).
systemRegionId
:
''
,
...
@@ -36,7 +36,7 @@ export async function requestPOST(url, options) {
...
@@ -36,7 +36,7 @@ export async function requestPOST(url, options) {
data
:
options
,
data
:
options
,
method
:
"POST"
,
method
:
"POST"
,
header
:
{
header
:
{
"Shop-Mixid"
:
store
.
state
.
mixid
,
"Shop-Mixid"
:
store
.
state
.
mixid
||
wx
.
getStorageSync
(
'mixid'
)
,
"Authorization"
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
,
"Authorization"
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
,
"Offline-Shop-Code"
:
wx
.
getStorageSync
(
'offlineShopCode'
)
||
""
,
"Offline-Shop-Code"
:
wx
.
getStorageSync
(
'offlineShopCode'
)
||
""
,
"openId"
:
wx
.
getStorageSync
(
"openid"
)
||
''
,
"openId"
:
wx
.
getStorageSync
(
"openid"
)
||
''
,
...
@@ -62,7 +62,7 @@ export function requestPOST1(url, options) {
...
@@ -62,7 +62,7 @@ export function requestPOST1(url, options) {
method
:
"POST"
,
method
:
"POST"
,
header
:
{
header
:
{
"Content-Type"
:
"application/x-www-form-urlencoded"
,
"Content-Type"
:
"application/x-www-form-urlencoded"
,
"Shop-Mixid"
:
store
.
state
.
mixid
,
"Shop-Mixid"
:
store
.
state
.
mixid
||
wx
.
getStorageSync
(
'mixid'
)
,
Authorization
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
,
Authorization
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
,
"Offline-Shop-Code"
:
wx
.
getStorageSync
(
'offlineShopCode'
)
||
""
,
"Offline-Shop-Code"
:
wx
.
getStorageSync
(
'offlineShopCode'
)
||
""
,
"Region-id"
:
wx
.
getStorageSync
(
'location'
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
'location'
)).
systemRegionId
:
''
,
"Region-id"
:
wx
.
getStorageSync
(
'location'
)
?
JSON
.
parse
(
wx
.
getStorageSync
(
'location'
)).
systemRegionId
:
''
,
...
...
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