Skip to content

Commit dd53fae

Browse files
author
hogus
committed
fix 百度小程序session接口增加请求头
1 parent 4ae88b5 commit dd53fae

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Providers/BaiDuProvider.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ public function jscode2session(string $code)
2121
'code' => $code,
2222
];
2323

24-
return $this->httpPost('https://spapi.baidu.com/oauth/jscode2sessionkey', $params);
24+
return $this->httpPost(
25+
'https://spapi.baidu.com/oauth/jscode2sessionkey',
26+
$params,
27+
[
28+
'content-type' => 'application/x-www-form-urlencoded'
29+
]
30+
);
2531
}
2632

2733
/**

0 commit comments

Comments
 (0)