Skip to content

Commit

Permalink
更新后端
Browse files Browse the repository at this point in the history
  • Loading branch information
MonoLogueChi committed Mar 16, 2020
1 parent 8e6f6f0 commit 16f7ed2
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 63 deletions.
5 changes: 3 additions & 2 deletions Danmu/Controllers/Admin/DanmakuListController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,14 @@ public async Task<DanmuListWebResult<DanmuTable>> DateSelect(int page = 1, int s
[HttpGet("base" + "select")]
public async Task<DanmuListWebResult<DanmuTable>> DanmuBasesSelect(
int page = 1, int size = 30, string vid = null,
string author = null, int authorId = -1,
string author = null, string authorId = null,
string startDate = null,
string endDate = null, int mode = 100,
string ip = null, string key = null,
bool descending = true)
{
var result = DanmuDao.DanmuBasesSelectAsync(page, size, vid, author, authorId, startDate, endDate,
var iAuthorId = int.TryParse(authorId, out var uid) ? uid : -1;
var result = DanmuDao.DanmuBasesSelectAsync(page, size, vid, author, iAuthorId, startDate, endDate,
mode,
ip,
key, descending);
Expand Down
58 changes: 29 additions & 29 deletions Danmu/clientapp/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,34 @@ module.exports = {
lintOnSave: false,
productionSourceMap: false,
parallel: true,
devServer: {
port,
open: true,
overlay: {
warnings: true,
errors: true
},
proxy: {
[settings.apiPrefix]: {
target: 'http://localhost:8081', // 后台接口域名
ws: true, //如果要代理 websockets,配置这个参数
secure: false, // 如果是https接口,需要配置这个参数
changeOrigin: true //是否跨域
/*pathRewrite: {
[`^${settings.apiPrefix}`]: ''
}*/
}
},
historyApiFallback: {
rewrites: [{
from: /.*/g,
to: '/index.html'
}]
},
before(app) {
require('./mock')(app)
}
},
// devServer: {
// port,
// open: true,
// overlay: {
// warnings: true,
// errors: true
// },
// proxy: {
// [settings.apiPrefix]: {
// target: 'http://localhost:8081', // 后台接口域名
// ws: true, //如果要代理 websockets,配置这个参数
// secure: false, // 如果是https接口,需要配置这个参数
// changeOrigin: true //是否跨域
// /*pathRewrite: {
// [`^${settings.apiPrefix}`]: ''
// }*/
// }
// },
// historyApiFallback: {
// rewrites: [{
// from: /.*/g,
// to: '/index.html'
// }]
// },
// before(app) {
// require('./mock')(app)
// }
// },
configureWebpack: {
name: settings.title,
resolve: {
Expand All @@ -61,7 +61,7 @@ module.exports = {
minRatio: 0.8,
deleteOriginalAssets: false//是否删除源文件
}),
process.env.NODE_ENV === 'production' ? new BundleAnalyzerPlugin() : { apply: () => ({}) }
//process.env.NODE_ENV === 'production' ? new BundleAnalyzerPlugin() : { apply: () => ({}) }
]
},
chainWebpack(config) {
Expand Down
80 changes: 48 additions & 32 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ trigger:
pool:
vmImage: "ubuntu-latest"

variables:
version: "1.0.0"

steps:
- task: UseNode@1
inputs:
Expand All @@ -33,28 +36,37 @@ steps:
##编译Linux版
##开启R2R选项
- task: CmdLine@2
- task: Bash@3
inputs:
targetType: "inline"
script: |
sed -i 's/<PublishReadyToRun>false/<PublishReadyToRun>true/g' $(Build.SourcesDirectory)/Danmu/Danmu.csproj
sed -i 's/<Version>1.0.0</Version>/<Version>$(Build.BuildNumber)</Version>/g' $(Build.SourcesDirectory)/CommandLine/Danmu.CommandLine.csproj
#!/bin/bash
export CLI_VERSION
$CLI_VERSION=git describe --tags
sed -i "s/<PublishReadyToRun>false/<PublishReadyToRun>true/g" $(Build.SourcesDirectory)/Danmu/Danmu.csproj
sed -i "s/<Version>1.0.0/<Version>`echo $CLI_VERSION`/g" $(Build.SourcesDirectory)/CommandLine/Danmu.CommandLine.csproj
echo git describe --tags
echo $CLI_VERSION
cat $(Build.SourcesDirectory)/CommandLine/Danmu.CommandLine.csproj
- task: DotNetCoreCLI@2
inputs:
command: publish
projects: "$(Build.SourcesDirectory)/Danmu/Danmu.csproj"
publishWebProjects: True
arguments: "Danmu -c Release-Linux64 -r linux-x64 --self-contained false --output $(Build.ArtifactStagingDirectory)/Danmu64-R2R"
arguments: "-c Release-Linux64 -r linux-x64 --self-contained false --output $(Build.ArtifactStagingDirectory)/Danmu64-R2R"
zipAfterPublish: False

##开启程序集链接
# - task: CmdLine@2
# inputs:
# script: |
# sed -i 's/<PublishTrimmed>false/<PublishTrimmed>true/g' $(Build.SourcesDirectory)/Danmu/Danmu.csproj
#开启程序集链接
- task: CmdLine@2
inputs:
script: |
sed -i "s/<PublishTrimmed>false/<PublishTrimmed>true/g" $(Build.SourcesDirectory)/Danmu/Danmu.csproj
- task: DotNetCoreCLI@2
inputs:
command: publish
projects: "$(Build.SourcesDirectory)/Danmu/Danmu.csproj"
publishWebProjects: True
arguments: "Danmu -c Release-Linux64 -r linux-x64 --self-contained true -p:PublishSingleFile=true --output $(Build.ArtifactStagingDirectory)/Danmu64-R2R-SCD"
arguments: "-c Release-Linux64 -r linux-x64 --self-contained true -p:PublishSingleFile=true --output $(Build.ArtifactStagingDirectory)/Danmu64-R2R-SCD"
zipAfterPublish: False

- task: ArchiveFiles@2
Expand All @@ -79,61 +91,64 @@ steps:
- task: CmdLine@2
inputs:
script: |
sed -i 's/<PublishReadyToRun>true/<PublishReadyToRun>false/g' $(Build.SourcesDirectory)/Danmu/Danmu.csproj
sed -i "s/<PublishReadyToRun>true/<PublishReadyToRun>false/g" $(Build.SourcesDirectory)/Danmu/Danmu.csproj
rm -r ./Danmu/bin
##编译SCD版
- task: DotNetCoreCLI@2
inputs:
command: publish
projects: "$(Build.SourcesDirectory)/Danmu/Danmu.csproj"
publishWebProjects: True
arguments: "Danmu -c Release-Linux64 -r linux-x64 --self-contained true -p:PublishSingleFile=true --output $(Build.ArtifactStagingDirectory)/Danmu64-SCD"
arguments: "-c Release-Linux64 -r linux-x64 --self-contained true -p:PublishSingleFile=true --output $(Build.ArtifactStagingDirectory)/Danmu64-SCD"
zipAfterPublish: False

- task: DotNetCoreCLI@2
inputs:
command: publish
projects: "$(Build.SourcesDirectory)/Danmu/Danmu.csproj"
publishWebProjects: True
arguments: "Danmu -c Release-Linux32 -r linux-arm --self-contained true -p:PublishSingleFile=true --output $(Build.ArtifactStagingDirectory)/Danmu32-Arm-SCD"
arguments: "-c Release-Linux32 -r linux-arm --self-contained true -p:PublishSingleFile=true --output $(Build.ArtifactStagingDirectory)/Danmu32-Arm-SCD"
zipAfterPublish: False

- task: DotNetCoreCLI@2
inputs:
command: publish
projects: "$(Build.SourcesDirectory)/Danmu/Danmu.csproj"
publishWebProjects: True
arguments: "Danmu -c Release-Win -r win-x64 --self-contained true -p:PublishSingleFile=true --output $(Build.ArtifactStagingDirectory)/Danmu64-Win-SCD"
arguments: "-c Release-Win -r win-x64 --self-contained true -p:PublishSingleFile=true --output $(Build.ArtifactStagingDirectory)/Danmu64-Win-SCD"
zipAfterPublish: False



##编译非SCD版
##关闭程序集链接
# - task: CmdLine@2
# inputs:
# script: |
# sed -i 's/<PublishTrimmed>true/<PublishTrimmed>false/g' $(Build.SourcesDirectory)/Danmu/Danmu.csproj
#编译非SCD版
#关闭程序集链接
- task: CmdLine@2
inputs:
script: |
sed -i "s/<PublishTrimmed>true/<PublishTrimmed>false/g" $(Build.SourcesDirectory)/Danmu/Danmu.csproj
- task: DotNetCoreCLI@2
inputs:
command: publish
projects: "$(Build.SourcesDirectory)/Danmu/Danmu.csproj"
publishWebProjects: True
arguments: "Danmu -c Release-Linux64 -r linux-x64 --self-contained false --output $(Build.ArtifactStagingDirectory)/Danmu64"
arguments: "-c Release-Linux64 -r linux-x64 --self-contained false --output $(Build.ArtifactStagingDirectory)/Danmu64"
zipAfterPublish: False

- task: DotNetCoreCLI@2
inputs:
command: publish
projects: "$(Build.SourcesDirectory)/Danmu/Danmu.csproj"
publishWebProjects: True
arguments: "Danmu -c Release-Linux32 -r linux-arm --self-contained false --output $(Build.ArtifactStagingDirectory)/Danmu32-Arm"
zipAfterPublish: False
arguments: "-c Release-Linux32 -r linux-arm --self-contained false --output $(Build.ArtifactStagingDirectory)/Danmu32-Arm"
zipAfterPublish: False

- task: DotNetCoreCLI@2
inputs:
command: publish
projects: "$(Build.SourcesDirectory)/Danmu/Danmu.csproj"
publishWebProjects: True
arguments: "Danmu -c Release-Win -r win-x64 --self-contained false --output $(Build.ArtifactStagingDirectory)/Danmu64-Win"
arguments: "-c Release-Win -r win-x64 --self-contained false --output $(Build.ArtifactStagingDirectory)/Danmu64-Win"
zipAfterPublish: False


- task: ArchiveFiles@2
inputs:
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/Danmu64/Danmu"
Expand Down Expand Up @@ -170,7 +185,6 @@ steps:
archiveFile: "$(Build.ArtifactStagingDirectory)/linux.arm.scd.tar.xz"
replaceExistingArchive: true


- task: ArchiveFiles@2
inputs:
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/Danmu64-Win/Danmu"
Expand All @@ -193,13 +207,15 @@ steps:
- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: True
arguments: "CommandLine -c Release-Linux64 -r linux-x64 --self-contained true -p:PublishSingleFile=true --output $(Build.ArtifactStagingDirectory)/Cli-Tool"
zipAfterPublish: False
projects: "$(Build.SourcesDirectory)/CommandLine/Danmu.CommandLine.csproj"
publishWebProjects: False
arguments: "-c Release-Linux64 -r linux-x64 --self-contained true -p:PublishSingleFile=true --output $(Build.ArtifactStagingDirectory)/Cli-Tool/Danmu"
zipAfterPublish: false
modifyOutputPath: false

- task: ArchiveFiles@2
inputs:
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/Cli-Tool/CommandLine"
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)/Cli-Tool/Danmu"
includeRootFolder: true
archiveType: "tar"
tarCompression: "xz"
Expand Down

0 comments on commit 16f7ed2

Please sign in to comment.