mirror of
https://gitee.com/fit2cloud-feizhiyun/1Panel.git
synced 2024-12-02 11:57:56 +08:00
fix: 解决 ssl 启用和端口修改跳转问题 (#1030)
This commit is contained in:
parent
43652b2a54
commit
2ae1db4730
@ -31,6 +31,8 @@ import { MsgSuccess } from '@/utils/message';
|
||||
import { updatePort } from '@/api/modules/setting';
|
||||
import { ElMessageBox, FormInstance } from 'element-plus';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { GlobalStore } from '@/store';
|
||||
const globalStore = GlobalStore();
|
||||
|
||||
interface DialogProps {
|
||||
serverPort: number;
|
||||
@ -66,9 +68,10 @@ const onSavePort = async (formEl: FormInstance | undefined) => {
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
globalStore.isLogin = false;
|
||||
let href = window.location.href;
|
||||
let ip = href.split('//')[1].split(':')[0];
|
||||
window.open(`${href.split('//')[0]}//${ip}:${form.serverPort}/`, '_self');
|
||||
window.open(`${href.split('//')[0]}//${ip}:${form.serverPort}/${globalStore.entrance}`, '_self');
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
|
@ -112,6 +112,8 @@ import { DownloadByPath } from '@/api/modules/files';
|
||||
import { Rules } from '@/global/form-rules';
|
||||
import { ElMessageBox, FormInstance } from 'element-plus';
|
||||
import { Setting } from '@/api/interface/setting';
|
||||
import { GlobalStore } from '@/store';
|
||||
const globalStore = GlobalStore();
|
||||
|
||||
const loading = ref();
|
||||
const drawerVisiable = ref();
|
||||
@ -207,8 +209,10 @@ const onSaveSSL = async (formEl: FormInstance | undefined) => {
|
||||
await updateSSL(param).then(() => {
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
let href = window.location.href;
|
||||
globalStore.isLogin = false;
|
||||
let address = href.split('://')[1];
|
||||
window.open(`https://${address}/`, '_self');
|
||||
address = address.replaceAll('settings/safe', globalStore.entrance);
|
||||
window.open(`https://${address}`, '_self');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user