From 9b45e5fe43f7663bc0040ca8ad5e3d03ea24436e Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Sun, 14 Feb 2021 15:59:25 +0800 Subject: [PATCH] Add setAuthServerUrl(). --- web/src/App.js | 2 ++ web/src/Setting.js | 1 - web/src/auth/AuthBackend.js | 6 ++++-- web/src/index.css | 4 ++++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/web/src/App.js b/web/src/App.js index a445bebe..650d9372 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -32,6 +32,7 @@ import HomePage from "./basic/HomePage"; import CustomGithubCorner from "./CustomGithubCorner"; import Face from "./auth/Face"; +import * as Auth from "./auth/AuthBackend"; import * as AuthBackend from "./auth/AuthBackend"; import AuthCallback from "./auth/AuthCallback"; @@ -47,6 +48,7 @@ class App extends Component { }; Setting.initServerUrl(); + Auth.setAuthServerUrl(Setting.ServerUrl); } componentWillMount() { diff --git a/web/src/Setting.js b/web/src/Setting.js index 83861e61..e1508ae1 100644 --- a/web/src/Setting.js +++ b/web/src/Setting.js @@ -17,7 +17,6 @@ import React from "react"; import {isMobile as isMobileDevice} from "react-device-detect"; export let ServerUrl = ""; -export let ClientUrl = ""; export function initServerUrl() { const hostname = window.location.hostname; diff --git a/web/src/auth/AuthBackend.js b/web/src/auth/AuthBackend.js index 764d21ee..483cc864 100644 --- a/web/src/auth/AuthBackend.js +++ b/web/src/auth/AuthBackend.js @@ -12,9 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -import * as Setting from "../Setting"; +let ServerUrl = "https://door.casbin.com"; -const ServerUrl = Setting.ServerUrl; +export function setAuthServerUrl(serverUrl) { + ServerUrl = serverUrl; +} export function getAccount() { return fetch(`${ServerUrl}/api/get-account`, { diff --git a/web/src/index.css b/web/src/index.css index 031ff92b..93a161a5 100644 --- a/web/src/index.css +++ b/web/src/index.css @@ -29,3 +29,7 @@ code { .ant-list-sm .ant-list-item { padding: 2px !important; } + +.ant-layout-header { + background-color: white !important; +}