1 Star 0 Fork 3

luxuexian/authHub

forked from src-openEuler/authHub 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-fix-the-router-redirect-error.patch 1.55 KB
一键复制 编辑 原始数据 按行查看 历史
luxuexian 提交于 2024-11-08 15:15 . sync to master
From 75cf241f76913a8e1a7e81962225aa73b2314008 Mon Sep 17 00:00:00 2001
From: hugang <18768366022@163.com>
Date: Sat, 14 Sep 2024 11:11:02 +0800
Subject: [PATCH] fix the router redirect error
---
oauth2_web/deploy/authhub.nginx.conf | 4 ++--
oauth2_web/src/api/request.ts | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/oauth2_web/deploy/authhub.nginx.conf b/oauth2_web/deploy/authhub.nginx.conf
index f9720c3..a38eb1f 100644
--- a/oauth2_web/deploy/authhub.nginx.conf
+++ b/oauth2_web/deploy/authhub.nginx.conf
@@ -14,8 +14,8 @@ server {
root /opt/authhub/web/dist;
expires 30d;
}
- location /authhub {
- alias /opt/authhub/web/dist
+ location / {
+ root /opt/authhub/web/dist;
try_files $uri $uri/ /index.html;
if (!-e $request_filename){
rewrite ^(.*)$ /index.html last;
diff --git a/oauth2_web/src/api/request.ts b/oauth2_web/src/api/request.ts
index 526323f..e50e308 100644
--- a/oauth2_web/src/api/request.ts
+++ b/oauth2_web/src/api/request.ts
@@ -15,6 +15,7 @@ import type {
} from 'axios'
import axios from 'axios'
import { ElMessage, ElNotification } from 'element-plus'
+import router from '@/conf/router'
export interface Result<T = any> {
@@ -62,7 +63,7 @@ request.interceptors.response.use(
message: response.data.message,
})
setTimeout(() => {
- window.location.href = '/oauth/authorize/login'
+ router.replace('/oauth/authorize/login')
}, 1000)
break
default:
--
2.43.0.windows.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/rearcher/authHub.git
git@gitee.com:rearcher/authHub.git
rearcher
authHub
authHub
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385