我想获得一个dot net core 2.0 web api的令牌.
这就是我在做的事情:
C:\Users\danyb>curl -X POST -H 'Content-Type:application/json'^
Mehr? -d '{\"username\":\"mario\",\"password\":\"secret\"}'^
Mehr? localhost:56183/api/token
[1/2]: '"username":"mario"'localhost:56183/api/token --> <stdout>
--_curl_--'"username":"mario"'localhost:56183/api/token
curl: (3) Port number ended with '"'
[2/2]: '"password":"secret"'localhost:56183/api/token --> <stdout>
--_curl_--'"password":"secret"'localhost:56183/api/token
curl: (3) Port number ended with '"'
Run Code Online (Sandbox Code Playgroud)
我已经在网上搜索过但找不到合适的解决方案.
TokenController类:
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.IdentityModel.Tokens;
using System;
using System.IdentityModel.Tokens.Jwt;
using System.Security.Claims;
using System.Text;
namespace JWT.Controllers
{
[Route("api/[controller]")]
public class TokenController : Controller
{
private IConfiguration _config;
public TokenController(IConfiguration config)
{
_config = config;
} …Run Code Online (Sandbox Code Playgroud) 我想通过 Zapier 进行 api 调用以在 Slack 中打开 Modal。
\n但我总是收到错误:
\nok: false\nerror: invalid_json\nwarning: missing_charset\nresponse_metadata:\nwarnings:\n1: missing_charset\nRun Code Online (Sandbox Code Playgroud)\n这是我的请求正文:
\n{\n"token":"XXXXXXXXX",\n"trigger_id":"XXXXXXXXXX",\n"dialog": {\n "callback_id": "projekt-verantwortliche",\n "title": "Projektverantwortliche ausw\xc3\xa4hlen",\n "submit_label": "Request",\n "state": "Limo",\n "elements": [\n {\n "type": "users_select",\n "action_id": "projekt-projektleiter",\n "placeholder": {\n "type":"plain_text",\n "text":"Projektleiter ausw\xc3\xa4hlen"\n },\n },\n {\n "type": "users_select",\n "action_id":"projekt-berater",\n "placeholder": {\n "type":"plain_text",\n "text":"Berater ausw\xc3\xa4hlen"\n }\n }\n ]\n}\n}\nRun Code Online (Sandbox Code Playgroud)\n我究竟做错了什么?
\n\n我有一个带有REST API的回送应用程序。
我想制作一个REST API Enpoint / Email / sendEmail来发送电子邮件。我完成了本教程:https : //loopback.io/doc/en/lb3/Email-connector.html,但是它对我不起作用。
当我打开https:// localhost:3000 / explorer时,我可以看到API端点,并且可以按下按钮“尝试一下”。但是然后它会永久加载,过一会儿我在控制台中收到超时错误。
文件:datasource.json
{
"db": {
"host": "localhost",
"port": 27017,
"url": "",
"database": "siemens",
"password": "",
"name": "db",
"user": "",
"useNewUrlParser": true,
"connector": "mongodb"
},
"email": {
"name": "email",
"connector": "mail",
"transports": [{
"type": "SMTP",
"host": "smtp.gmail.com",
"secure": true,
"port": 465,
"auth": {
"user": "xbit.dany@gmail.com",
"pass": "XXX"
}
}]
}
}
Run Code Online (Sandbox Code Playgroud)
文件:model-config.json
"Email": {
"dataSource": "email",
"public": true
}
Run Code Online (Sandbox Code Playgroud)
文件:email.js
module.exports = function(Email) …Run Code Online (Sandbox Code Playgroud) 我正在做这个教程:https://hyperledger.github.io/composer/latest/installing/development-tools
现在我想启动超级账本结构,./startFabric.sh但随后出现此错误:
dany@DESKTOP-IQB2P0B:~/fabric-dev-servers$ ./startFabric.sh
Development only script for Hyperledger Fabric control
Running 'startFabric.sh'
FABRIC_VERSION is set to 'hlfv12'
FABRIC_START_TIMEOUT is unset, assuming 15 (seconds)
Removing network composer_default
WARNING: Network composer_default not found.
Creating network "composer_default" with the default driver
ERROR: Failed to Setup IP tables: Unable to enable NAT rule: (iptables failed: iptables --wait -t nat -I POSTROUTING -s 172.22.0.0/16 ! -o br-b49f324730b7 -j MASQUERADE: iptables: No chain/target/match by that name.
(exit status 1))
Run Code Online (Sandbox Code Playgroud)
docker docker-compose hyperledger hyperledger-fabric hyperledger-composer
我有个问题。我正在使用 Angular 2。我在 html 中有一个下拉选择,在 TS 文件中有一个变量“selectedVariable”。我想在选择选项时更改 TS 文件中的变量。
例如:当某人选择:“SCRYPT”时,变量“selectedAlgorithm”将更新为值“SCRYPT”。
我是一个角度初学者,谢谢您的帮助。
HTML:
<select class="form-control" id="allocation-algorithm">
<option value="SHA-256">SHA-256</option>
<option value="SCRYPT">SCRYPT</option>
<option value="ETHASH">ETHASH</option>
<option value="CRYPTONIGH">CRYPTONIGHT</option>
<option value="X11">X11</option>
</select>
Run Code Online (Sandbox Code Playgroud)
TS:
import {Component} from '@angular/core';
import {HashrateAllocationService} from './hashrateAllocation.service';
@Component({
selector: 'hashrate-allocation',
templateUrl: './hashrateAllocation.html',
styleUrls: ['./hashrateAllocation.scss']
})
export class HashrateAllocation {
selectedAlgorithm = "SHA-256";
allocationTableData:Array<any>;
constructor(private _hashrateTableService: HashrateAllocationService) {
this.allocationTableData = _hashrateTableService.allocationTableData;
};
}
Run Code Online (Sandbox Code Playgroud) 我有一个角度应用程序:https : //github.com/XBITSwitzerland/ngx-admin/tree/ng2-admin
现在我尝试做: npm install
但是我遇到了这个错误(命令的竞赛输出太长了,因此我在这里仅分享最后一部分):
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\github\ngx-admin\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\github\\ngx-admin\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\github\ngx-admin\node_modules\wintersmith-sassy\node_modules\node-sass
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with …Run Code Online (Sandbox Code Playgroud) 我尝试安装 Truffle,但随后出现此错误:
$ npm install -g truffle
C:\Users\dany.vandermeij\AppData\Roaming\npm\truffle -> C:\Users\dany.vandermeij\AppData\Roaming\npm\node_modules\truffle\build\cli.bundled.js
> keccak@1.4.0 install C:\Users\dany.vandermeij\AppData\Roaming\npm\node_modules\truffle\node_modules\keccak
> npm run rebuild || echo "Keccak bindings compilation fail. Pure JS implementation will be used."
> keccak@1.4.0 rebuild C:\Users\dany.vandermeij\AppData\Roaming\npm\node_modules\truffle\node_modules\keccak
> node-gyp rebuild
C:\Users\dany.vandermeij\AppData\Roaming\npm\node_modules\truffle\node_modules\keccak>if not defined npm_config_node_gyp (node "C:\Users\dany.vandermeij\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\dany.vandermeij\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\Users\dany.vandermeij\AppData\Local\Programs\Python\Python37-32\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; …Run Code Online (Sandbox Code Playgroud) 我在 youtube 上做了以下教程:https : //www.youtube.com/watch?v=s_ht4AKnWZg
这是我的代码:
from flask import Flask, request
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class HelloWorld(Resource):
def get(self):
return {'about':'Hello World!'}
def post(self):
some_json = request.get_json()
return {'you sent': some_json}, 201
class Multi(Resource):
def get(self, num):
return {'result': num*10}
api.add_resource(HelloWorld, '/')
api.add_resource(Multi, '/multi/<int:num>')
if __name__ == '__main__':
app.run(debug=True)
Run Code Online (Sandbox Code Playgroud)
现在,当我运行脚本时,出现以下错误:
/home/one/systemx/test_api$ python flask_restful.py
Traceback (most recent call last):
File "flask_restful.py", line 2, in <module>
from flask_restful import Resource, Api
File "/home/one/systemx/test_api/flask_restful.py", line …Run Code Online (Sandbox Code Playgroud) I am very new to quorum programming. I already made some Smart Contracts with solidity on ethereum and made some dapps with Truffle, React and Metamask.
Now I did this Quorum Tutorial: https://truffleframework.com/tutorials/building-dapps-for-quorum-private-enterprise-blockchains
Before I get to the problem I have, I tell you what I am trying to do: Right now we have a database in our school, where the teacher can save the marks of the students, and the students can log in and see the marks they …
我有一个角度应用程序,可以使用npm start控制台中的命令启动。现在我想创建一个批处理文件,在启动时执行“npm install”。这是我创建的批处理文件:
前端.bat
cd "<path>"
npm start
Run Code Online (Sandbox Code Playgroud)
当我执行文件时,控制台会很快出现,但随后什么也没有发生。
我的问题是,甚至可以在批处理文件中执行 npm start 吗?如果没有,是否有另一种方法可以使用批处理文件启动 Angular 应用程序?
谢谢
我有一个回送3应用程序。当我启动应用程序时,. node我会在控制台中看到它。
hsts deprecated The "includeSubdomain" parameter is deprecated. Use "includeSubDomains" (with a capital D) instead. node_modules/loopback/lib/server-app.js:74:25
Run Code Online (Sandbox Code Playgroud)
我在node_modules文件夹中搜索,但是没有回送文件夹。那么我该如何解决呢?
node.js ×4
angular ×3
npm ×3
loopback ×2
npm-install ×2
api ×1
batch-file ×1
blockchain ×1
curl ×1
docker ×1
ethereum ×1
flask ×1
hsts ×1
http ×1
hyperledger ×1
input ×1
keccak ×1
loopbackjs ×1
node-sass ×1
nodemailer ×1
python ×1
quorum ×1
select ×1
slack ×1
slack-api ×1
slack-dialog ×1
solidity ×1
truffle ×1
variables ×1