Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
更新jwt硬编译,并更新重载接口
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanyutin753 committed Dec 6, 2023
1 parent 8c3f985 commit 4a531ac
Show file tree
Hide file tree
Showing 22 changed files with 19 additions and 354 deletions.
94 changes: 0 additions & 94 deletions PandoraNext-TokensTool/src/views/homeIphone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -238,23 +238,15 @@
<div style="text-align: center; transform: translateY(0vh)">
<h2>
获取token
<<<<<<< HEAD
<a
href="https://chat.OpenAI.com/api/auth/session"
>官网地址
</a>
=======
<a href="https://chat.OpenAI.com/api/auth/session">官网地址 </a>
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
<a href="https://ai.fakeopen.com/auth">Pandora地址</a>
<br />
欢迎大家来扩展
<a href="https://github.com/Yanyutin753/PandoraNext-TokensTool"
<<<<<<< HEAD
>PandoraNext-TokensTool v0.4.7.1
=======
>PandoraNext-TokensTool v0.4.7
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
</a>
</h2>
</div>
Expand Down Expand Up @@ -606,11 +598,7 @@
:show-confirm-button="false"
class="requireSettingDialog"
>
<<<<<<< HEAD
<div style="display: block">
=======
<div style="display: block">
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
<van-form @submit="RequireSetting(pandoraNext)">
<van-cell-group inset>
<br />
Expand Down Expand Up @@ -670,17 +658,6 @@
placeholder="代理服务URL(选填)"
/>
<br />
<<<<<<< HEAD
=======
<!-- 4.5 -->
<van-field
v-model="cookiesSetupPassword"
name="重载session密码"
label="重载session密码"
placeholder="_Secure-next-auth.setup-password"
/>
<br />
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
<van-field
v-model="whitelist"
name="白名单"
Expand Down Expand Up @@ -710,11 +687,7 @@
:show-confirm-button="false"
class="requireSettingDialog"
>
<<<<<<< HEAD
<div style="display: block">
=======
<div style="display: block">
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
<van-form @submit="RequireSetting(tokensTool)">
<van-cell-group inset>
<br />
Expand Down Expand Up @@ -769,10 +742,7 @@
name="访问网站密码"
label="访问网站密码"
placeholder="建议开启访问网站密码"
<<<<<<< HEAD
:rules="[{ validator: customValidator }]"
=======
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
/>
<br />
<van-field
Expand Down Expand Up @@ -890,10 +860,6 @@ import { ElMessage, ElMessageBox } from "element-plus";
import { differenceInDays, parseISO } from "date-fns";
import { ElLoading } from "element-plus";
<<<<<<< HEAD
=======
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
//加载状态
const loading = ref(true);
Expand Down Expand Up @@ -966,10 +932,6 @@ const loginPassword = ref("");
const license_id = ref("");
const getTokenPassword = ref("");
const containerName = ref("PandoraNext");
<<<<<<< HEAD
=======
const cookiesSetupPassword = ref("");
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
const autoToken_url = ref("default");
const whitelist = ref("");
Expand Down Expand Up @@ -1083,18 +1045,12 @@ const onSearch = (value: string) => {
*/
const fetchDataAndFillForm = async (value: string) => {
try {
<<<<<<< HEAD
const response = await axios.get(
`/api/selectToken?name=${value}`,
{
headers,
}
);
=======
const response = await axios.get(`/api/seleteToken?name=${value}`, {
headers,
});
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
const data_token = response.data.data;
console.log(data_token);
Expand All @@ -1118,18 +1074,12 @@ const fetchDataAndFillForm = async (value: string) => {
// 将用户数据添加到tableData
tableData.value = resUsers;
<<<<<<< HEAD
const response = await axios.get(
`/api/selectSetting`,
{
headers,
}
);
=======
const response = await axios.get(`/api/selectSetting`, {
headers,
});
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
const data = response.data.data;
console.log(data);
proxy_api_prefix.value = data.proxy_api_prefix;
Expand All @@ -1154,10 +1104,6 @@ const fetchDataAndFillForm = async (value: string) => {
license_id.value = data.license_id;
getTokenPassword.value = data.getTokenPassword;
containerName.value = data.containerName;
<<<<<<< HEAD
=======
cookiesSetupPassword.value = data.cookiesSetupPassword;
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
autoToken_url.value = data.autoToken_url;
provider.value = data.validation.provider;
site_key.value = data.validation.site_key;
Expand Down Expand Up @@ -1197,12 +1143,9 @@ const fetchDataAndFillForm = async (value: string) => {
// 在组件加载完成后自动触发数据加载和填充
onMounted(() => {
<<<<<<< HEAD
if (window.innerWidth <= 700) {
router.replace("/iphone");
}
=======
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
fetchLoginToken();
onSearch(value.value);
});
Expand Down Expand Up @@ -1242,11 +1185,7 @@ const handleEdit = (index: number, row: User) => {
* 添加token开启函数
* 类user
*/
<<<<<<< HEAD
const addToken = () => {
=======
const addToken = () => {
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
show_1.value = true;
};
Expand Down Expand Up @@ -1390,10 +1329,6 @@ const RequireSetting = (value: any) => {
license_id: license_id.value,
getTokenPassword: getTokenPassword.value,
containerName: containerName.value,
<<<<<<< HEAD
=======
cookiesSetupPassword: cookiesSetupPassword.value,
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
autoToken_url: autoToken_url.value,
whitelist: whitelist.value,
validation: validation,
Expand All @@ -1417,10 +1352,7 @@ const RequireSetting = (value: any) => {
} else {
ElMessage(data.msg);
}
<<<<<<< HEAD
fetchLoginToken();
=======
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
loadingInstance.close();
})
.catch((error) => {
Expand Down Expand Up @@ -1653,7 +1585,6 @@ const updatePoolToken = async () => {
* 更换pool_token
*/
<<<<<<< HEAD
const changePoolToken = async () => {
ElMessageBox.confirm("是否需要更换Pool_token的值,并重新刷新?", "Warning", {
confirmButtonText: "yes",
Expand All @@ -1669,24 +1600,6 @@ const changePoolToken = async () => {
headers,
}
);
=======
const changePoolToken = async () => {
ElMessageBox.confirm(
'是否需要更换Pool_token的值,并重新刷新?',
'Warning',
{
confirmButtonText: 'yes',
cancelButtonText: 'no',
type: 'warning',
}
)
.then(async () => {
const loadingInstance = ElLoading.service({ fullscreen: true });
try {
const response = await axios.get(`/api/ChangePoolToken`, {
headers,
});
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
const data = response.data.data;
temPoolToken.value = data;
Expand Down Expand Up @@ -1721,17 +1634,10 @@ const changePoolToken = async () => {
})
.catch(() => {
ElMessage({
<<<<<<< HEAD
type: "info",
message: "取消更改Pool_Token",
});
});
=======
type: 'info',
message: '取消更改Pool_Token',
})
})
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
};
/**
* 一键全生成
Expand Down
4 changes: 0 additions & 4 deletions PandoraNext-TokensTool/src/views/loginIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@
<br />
欢迎大家来扩展
<a href="https://github.com/Yanyutin753/PandoraNext-TokensTool"
<<<<<<< HEAD
>PandoraNext-TokensTool v0.4.7.1
=======
>PandoraNext-TokensTool v0.4.7
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
</a>
</h3>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,42 +62,18 @@ public void setSystemService(apiService apiService) {
* @param name
* @return 通过name获取到(tokens.json)文件里的全部值
*/
<<<<<<< HEAD

@GetMapping("selectToken")
public Result selectToken(@RequestParam("name") String name){
try {
List<token> res = apiService.selectToken(name);
=======
@GetMapping("seleteToken")
public Result seleteToken(@RequestParam("name") String name){
try {
List<token> res = apiService.seleteToken(name);
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
return Result.success(res);
} catch (Exception e) {
e.printStackTrace();
return Result.error("获取失败");
}
}

<<<<<<< HEAD
=======
// @GetMapping("seletePoolToken")
// public Result seleteToken(){
// try {
// String res = autoTokenController.getPoolToken();
// if(res != null){
// return Result.success(res);
// }
// else{
// return Result.error("获取pool_token失败,请检查是否生成!");
// }
// } catch (Exception e) {
// e.printStackTrace();
// return Result.error("获取pool_token失败");
// }
// }
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495

/**
* @param token
Expand Down Expand Up @@ -162,14 +138,6 @@ public Result deleteToken(@RequestParam String name){
}
}


<<<<<<< HEAD
=======




>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
/**
* @return 通过访问restart,重启PandoraNext服务
*/
Expand Down Expand Up @@ -274,22 +242,14 @@ public Result reloadContainer(){
systemSetting systemSetting = systemService.selectSetting();
String bingUrl = systemSetting.getBing();
String[] parts = bingUrl.split(":");
<<<<<<< HEAD
String baseUrlWithoutPath = "http://" + externalIP + ":" + parts[1] + "/" +systemSetting.getProxy_api_prefix();
=======
String baseUrlWithoutPath = "http://" + externalIP + ":" + parts[1];
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495

if (parts.length != 2) {
return Result.error("bind填写有误,无法提取port");
}
log.info("重载的PandoraNext服务Url:"+baseUrlWithoutPath);
<<<<<<< HEAD

String reloadCommand = "curl -i " + baseUrlWithoutPath + reloadUrl + "\"";
=======
String cookiesSetupPassword = systemSetting.getCookiesSetupPassword();
String reloadCommand = "curl -i -w \"\\n%{http_code}\\n\" -b \"_Secure-next-auth.setup-password="
+ cookiesSetupPassword + ";\" -X POST \"" + baseUrlWithoutPath + reloadUrl + "\"";
>>>>>>> bcd58edf7697081bd86d12c983b1afcac8db4495
// 执行重载进程的命令
Process reloadProcess = executeCommand(reloadCommand);
log.info("重载命令:"+reloadCommand);
Expand Down
Loading

0 comments on commit 4a531ac

Please sign in to comment.