Commit fbef470f authored by 赵啸非's avatar 赵啸非

添加客户端资源部署

parent e50bf81a
......@@ -29,8 +29,21 @@ export default {
},
/** 重写查看方法 */
toView(row) {
this.$refs.dialogform.view(row);
this.$get("/device/module/distribute/view",{id:row.id})
.then((res) => {
if (res.code == 1) {
window.open(res.data.entity.filePath,"_blank")
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
distribute(row) {
this.$post("/device/module/distribute/active", row)
......
package com.mortals.xhx.module.device.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.device.model.DeviceModuleDistributeEntity;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -9,6 +11,8 @@ import java.util.List;
* @author zxfei
* @date 2022-08-02
*/
@Data
public class DeviceModuleDistributeVo extends BaseEntityLong {
private String homeUrl;
}
\ No newline at end of file
package com.mortals.xhx.module.device.web;
import cn.hutool.core.net.url.UrlBuilder;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.ImageReEnum;
......@@ -8,6 +11,7 @@ import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.product.model.ProductEntity;
import com.mortals.xhx.module.product.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
......@@ -28,6 +32,8 @@ import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
import static com.mortals.xhx.common.key.Constant.PARAM_SERVER_HTTP_URL;
/**
*
* 设备前端模块部署
......@@ -74,4 +80,17 @@ public class DeviceModuleDistributeController extends BaseCRUDJsonBodyMappingCon
return rest;
}
@Override
protected int viewAfter(Long id, Map<String, Object> model, DeviceModuleDistributeEntity entity, Context context) throws AppException {
String homeUrl="";
ProductEntity productEntity = productService.get(entity.getProductId(), context);
if(!ObjectUtils.isEmpty(productEntity.getHomeUrl())){
homeUrl= productEntity.getHomeUrl();
}
String domain = GlobalSysInfo.getParamValue(PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11091");
entity.setFilePath(UrlBuilder.of(domain).addPath(homeUrl).toString());
return super.viewAfter(id, model, entity, context);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment