Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-micro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
without authentication
meibuyu-micro
Commits
da3c6843
Commit
da3c6843
authored
Feb 21, 2022
by
王源
🎧
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
编写shopify对非私人应用的token值处理
parent
d61484cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
4 deletions
+13
-4
AbstractShopify.php
src/Shopify/lib/AbstractShopify.php
+13
-4
No files found.
src/Shopify/lib/AbstractShopify.php
View file @
da3c6843
...
@@ -64,10 +64,19 @@ abstract class AbstractShopify
...
@@ -64,10 +64,19 @@ abstract class AbstractShopify
$this
->
pluralizeKey
=
$this
->
pluralizeKey
?:
$this
->
resourceKey
.
's'
;
$this
->
pluralizeKey
=
$this
->
pluralizeKey
?:
$this
->
resourceKey
.
's'
;
$this
->
resourceUrl
=
(
$parentResourceUrl
?
"
$parentResourceUrl
/"
:
$config
[
'api_url'
])
.
$this
->
pluralizeKey
.
(
$this
->
id
?
"/
{
$this
->
id
}
"
:
''
);
$this
->
resourceUrl
=
(
$parentResourceUrl
?
"
$parentResourceUrl
/"
:
$config
[
'api_url'
])
.
$this
->
pluralizeKey
.
(
$this
->
id
?
"/
{
$this
->
id
}
"
:
''
);
$this
->
httpRequestJson
=
make
(
CurlHttpRequestJson
::
class
);
$this
->
httpRequestJson
=
make
(
CurlHttpRequestJson
::
class
);
if
(
isset
(
$config
[
'api_password'
]))
{
if
(
isset
(
$config
[
'is_private_app'
])
&&
$config
[
'is_private_app'
]
==
false
)
{
$this
->
httpHeaders
[
'X-Shopify-Access-Token'
]
=
$config
[
'api_password'
];
// 如果不是私人应用,则使用访问令牌
}
elseif
(
!
isset
(
$config
[
'api_password'
]))
{
if
(
isset
(
$config
[
'access_token'
]))
{
throw
new
Exception
(
"请设置api_password值"
);
$this
->
httpHeaders
[
'X-Shopify-Access-Token'
]
=
$config
[
'access_token'
];
}
elseif
(
!
isset
(
$config
[
'access_token'
]))
{
throw
new
Exception
(
"请设置access_token值"
);
}
}
else
{
if
(
isset
(
$config
[
'api_password'
]))
{
$this
->
httpHeaders
[
'X-Shopify-Access-Token'
]
=
$config
[
'api_password'
];
}
elseif
(
!
isset
(
$config
[
'api_password'
]))
{
throw
new
Exception
(
"请设置api_password值"
);
}
}
}
}
}
...
...
王源
🎧
@wangyuan
mentioned in commit
442a5616
·
Feb 21, 2022
mentioned in commit
442a5616
mentioned in commit 442a5616ccebe48dbf9b8bcf3e7e1808b0359d9e
Toggle commit list
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