管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-08-01 f048afe6e62af3c30ebdceea663c72b78c7e3ccc
1
已修改2个文件
17 ■■■■ 文件已修改
ExportMap/Controllers/UploadController.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/cs/TerraUtils.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ExportMap/Controllers/UploadController.cs
@@ -14,8 +14,13 @@
    public class UploadController : ApiController
    {
        [HttpPost]
        public Task<IEnumerable<FileDesc>> Post([FromUri]string path)
        public Task<IEnumerable<FileDesc>> Post([FromUri] string path, [FromUri] string token)
        {
            if (string.IsNullOrEmpty(token) || !ExportUtil.VerifyToken(token))
            {
                throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.Unauthorized, "令牌为空或无效!"));
            }
            //string root = HttpContext.Current.Server.MapPath("~/uploads");
            if (string.IsNullOrEmpty(path)) return null;
            string root = Path.Combine(Tools.GetSetting("tempFolder"), path);
ExportMap/cs/TerraUtils.cs
@@ -242,7 +242,15 @@
            string layerJson = Path.Combine(dirPath, "layer.json");
            string[] lines = File.ReadAllLines(layerJson, Encoding.UTF8);
            lines[12] = "    [ {\"endX\":1,\"endY\":0,\"startX\":0,\"startY\":0} ]";
            //lines[12] = "    [ { \"startX\": 0, \"startY\": 0, \"endX\": 1, \"endY\": 0 } ]";
            for (int i = 0, c = lines.Length; i < c; i++)
            {
                if (lines[i].IndexOf("startX") > -1)
                {
                    lines[i] = "    [ { \"startX\": 0, \"startY\": 0, \"endX\": 1, \"endY\": 0 } ]";
                    break;
                }
            }
            File.WriteAllLines(layerJson, lines, Encoding.UTF8);
        }