前后端分离工程搭建

前端 vue-cli-service
后端 ASP.NET Core WebAPI

1. 后端搭建

1.1 新建项目:

模板:Web->ASP.NET Core Web 应用程序->.NET Framework->ASP.NET Core 2.1->API

编辑TestProject.csproj,添加GenerateDocumentationFile配置节

<PropertyGroup>
  <TargetFramework>net461</TargetFramework>
  <GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
1.2 配置IIS调试

编辑 Properties–>launchSetting.json文件

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iis": {
      "applicationUrl": "http://xxxxxx/TestProject",
      "sslPort": 0
    }
  },
  "$schema": "http://json.schemastore.org/launchsettings.json",
  "profiles": {
    "TeamCheck": {
      "commandName": "Project",
      "launchBrowser": true,
      "launchUrl": "api/values",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      },
      "applicationUrl": "http://localhost:5000"
    },
    "IIS": {
      "commandName": "IIS",
      "launchBrowser": true,
      "launchUrl": "swagger/",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}
1.3 配置Swagger

详细操作见往期博客 ASP.Net MVCWebApi下集成Swagger UI

2.前端工程

2.1 vui ui

在这里插入图片描述

  • Base URL:/team/
  • PWA App Name:teamcheck
  • package.json修改name为小写
添加依赖
  • element-ui
  • axios
  • moment
  • lodash
  • font-awesome
END

猜你喜欢

转载自blog.csdn.net/qq_31176861/article/details/87968132