Browse Source

use nodejs to request http to replace angularjs http library

MaysWind 3 years ago
parent
commit
709983e4d1

+ 2 - 0
app/scripts/controllers/settings-ariang.js

@@ -111,6 +111,8 @@
         $scope.checkUpdate = function () {
             return ariaNgVersionService.getTheLatestVersion()
                 .then(function onSuccess(response) {
+                    ariaNgLogService.debug('[AriaNgSettingsController.checkUpdate] latest version info', response);
+
                     if (!response || !response.data || !response.data.tag_name) {
                         ariaNgLogService.warn('[AriaNgSettingsController.checkUpdate] data format of latest version is invalid', response);
                         ariaNgLocalizationService.showError('Failed to get latest version!');

+ 2 - 2
app/scripts/services/ariaNgVersionService.js

@@ -1,11 +1,11 @@
 (function () {
     'use strict';
 
-    angular.module('ariaNg').factory('ariaNgVersionService', ['$http', function ($http) {
+    angular.module('ariaNg').factory('ariaNgVersionService', ['ariaNgNativeElectronService', function (ariaNgNativeElectronService) {
         var latestApi = 'https://api.github.com/repos/mayswind/AriaNg-Native/releases/latest';
 
         var getTheLatestVersion = function () {
-            return $http({
+            return ariaNgNativeElectronService.requestHttp({
                 url: latestApi,
                 method: 'GET',
                 headers: {