create_postdata($data); $loginurl = 'http://123.206.51.139/k3cloud/' . 'Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc'; // $loginurl = 'http://192.168.0.135/k3cloud/' . 'Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc'; $loginResult = $K3Curl -> MyCurlPost($loginurl, $post_content, $cookie_jar, TRUE); return $loginResult; } public function create_postdata($args){ $postdata = array( 'format' => 1, 'useragent' => 'ApiClient', 'rid' => self::create_guid(), 'parameters' => $args, 'timestamp' => time(), 'v' => '1.0' ); return json_encode($postdata); } public static function create_guid() { $charid = strtoupper(md5(uniqid(mt_rand(), true))); $hyphen = chr(45);// "-" $uuid = chr(123)// "{" . substr($charid, 0, 8) . $hyphen . substr($charid, 8, 4) . $hyphen . substr($charid, 12, 4) . $hyphen . substr($charid, 16, 4) . $hyphen . substr($charid, 20, 12) . chr(125);// "}" return $uuid; } }