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
99291d7d
Commit
99291d7d
authored
Mar 18, 2020
by
李嘉林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序添加线下门店请求头
parent
e0fec4dc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
6 deletions
+19
-6
src/pages/lived/index.vue
+2
-0
src/store/mutations.js
+6
-1
src/store/state.js
+3
-1
src/utils/request.js
+8
-4
No files found.
src/pages/lived/index.vue
View file @
99291d7d
...
@@ -95,6 +95,8 @@ export default {
...
@@ -95,6 +95,8 @@ export default {
}
}
});
});
let
params
=
JSON
.
parse
(
options
.
params
);
let
params
=
JSON
.
parse
(
options
.
params
);
console
.
log
(
params
.
offlineShopCode
,
'-----------------98'
);
this
.
$store
.
commit
(
"setOfflineShopCode"
,
params
.
offlineShopCode
);
this
.
liveId
=
params
.
liveId
;
this
.
liveId
=
params
.
liveId
;
this
.
shopName
=
params
.
shopName
;
this
.
shopName
=
params
.
shopName
;
this
.
shopLogo
=
DFSImg
(
params
.
shopLogo
,
40
,
40
);
this
.
shopLogo
=
DFSImg
(
params
.
shopLogo
,
40
,
40
);
...
...
src/store/mutations.js
View file @
99291d7d
...
@@ -6,6 +6,10 @@ const mutations = {
...
@@ -6,6 +6,10 @@ const mutations = {
},
},
setSubscribeMessageObj
(
state
,
subscribeMessageObj
)
{
setSubscribeMessageObj
(
state
,
subscribeMessageObj
)
{
state
.
subscribeMessageObj
=
subscribeMessageObj
;
state
.
subscribeMessageObj
=
subscribeMessageObj
;
}
},
setOfflineShopCode
(
state
,
code
)
{
state
.
offlineShopCode
=
code
;
},
};
};
export
default
mutations
export
default
mutations
\ No newline at end of file
src/store/state.js
View file @
99291d7d
...
@@ -2,6 +2,7 @@ const state = {
...
@@ -2,6 +2,7 @@ const state = {
spokesmanGroupId
:
""
,
spokesmanGroupId
:
""
,
spokesmanShopId
:
""
,
spokesmanShopId
:
""
,
spokesmanRelId
:
""
,
spokesmanRelId
:
""
,
subscribeMessageObj
:
{}
subscribeMessageObj
:
{},
offlineShopCode
:
""
,
};
};
export
default
state
export
default
state
\ No newline at end of file
src/utils/request.js
View file @
99291d7d
let
shopMixid
=
process
.
env
.
SHOP_MIXID
;
import
store
from
'../store/index'
let
shopMixid
=
process
.
env
.
SHOP_MIXID
;
// wx.getStore
// wx.getStore
export
async
function
requestGET
(
url
,
options
)
{
export
async
function
requestGET
(
url
,
options
)
{
...
@@ -8,7 +9,8 @@ export async function requestGET(url, options) {
...
@@ -8,7 +9,8 @@ export async function requestGET(url, options) {
data
:
options
,
data
:
options
,
method
:
"GET"
,
method
:
"GET"
,
header
:
{
header
:
{
"Shop-Mixid"
:
shopMixid
"Shop-Mixid"
:
shopMixid
,
"Offline-Shop-Code"
:
store
.
state
.
offlineShopCode
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
resolve
(
res
)
resolve
(
res
)
...
@@ -28,7 +30,8 @@ export async function requestPOST(url, options) {
...
@@ -28,7 +30,8 @@ export async function requestPOST(url, options) {
method
:
"POST"
,
method
:
"POST"
,
header
:
{
header
:
{
"Shop-Mixid"
:
shopMixid
,
"Shop-Mixid"
:
shopMixid
,
"Authorization"
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
"Authorization"
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
,
"Offline-Shop-Code"
:
store
.
state
.
offlineShopCode
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
resolve
(
res
)
resolve
(
res
)
...
@@ -49,7 +52,8 @@ export function requestPOST1(url, options) {
...
@@ -49,7 +52,8 @@ export function requestPOST1(url, options) {
header
:
{
header
:
{
"Content-Type"
:
"application/x-www-form-urlencoded"
,
"Content-Type"
:
"application/x-www-form-urlencoded"
,
"Shop-Mixid"
:
shopMixid
,
"Shop-Mixid"
:
shopMixid
,
Authorization
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
Authorization
:
wx
.
getStorageSync
(
'sessionid'
)
||
""
,
"Offline-Shop-Code"
:
store
.
state
.
offlineShopCode
},
},
success
:
function
(
res
)
{
success
:
function
(
res
)
{
resolve
(
res
)
resolve
(
res
)
...
...
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