|
@@ -67,16 +67,17 @@ class Common
|
|
|
$result = array();
|
|
|
if (strpos($info['partition'], '.')) {
|
|
|
$temp = explode('.', $info['partition']);
|
|
|
- $result = array($temp[0] => $value);
|
|
|
+ $result = $this->partition($result, $temp[0], $info['system_key'], $value);
|
|
|
if ($module && isset($info['data_id']) && $info['data_id']) {
|
|
|
if ($temp[0] == $temp[1]) {
|
|
|
- $result[$temp[0]] .= '/' . $info['module_id'] . '_' . $info['data_id'];
|
|
|
+ $value .= '/' . $info['module_id'] . '_' . $info['data_id'];
|
|
|
+ $result = $this->partition($result, $temp[0], $info['system_key'], $value);
|
|
|
} else {
|
|
|
- $result[$temp[1]] = $info['module_id'] . '_' . $info['data_id'];
|
|
|
+ $result = $this->partition($result, $temp[1], $info['system_key'], $info['module_id'] . '_' . $info['data_id']);
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- $result = array($info['partition'] => $value);
|
|
|
+ $result = $this->partition($result, $info['partition'], $info['system_key'], $value);
|
|
|
}
|
|
|
if ($field) {
|
|
|
$result['field'] = Dever::call($field);
|
|
@@ -86,6 +87,27 @@ class Common
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private function partition(&$result, $type, $key, $value)
|
|
|
+ {
|
|
|
+ if ($type == 'field') {
|
|
|
+ $result[$type] = array
|
|
|
+ (
|
|
|
+ 'type' => 'key',
|
|
|
+ 'field' => $key,
|
|
|
+ 'value' => $value,
|
|
|
+ );
|
|
|
+ } elseif ($type == 'where') {
|
|
|
+ $result[$type] = array
|
|
|
+ (
|
|
|
+ $key => $value
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ $result[$type] = $value;
|
|
|
+ }
|
|
|
+ return $result;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public function getToken()
|
|
|
{
|
|
@@ -97,16 +119,17 @@ class Common
|
|
|
}
|
|
|
|
|
|
|
|
|
- public function setAuth($partition, $system_id, $info_id, $module_id, $data_id)
|
|
|
+ public function setAuth($partition, $system_key, $system_id, $info_id, $module_id, $data_id)
|
|
|
{
|
|
|
- $token = Dever::load('common', 'manage')->token(-1, '', $partition, $system_id, $info_id, $module_id, $data_id);
|
|
|
+ $token = Dever::load('common', 'manage')->token(-1, '', $partition, $system_key, $system_id, $info_id, $module_id, $data_id);
|
|
|
\Dever\Route::$data['authorization'] = Secure::encode($token['token']);
|
|
|
}
|
|
|
|
|
|
|
|
|
- public function token($uid, $mobile, $partition, $system_id, $info_id, $module_id, $data_id)
|
|
|
+ public function token($uid, $mobile, $partition, $system_key, $system_id, $info_id, $module_id, $data_id)
|
|
|
{
|
|
|
$extend['partition'] = $partition;
|
|
|
+ $extend['system_key'] = $system_key;
|
|
|
$extend['system_id'] = $system_id;
|
|
|
$extend['info_id'] = $info_id;
|
|
|
$extend['module_id'] = $module_id;
|