window.onload = function(){
//跳转到图片的新窗口
$('.headImg').on('click', function () { console.log('点击事件触发') })
}
2.文件上传和数据同时可以上传上来
public FileRes uploadImage(@RequestPart("file") MultipartFile file,@RequestParam String uploadPath) {
//顺序不能颠倒
//requestBody是指整个传进来的数据是一个json对象格式
//上传文件不能用@requestBoby,
//@RequestParam是上传单个测试的,非常方便
}
3.bootstrapinput上传文件很方便
4.如果form元素里面有不需要发送的元素则 disable禁用他
$('.projectfile').attr("disabled","")
5.如果 函数执行的顺序没有生命周期 ,放到一个函数后调用另外一个函数即可
6.后端专门返回数据是最实在的
7.得到路径中的文件名和后缀
// 从路径得到资源的名字和后缀
String.prototype.replaceAll = function(s1, s2) {
return this.replace(new RegExp(s1, "gm"), s2);
}
buyImageAddress=res;
console.log(buyImageAddress)
fullPath = buyImageAddress;
buyImageAddressOnlyNameAndSuffix = '';
fullPath = fullPath.replaceAll('/', '\\');
console.log(fullPath);
pos = fullPath.lastIndexOf('\\');
buyImageAddressOnlyNameAndSuffix = fullPath.substr(pos+1);
console.log(buyImageAddressOnlyNameAndSuffix);
8.select2的数据加到请求中
function submitHandler() {
if ($.validate.form()) {
var data=$('#form-buy-edit').serializeArray();
var advantage = $.form.selectSelects("advantage");
data.push({"name": "advantages", "value": advantage});
$('.projectfile').attr("disabled","")
$.operate.save(prefix + "/edit", data);
}
}
9.要测试还是main方法实在,不用重启
10.idea配置springboot启动多个service
//在 .idea的workplace文件夹改配置文件
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
component>
<component name="BranchesTreeState">
<expand>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
path>
expand>
<select />
component>
<component name="ChangeListManager">
<list default="true" id="7b18c1d0-e9e7-433a-b49f-4d9054e0be7c" name="Default Changelist" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="PropertiesComponent">
<property name="RequestMappingsPanelOrder0" value="0" />
<property name="RequestMappingsPanelOrder1" value="1" />
<property name="RequestMappingsPanelWidth0" value="75" />
<property name="RequestMappingsPanelWidth1" value="75" />
<property name="node.js.path.for.package.tslint" value="project" />
<property name="node.js.selected.package.tslint" value="(autodetect)" />
component>
<component name="RunDashboard">
<option name="configurationTypes">
<set>
<option value="SpringBootApplicationConfigurationType" />
set>
option>
component>
<component name="RunManager">
<configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true">
<option name="arquillianRunConfiguration">
<value>
<option name="containerStateName" value="" />
value>
option>
<option name="TEST_OBJECT" value="class" />
<method v="2">
<option name="Make" enabled="true" />
method>
configuration>
<configuration name="SpringcloudConsumerDept80Application" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true">
<module name="springcloud-consumer-dept-80" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="top.jamsee.demo.*" />
<option name="ENABLED" value="true" />
pattern>
extension>
<option name="SPRING_BOOT_MAIN_CLASS" value="top.jamsee.demo.SpringcloudConsumerDept80Application" />
<method v="2">
<option name="Make" enabled="true" />
method>
configuration>
<recent_temporary>
<list>
<item itemvalue="Spring Boot.SpringcloudConsumerDept80Application" />
list>
recent_temporary>
component>
<component name="TaskManager">
<servers />
component>
<component name="Vcs.Log.Tabs.Properties">
<option name="oldMeFiltersMigrated" value="true" />
component>
<component name="WindowStateProjectService">
<state width="1493" height="210" key="GridCell.Tab.0.bottom" timestamp="1654156566435">
<screen x="0" y="0" width="1536" height="824" />
state>
<state width="1493" height="210" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1654156566435" />
<state width="1493" height="210" key="GridCell.Tab.0.center" timestamp="1654156566435">
<screen x="0" y="0" width="1536" height="824" />
state>
<state width="1493" height="210" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1654156566435" />
<state width="1493" height="210" key="GridCell.Tab.0.left" timestamp="1654156566435">
<screen x="0" y="0" width="1536" height="824" />
state>
<state width="1493" height="210" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1654156566435" />
<state width="1493" height="210" key="GridCell.Tab.0.right" timestamp="1654156566435">
<screen x="0" y="0" width="1536" height="824" />
state>
<state width="1493" height="210" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1654156566435" />
<state width="1493" height="210" key="GridCell.Tab.1.bottom" timestamp="1654156566435">
<screen x="0" y="0" width="1536" height="824" />
state>
<state width="1493" height="210" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1654156566435" />
<state width="1493" height="210" key="GridCell.Tab.1.center" timestamp="1654156566435">
<screen x="0" y="0" width="1536" height="824" />
state>
<state width="1493" height="210" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1654156566435" />
<state width="1493" height="210" key="GridCell.Tab.1.left" timestamp="1654156566435">
<screen x="0" y="0" width="1536" height="824" />
state>
<state width="1493" height="210" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1654156566435" />
<state width="1493" height="210" key="GridCell.Tab.1.right" timestamp="1654156566435">
<screen x="0" y="0" width="1536" height="824" />
state>
<state width="1493" height="210" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1654156566435" />
component>
project>