在获取模型朋友时,搜索已完成但不推荐使用。日志记录显示使用$ text查询。
日志记录:
[INFO] : ACS Request: { url: "friends/search.json", verb: "GET", data: {} })
[INFO] : GET: https://api.cloud.appcelerator.com/v1/friends/search.json?key=PVLeRMfhektJkgscd48vlk0M6WULJZNa&_session_id=k4cmGr1FIe5-Z79fJj_2JVeOEcg&suppress_response_codes=true&ti_analytics=%7B%22id%22%3A%225FBE6E68-C348-49B3-8630-D38994A8C512%22%2C%22mid%22%3A%22C08AF0DE-C973-4C06-8938-644BD78D1F6A%22%2C%22aguid%22%3A%22fa071e63-8155-40c2-9888-9d1a8d19620a%22%2C%22event%22%3A%22cloud.friends.search%22%2C%22deploytype%22%3A%22development%22%2C%22sid%22%3A%222390147D-4EBE-4EFC-A8F7-1F84E3389485%22%7D
[INFO] : header: {}
[INFO] : data: {}
[INFO] : Fetched collection: [object Object]
[ERROR] : 410: search.json has been deprecated. Please use $text query
[ERROR] : Cloud.Friends.query search.json has been deprecated. Please use $text query
Controller friends.js:
var Cloud = require('ti.cloud');
$.usrWindowButton.addEventListener('click', function () {
var collection = Alloy.createCollection("friends");
collection.fetch(); // GET: read
});
模型friends.js:
exports.definition = {
config : {
"adapter" : {
"type" : "acs",
"collection_name" : "friends"
} },
extendModel : function(Model) {
_.extend(Model.prototype, {
});
return Model;
},
extendCollection : function(Collection) {
_.extend(Collection.prototype, {
});
return Collection;
}
,};
如何强制它发出friends/query.json
ACS请求而不是friends/search.json
?
请有人帮帮我,非常感谢。
更新的tiSDK,合金,ti.cloud模块仍然存在同样的问题。
Operating System
Name = Mac OS X
Version = 10.11
Architecture = 64bit
# CPUs = 4
Memory = 4294967296
Node.js
Node.js Version = 4.0.0
npm Version = 2.14.2
Titanium CLI
CLI Version = 5.0.9
Titanium SDK
SDK Version = 5.5.1.GA
SDK Path = /Users/michielvanschilt/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA
Target Platform = iphone
Command
/usr/local/bin/node /Users/michielvanschilt/.appcelerator/install/5.5.1/package/node_modules/titanium/lib/titanium.js build run --platform ios --log-level trace --sdk 5.5.1.GA --project-dir /Users/michielvanschilt/RTF2016/RTF --target simulator --ios-version 9.3 --device-family iphone --deploy-type development --sim-type iphone --sim-version 9.3 --device-id 52E0E31B-0701-48F4-B5DE-CDA86FBE951F --skip-js-minify --no-colors --no-progress-bars --no-prompt --prompt-type socket-bundle --prompt-port 63974 --config-file /var/folders/bn/9d8d9vyj2bb7l74fhdr6hs3h0000gn/T/build-1480602293433.json --no-banner --project-dir /Users/michielvanschilt/RTF2016/RTF
[INFO] : Found Titanium module id=ti.cloud version=3.2.9 platform=commonjs deploy-type=development path=/Users/michielvanschilt/Library/Application Support/Titanium/modules/commonjs/ti.cloud/3.2.9
[INFO] : Found better matching module id=ti.cloud version=latest platform=commonjs deploy-type=development path=/Users/michielvanschilt/Library/Application Support/Titanium/modules/commonjs/ti.cloud/3.2.11