Add setAuthServerUrl().

This commit is contained in:
Yang Luo 2021-02-14 15:59:25 +08:00
parent 277dec0af3
commit 9b45e5fe43
4 changed files with 10 additions and 3 deletions

View File

@ -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() {

View File

@ -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;

View File

@ -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`, {

View File

@ -29,3 +29,7 @@ code {
.ant-list-sm .ant-list-item {
padding: 2px !important;
}
.ant-layout-header {
background-color: white !important;
}