mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
Fix API_URL/API_DOMAIN usage in dashboard
This commit is contained in:
parent
122f535e34
commit
bc250209d8
4 changed files with 7 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
||||||
import { RootStore } from "./store";
|
import { RootStore } from "./store";
|
||||||
const apiUrl = process.env.API_URL;
|
const apiUrl = `https://${process.env.API_DOMAIN}`;
|
||||||
|
|
||||||
type QueryParamObject = { [key: string]: string | null };
|
type QueryParamObject = { [key: string]: string | null };
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ const isAuthenticated = async () => {
|
||||||
|
|
||||||
export const authGuard: NavigationGuard = async (to, from, next) => {
|
export const authGuard: NavigationGuard = async (to, from, next) => {
|
||||||
if (await isAuthenticated()) return next();
|
if (await isAuthenticated()) return next();
|
||||||
window.location.href = `${process.env.API_URL}/auth/login`;
|
window.location.href = `https://${process.env.API_DOMAIN}/auth/login`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const loginCallbackGuard: NavigationGuard = async (to, from, next) => {
|
export const loginCallbackGuard: NavigationGuard = async (to, from, next) => {
|
||||||
|
@ -25,5 +25,5 @@ export const loginCallbackGuard: NavigationGuard = async (to, from, next) => {
|
||||||
|
|
||||||
export const authRedirectGuard: NavigationGuard = async (to, form, next) => {
|
export const authRedirectGuard: NavigationGuard = async (to, form, next) => {
|
||||||
if (await isAuthenticated()) return next("/dashboard");
|
if (await isAuthenticated()) return next("/dashboard");
|
||||||
window.location.href = `${process.env.API_URL}/auth/login`;
|
window.location.href = `https://${process.env.API_DOMAIN}/auth/login`;
|
||||||
};
|
};
|
||||||
|
|
|
@ -20,7 +20,7 @@ Vue.mixin({
|
||||||
return {
|
return {
|
||||||
get env() {
|
get env() {
|
||||||
return Object.freeze({
|
return Object.freeze({
|
||||||
API_URL: process.env.API_URL,
|
API_URL: `https://${process.env.API_DOMAIN}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
require("dotenv").config({ path: path.resolve(process.cwd(), "../.env") });
|
|
||||||
|
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const VueLoaderPlugin = require("vue-loader/lib/plugin");
|
const VueLoaderPlugin = require("vue-loader/lib/plugin");
|
||||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||||
|
@ -154,7 +152,9 @@ let config = {
|
||||||
js: ["./src/main.ts"],
|
js: ["./src/main.ts"],
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
new DotenvPlugin(),
|
new DotenvPlugin({
|
||||||
|
path: path.resolve(process.cwd(), "../.env"),
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: [".ts", ".tsx", ".js", ".mjs", ".vue"],
|
extensions: [".ts", ".tsx", ".js", ".mjs", ".vue"],
|
||||||
|
|
Loading…
Add table
Reference in a new issue