Skip to content

Commit cb03e56

Browse files
committed
修改TEXT 为text
1 parent 94300cd commit cb03e56

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

‎lib/common/dao/IssueDao.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ class IssueDao {
200200
static lockIssueDao(userName, repository, number, locked) async {
201201
String url = Address.lockIssue(userName, repository, number);
202202
var res = await HttpManager.netFetch(
203-
url, null, {"Accept": 'application/vnd.github.VERSION.full+json'}, new Options(method: locked ? "DELETE" : 'PUT', contentType: ContentType.TEXT),
203+
url, null, {"Accept": 'application/vnd.github.VERSION.full+json'}, new Options(method: locked ? "DELETE" : 'PUT', contentType: ContentType.text),
204204
noTip: true);
205205
if (res != null && res.result) {
206206
return new DataResult(res.data, true);

‎lib/common/dao/ReposDao.dart‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ class ReposDao {
162162
static getRepositoryStatusDao(userName, reposName) async {
163163
String urls = Address.resolveStarRepos(userName, reposName);
164164
String urlw = Address.resolveWatcherRepos(userName, reposName);
165-
var resS = await HttpManager.netFetch(urls, null, null, new Options(contentType: ContentType.TEXT), noTip: true);
166-
var resW = await HttpManager.netFetch(urlw, null, null, new Options(contentType: ContentType.TEXT), noTip: true);
165+
var resS = await HttpManager.netFetch(urls, null, null, new Options(contentType: ContentType.text), noTip: true);
166+
var resW = await HttpManager.netFetch(urlw, null, null, new Options(contentType: ContentType.text), noTip: true);
167167
var data = {"star": resS.result, "watch": resW.result};
168168
return new DataResult(data, true);
169169
}
@@ -252,7 +252,7 @@ class ReposDao {
252252
*/
253253
static Future<DataResult> doRepositoryStarDao(userName, reposName, star) async {
254254
String url = Address.resolveStarRepos(userName, reposName);
255-
var res = await HttpManager.netFetch(url, null, null, new Options(method: !star ? 'PUT' : 'DELETE', contentType: ContentType.TEXT));
255+
var res = await HttpManager.netFetch(url, null, null, new Options(method: !star ? 'PUT' : 'DELETE', contentType: ContentType.text));
256256
return Future<DataResult>(() {
257257
return new DataResult(null, res.result);
258258
});
@@ -263,7 +263,7 @@ class ReposDao {
263263
*/
264264
static doRepositoryWatchDao(userName, reposName, watch) async {
265265
String url = Address.resolveWatcherRepos(userName, reposName);
266-
var res = await HttpManager.netFetch(url, null, null, new Options(method: !watch ? 'PUT' : 'DELETE', contentType: ContentType.TEXT));
266+
var res = await HttpManager.netFetch(url, null, null, new Options(method: !watch ? 'PUT' : 'DELETE', contentType: ContentType.text));
267267
return new DataResult(null, res.result);
268268
}
269269

@@ -464,7 +464,7 @@ class ReposDao {
464464
*/
465465
static createForkDao(userName, reposName) async {
466466
String url = Address.createFork(userName, reposName);
467-
var res = await HttpManager.netFetch(url, null, null, new Options(method: "POST", contentType: ContentType.TEXT));
467+
var res = await HttpManager.netFetch(url, null, null, new Options(method: "POST", contentType: ContentType.text));
468468
return new DataResult(null, res.result);
469469
}
470470

@@ -516,8 +516,8 @@ class ReposDao {
516516

517517
next() async {
518518
String url = Address.readmeFile(userName + '/' + reposName, branch);
519-
var res = await HttpManager.netFetch(url, null, {"Accept": 'application/vnd.github.VERSION.raw'}, new Options(contentType: ContentType.TEXT));
520-
//var res = await HttpManager.netFetch(url, null, {"Accept": 'application/vnd.github.html'}, new Options(contentType: ContentType.TEXT));
519+
var res = await HttpManager.netFetch(url, null, {"Accept": 'application/vnd.github.VERSION.raw'}, new Options(contentType: ContentType.text));
520+
//var res = await HttpManager.netFetch(url, null, {"Accept": 'application/vnd.github.html'}, new Options(contentType: ContentType.text));
521521
if (res != null && res.result) {
522522
if (needDb) {
523523
provider.insert(fullName, branch, res.data);

‎lib/common/dao/UserDao.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ class UserDao {
267267
*/
268268
static setAllNotificationAsReadDao() async {
269269
String url = Address.setAllNotificationAsRead();
270-
var res = await HttpManager.netFetch(url, null, null, new Options(method: "PUT", contentType: ContentType.TEXT));
270+
var res = await HttpManager.netFetch(url, null, null, new Options(method: "PUT", contentType: ContentType.text));
271271
return new DataResult(res.data, res.result);
272272
}
273273

@@ -276,7 +276,7 @@ class UserDao {
276276
*/
277277
static checkFollowDao(name) async {
278278
String url = Address.doFollow(name);
279-
var res = await HttpManager.netFetch(url, null, null, new Options(contentType: ContentType.TEXT), noTip: true);
279+
var res = await HttpManager.netFetch(url, null, null, new Options(contentType: ContentType.text), noTip: true);
280280
return new DataResult(res.data, res.result);
281281
}
282282

‎lib/common/net/trending/GithubTrending.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import 'package:gsy_github_app_flutter/common/net/ResultData.dart';
1313
*/
1414
class GitHubTrending {
1515
fetchTrending(url) async {
16-
var res = await HttpManager.netFetch(url, null, null, new Options(contentType: ContentType.TEXT));
16+
var res = await HttpManager.netFetch(url, null, null, new Options(contentType: ContentType.text));
1717
if (res != null && res.result && res.data != null) {
1818
return new ResultData(TrendingUtil.htmlToRepo(res.data), true, Code.SUCCESS);
1919
} else {

0 commit comments

Comments
 (0)