|
@@ -143,12 +143,21 @@ class Wechat
|
|
|
}
|
|
|
|
|
|
if (is_array($value) || (is_string($value) && strstr($value, 'http://'))) {
|
|
|
- if ($refresh) {
|
|
|
- $result = $this->curl(false, $value, false, $type);
|
|
|
- } else {
|
|
|
- $result = $this->curl(false, $value, true, $type);
|
|
|
+
|
|
|
+
|
|
|
+ $result = array();
|
|
|
+ if ($type == 'token' && isset($this->project['url']) && $this->project['url']) {
|
|
|
+ $param = array('type' => $type, 'appid' => $this->project['appid']);
|
|
|
+ $param = Dever::token($param, $this->project['secret']);
|
|
|
+ $result = Dever::curl($this->project['url'], $param);
|
|
|
+ }
|
|
|
+ if (!$result) {
|
|
|
+ if ($refresh) {
|
|
|
+ $result = $this->curl(false, $value, false, $type);
|
|
|
+ } else {
|
|
|
+ $result = $this->curl(false, $value, true, $type);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
|
|
|
$key = $type;
|
|
|
if ($result && isset($result[$key])) {
|