post请求用data来接收参数(走的是请求体),get请求用params来接收参数(这个走的是路径)

后端需要接收前端的两个实现类的参数,可以在后端封装一个工具类
SignVo:

package com.hundsun.bontal.demo.VO;

import com.hundsun.bontal.demo.model.TbSignInfo;
import com.hundsun.bontal.demo.model.TbUser;
import lombok.AllArgsConstructor;
import lombok.Data;

@Data
public class SignVO {
    
    
    private TbSignInfo tbSignInfo;
    private TbUser tbUser;
}

@RequestMapping(value = "/insert",method = RequestMethod.POST)
@Transactional
    public Map saveSignInfo(@RequestBody SignVO signVO){
    
    

}
	handle12() {
    
    
				
				var data1 = sessionStorage.getItem("data");
				var testStorageData = JSON.parse(sessionStorage.getItem('username'));
				console.log(testStorageData);
				//发送请求
				axios({
    
    
					url: '/demo-service/tb_sign_info/insert',
					method: 'post',
					data: {
    
     
						tbSigninfo :this.editForm,
							tbUser:testStorageData
					},
						
						
					
				}).then(data => {
    
     //当执行完成后的操作
					//    Message.success("会签保存成功!你的会签id是:"+data.data.sid);
                  console.log(this.editForm);
					
	}			

猜你喜欢

转载自blog.csdn.net/houzhicongone/article/details/121338038