所以我有简单形式的页面.要提交此表单,我需要提交复选框(一些隐私政策等).
我有这样的形式:
<form role="form" class="form" id="zamowienie" action="send_order.php" method="post">
<button type="button" id="wyslijZamowienie">SEND</button>
<input type="checkbox" id="regCheckbox" value="">
</form>
Run Code Online (Sandbox Code Playgroud)
(当然,每个分散注意力的输入都会被删除.)然后我有脚本只有在选中复选框后才能提交表单.
button.on("click",function(){
if ($("#regCheckbox").is(":checked")) $("#zamowienie").submit();
Run Code Online (Sandbox Code Playgroud)
不幸的是,我发现用户可以将按钮类型从"按钮"更改为"提交",并且他将能够提交忽略我的提交保护脚本的表单.
还有一个问题.我不是专家,但我开始徘徊其他用户可以使用FireBug或开发工具.他能以这种方式进行任何攻击吗?
非常感谢任何答案或指导.
我在我的孩子主题functions.php文件中创建了短代码.该shortcode如下:
function add_login_form() {
if ( is_user_logged_in() )
{
echo 'Witaj zalogowany';
}
else
{
wp_login_form();
}
}
add_shortcode('login_form', 'add_login_form');
Run Code Online (Sandbox Code Playgroud)
我[login_form]在我的网站(测试区域)添加了短代码:http:
//s540141209.domenaklienta.pl/wordpress/konto-klienta/
它被添加到网站后面的文字:"TUTAJPOWINIENBYĆ登录形式LUB NAPIS"WITAJ ZALOGOWANY"!"
它应该在第一个div内: <div class="et_pb_row">
但它显示在页面标题之后.你知道为什么会这样吗?
Thansk提前.但它碰巧显示在网站上的所有内容之前.
我在Spring Boot中创建应用程序.我创建了这样的服务:
@Service
public class MyService {
@Value("${myprops.hostname}")
private String host;
public void callEndpoint() {
String endpointUrl = this.host + "/endpoint";
System.out.println(endpointUrl);
}
}
Run Code Online (Sandbox Code Playgroud)
此服务将连接到REST端点到将部署的其他应用程序(由我开发).这就是我想在application.properties文件(-default,-qa,-dev)中自定义主机名的原因.
我的应用程序构建和工作正常.我通过创建调用此服务的控制器来测试它,并host使用application.properties中的正确属性填充字段.
当我尝试为此类编写测试时,会出现问题.当我尝试这种方法时:
@RunWith(SpringRunner.class)
public class MyServiceTest {
@Autowired
private MyService myService;
@Test
public void callEndpoint() {
myService.callEndpoint();
}
}
Run Code Online (Sandbox Code Playgroud)
我收到例外:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'com.ge.bm.wip.comp.processor.service.MyServiceTest': Unsatisfied dependency expressed through field 'myService'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.ge.bm.wip.comp.processor.service.MyService' available: expected at least 1 bean which qualifies as autowire …
在 Vue 组件中注册函数的首选方法是什么。我倾向于仅在组件中注册视图所需的方法(或需要直接访问组件数据)和其他视图不需要的 vue 组件之外的功能。假设utilityFunction()和utilityFunctionTwo()目前仅在此组件内使用。
这是一个例子:
<template>
<button @click="bar"></button>
<button @click="foo"></button>
<button @click="baz"></button>
</template>
<script>
export default {
name: "SampleComponent",
data() {
return {
someVariable: "ABC",
otherVariable: 123
}
},
methods: {
foo() {
//some logic
utilityFunction(this.someVariable);
//other logic
},
bar() {
//some logic
utilityFunction(this.someVariable);
utilityFunctionTwo(this.otherVariable);
//some other logic
},
baz() {
//some logic
utilityFunctionTwo(this.someVariable);
//some other logic
}
}
}
function utilityFunction(arg){
//do something
}
function utilityFunctionTwo(arg){
//do something
}
</script>
Run Code Online (Sandbox Code Playgroud)
参数可能不同,效用函数可以是纯函数并返回某些内容或改变参数。可以有很多不同的场景。但我希望你明白这一点。
另一种方法是将这些函数作为方法添加到您的组件中。像这样:
<template>
<button …Run Code Online (Sandbox Code Playgroud)