我正在尝试配置JWT Token Authentification of Boostnote,以便直接将我的笔记发布到Wordpress 。
我关注了these instructions,但进入USAGE部分后,我迷路了... 我已经修改了 wp-config.php 文件,并且具有名称空间和端点 / wp-json / jwt-auth / v1 / token {/ validate} 。。 >
但是我如何获得令牌,然后再填写Boostnote? 我应该使用该功能做什么?
( function() {
var app = angular.module( 'jwtAuth', [] );
app.controller( 'MainController', function( $scope, $http ) {
var apiHost = 'http://yourdomain.com/wp-json';
$http.post( apiHost + '/jwt-auth/v1/token', {
username: 'admin',
password: 'password'
} )
.then( function( response ) {
console.log( response.data )
} )
.catch( function( error ) {
console.error( 'Error', error.data[0] );
} );
} );
} )();
谢谢!