我想登录$request_body访问日志。
但是一些请求有一些敏感的 JSON 字段,如密码。
例子:
[2019-03-28] 201 - POST /api/user/add HTTP/1.1 - {\x22email\x22:\x22test@test.com\x22,\x22password\x22:\x22myPassword\x22}
Run Code Online (Sandbox Code Playgroud)
有没有办法混淆密码值,使输出看起来像这样:
[2019-03-28] 201 - POST /api/user/add HTTP/1.1 - {\x22email\x22:\x22test@test.com\x22,\x22password\x22:\x22****\x22}
Run Code Online (Sandbox Code Playgroud) 我使用Sails.js制作了一个API.我不想向公众公开这个API,但我想为它编写两个客户端,一个将成为Web客户端(可能是AngluarJs),另一个将在Android手机上运行.
我不想公开API,因为每个客户端都有一组可以访问的控制器,每个用户都有许多权限.
为此我想了两个步骤:1 /确定请求来自我的一个应用程序2 /检查用户是否有权访问API的那一部分
有没有这样做的模块?
如何mounted在 Vue.js 组件中的事件上触发 Apollo GraphQL 查询。
这是我的代码的样子:
<template>
</template>
<script>
import gql from 'graphql-tag';
const myQuery = gql`
query someQuery {
books{
id
}
}`
export default {
data: () => ({
books: []
}),
apollo: {
books: {
query: myQuery,
},
},
mounted () {
// run the appollo query here as well ?
}
};
</script>
Run Code Online (Sandbox Code Playgroud)
查询在组件的第一次加载时运行良好,但如何让它在各种事件中运行?
在我的应用程序中,我有一个查询字符串,我想在单击按钮后将其删除。
我得到这样的查询字符串:
import qs from 'query-string'
// ..
const { search } = url
const { id } = qs.parse(search)
Run Code Online (Sandbox Code Playgroud)
然后,当我单击按钮时,我想删除字符串而不重新加载页面。
const onClick = () => {
history.push({})
}
Run Code Online (Sandbox Code Playgroud)
然而上面的代码并没有按预期工作。
javascript reactjs react-router react-router-v4 react-router-dom
javascript ×2
android ×1
angularjs ×1
graphql ×1
logging ×1
nginx ×1
nginx-config ×1
react-router ×1
reactjs ×1
sails.js ×1
vue.js ×1
vuejs2 ×1