mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 01:04:25 +08:00
set cookies in development mode
This commit is contained in:
@@ -137,6 +137,11 @@ func startWebServer(c *cli.Context) error {
|
|||||||
|
|
||||||
router.GET("/healthz.json", bindApi(api.Healths.HealthStatusHandler))
|
router.GET("/healthz.json", bindApi(api.Healths.HealthStatusHandler))
|
||||||
|
|
||||||
|
if config.Mode == settings.MODE_DEVELOPMENT {
|
||||||
|
devRoute := router.Group("/dev")
|
||||||
|
devRoute.GET("/cookies", bindMiddleware(middlewares.ServerSettingsCookie(config)))
|
||||||
|
}
|
||||||
|
|
||||||
proxyRoute := router.Group("/proxy")
|
proxyRoute := router.Group("/proxy")
|
||||||
proxyRoute.Use(bindMiddleware(middlewares.JWTAuthorizationByQueryString))
|
proxyRoute.Use(bindMiddleware(middlewares.JWTAuthorizationByQueryString))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<img src="/dev/cookies" style="display: none;" v-if="!isProduction" />
|
||||||
<f7-app v-bind="f7params">
|
<f7-app v-bind="f7params">
|
||||||
<f7-view id="main-view" class="safe-areas" main url="/"></f7-view>
|
<f7-view id="main-view" class="safe-areas" main url="/"></f7-view>
|
||||||
</f7-app>
|
</f7-app>
|
||||||
@@ -13,6 +14,7 @@ export default {
|
|||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
isProduction: self.$settings.isProduction(),
|
||||||
f7params: {
|
f7params: {
|
||||||
name: 'ezBookkeeping',
|
name: 'ezBookkeeping',
|
||||||
theme: 'ios',
|
theme: 'ios',
|
||||||
|
|||||||
@@ -126,6 +126,10 @@ export default defineConfig(async () => {
|
|||||||
port: 8081,
|
port: 8081,
|
||||||
strictPort: true,
|
strictPort: true,
|
||||||
proxy: {
|
proxy: {
|
||||||
|
'/dev': {
|
||||||
|
target: 'http://127.0.0.1:8080/',
|
||||||
|
changeOrigin: true
|
||||||
|
},
|
||||||
'/api': {
|
'/api': {
|
||||||
target: 'http://127.0.0.1:8080/',
|
target: 'http://127.0.0.1:8080/',
|
||||||
changeOrigin: true
|
changeOrigin: true
|
||||||
|
|||||||
Reference in New Issue
Block a user