|
@@ -125,7 +125,16 @@ class Wechat
|
|
|
|
|
|
$where['option_project_id'] = $this->project['id'];
|
|
|
$info = $db->one($where);
|
|
|
-
|
|
|
+
|
|
|
+ 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']);
|
|
|
+ $service = Dever::curl($this->project['url'], $param);
|
|
|
+ $service = Dever::json_decode($result);
|
|
|
+ if (isset($service['data']) && $service['data']) {
|
|
|
+ return $service['data'];
|
|
|
+ }
|
|
|
+ }
|
|
|
$update = false;
|
|
|
|
|
|
if ($state == true) {
|
|
@@ -144,23 +153,10 @@ class Wechat
|
|
|
|
|
|
if (is_array($value) || (is_string($value) && strstr($value, 'http://'))) {
|
|
|
|
|
|
-
|
|
|
- $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);
|
|
|
- $result = Dever::json_decode($result);
|
|
|
- if (isset($result['data'])) {
|
|
|
- $result = $result['data'];
|
|
|
- }
|
|
|
- }
|
|
|
- if (!$result) {
|
|
|
- if ($refresh) {
|
|
|
- $result = $this->curl(false, $value, false, $type);
|
|
|
- } else {
|
|
|
- $result = $this->curl(false, $value, true, $type);
|
|
|
- }
|
|
|
+ if ($refresh) {
|
|
|
+ $result = $this->curl(false, $value, false, $type);
|
|
|
+ } else {
|
|
|
+ $result = $this->curl(false, $value, true, $type);
|
|
|
}
|
|
|
|
|
|
$key = $type;
|