• 01.爱芳地产项目小程序全栈项目经验(已上线)


    1. 在ready周期函数(vue,页面渲染后)后执行
    window.onload = function(){
                //跳转到图片的新窗口
                $('.headImg').on('click', function () { console.log('点击事件触发') })
    }
    
    • 1
    • 2
    • 3
    • 4

    2.文件上传和数据同时可以上传上来

     public FileRes uploadImage(@RequestPart("file") MultipartFile file,@RequestParam String uploadPath) {
         //顺序不能颠倒
         //requestBody是指整个传进来的数据是一个json对象格式
         //上传文件不能用@requestBoby,
        //@RequestParam是上传单个测试的,非常方便
      }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    3.bootstrapinput上传文件很方便

    4.如果form元素里面有不需要发送的元素则 disable禁用他

    $('.projectfile').attr("disabled","")
    
    • 1

    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);
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13

    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);
    
                }
            }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13

    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>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
  • 相关阅读:
    车联网安全入门——ICSim模拟器使用
    打包工具webpack的学习
    SpringBoot——指标监控,自定义指标监控
    计算机基础知识56
    想要精通算法和SQL的成长之路 - 环形子数组的最大和
    【视觉SLAM入门】8. 回环检测,词袋模型,字典,感知,召回,机器学习
    Python数据分析 | Numpy与1维数组操作
    nuitka 打包成exe文件怎么样打包可以不需要安装python环境运行
    Python网络爬虫项目开发实战:怎么解决表单交互
    【游戏建模全流程】使用Maya制作赛车模型
  • 原文地址:https://blog.csdn.net/weixin_47039303/article/details/127832314