打包命令

This commit is contained in:
xiangheng
2023-11-29 00:38:06 +08:00
parent 22daf15440
commit 006d09707c
2 changed files with 9 additions and 1 deletions

View File

@@ -8,7 +8,15 @@ const releaseRelativePath = '../frontend'
const distPath = path.resolve(cwd, 'dist') const distPath = path.resolve(cwd, 'dist')
const releasePath = path.resolve(cwd, releaseRelativePath) const releasePath = path.resolve(cwd, releaseRelativePath)
const goProjectPath = path.resolve(cwd, '../server')
async function build() { async function build() {
await execaCommand('goreleaser release --snapshot --clean', {
stdio: 'inherit',
encoding: 'utf-8',
cwd: goProjectPath
})
await execaCommand('vite build', { stdio: 'inherit', encoding: 'utf-8', cwd }) await execaCommand('vite build', { stdio: 'inherit', encoding: 'utf-8', cwd })
if (existsSync(releasePath)) { if (existsSync(releasePath)) {
await remove(releasePath) await remove(releasePath)

View File

@@ -22,7 +22,7 @@ func LoginRoute(rg *gin.RouterGroup) {
handle := loginHandler{Service: service} handle := loginHandler{Service: service}
rg = rg.Group("/system", middleware.TokenAuth()) rg = rg.Group("/system", middleware.TokenAuth())
rg.POST("/login", handle.login, middleware.RecordLog("后台登录")) rg.POST("/login", handle.login)
rg.POST("/logout", handle.logout) rg.POST("/logout", handle.logout)
} }