工作内容
- 熟悉ifish后台springboot框架
- 后端新增通过user_id获取vendor的接口
- ifish后台页面新增显示vendor信息功能
参照RESTful API来定义接口地址
@RequestMapping(value = "/vendors", method = RequestMethod.GET)
public ResponseEntity getVendorByUserId(@RequestParam("userId") Long userId, HttpServletRequest request) {
return new ResponseEntity<>(vendorService.findByUserId(userId), HttpStatus.OK);
}
通过判断role来决定是否获取vendor数据
handleViewUser(row) {
this.dialogUserInfoVisible = true;
if (row.role === 'VENDOR' || row.role === '供应商') {
axios.get(`${API.ifish_vendors}?userId=${row.id}`)
.then((res) => {
this.userInfo.company = res.data.company;
this.userInfo.companyAddress = res.data.companyAddress;
});
}
this.userInfo.email = row.email;
this.userInfo.mobile = row.mobile;
this.userInfo.role = this.formatRole(row); // 格式化角色名
},

总结
- 进展
- 熟悉了下springboot框架,能新增一些api接口
- 完成了ifish后台页面供应商公司显示的需求
网友评论