mirror of
https://github.com/arnaucube/blockchainIDsystem.git
synced 2026-02-07 02:56:43 +01:00
fixed id.pubK in client, add to blockchain
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
<div ng-click="clientApp('blindandsendtosign', id.pubK)" ng-show="!id.unblindedsig" class="btn btn-raised btn-sm c_o_cyan300">
|
<div ng-click="clientApp('blindandsendtosign', id.pubK)" ng-show="!id.unblindedsig" class="btn btn-raised btn-sm c_o_cyan300">
|
||||||
Send to serverIDsigner
|
Send to serverIDsigner
|
||||||
</div>
|
</div>
|
||||||
<div ng-click="clientApp('addtoblockchain', id.pubK)" ng-show="id.unblindedsig && !id.blockchainref" class="btn btn-raised btn-sm c_o_deepPurple300">
|
<div ng-click="addToBlockchain(id.pubK)" ng-show="id.unblindedsig && !id.blockchainref" class="btn btn-raised btn-sm c_o_deepPurple300">
|
||||||
<i title="" class="fa fa-chain"></i> Add to blockchain
|
<i title="" class="fa fa-chain"></i> Add to blockchain
|
||||||
</div>
|
</div>
|
||||||
<a ng-href="#!/id/{{id.pubK}}" ng-show="id.blockchainref" class="btn btn-raised btn-sm c_o_green300">
|
<a ng-href="#!/id/{{id.pubK}}" ng-show="id.blockchainref" class="btn btn-raised btn-sm c_o_green300">
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ angular.module('app.main', ['ngRoute'])
|
|||||||
});
|
});
|
||||||
}])
|
}])
|
||||||
|
|
||||||
.controller('MainCtrl', function($scope, $rootScope, $http) {
|
.controller('MainCtrl', function($scope, $rootScope, $http, toastr) {
|
||||||
|
|
||||||
$rootScope.server = JSON.parse(localStorage.getItem("old_darkID_server"));
|
$rootScope.server = JSON.parse(localStorage.getItem("old_darkID_server"));
|
||||||
|
|
||||||
@@ -72,4 +72,21 @@ angular.module('app.main', ['ngRoute'])
|
|||||||
console.log('data error');
|
console.log('data error');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
$scope.addToBlockchain = function(id) {
|
||||||
|
$http({
|
||||||
|
url: 'http://127.0.0.1:3002/register',
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": undefined
|
||||||
|
},
|
||||||
|
data: {address: id}
|
||||||
|
})
|
||||||
|
.then(function(data) {
|
||||||
|
//$scope.ids = data.data;
|
||||||
|
toastr.success("added to blockchain");
|
||||||
|
},
|
||||||
|
function(data) {
|
||||||
|
console.log(data);
|
||||||
|
});
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
curl -X POST -F address="thisisasampleaddress" http://127.0.0.1:3002/register
|
curl -X POST http://127.0.0.1:3002/register -d '{\"address\": \"sampleaddress\"}'
|
||||||
|
|||||||
Reference in New Issue
Block a user