Skip to content

Commit

Permalink
更新
Browse files Browse the repository at this point in the history
  • Loading branch information
leiyiyan authored Aug 6, 2024
1 parent 7ef0f50 commit bdbea3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 3 additions & 6 deletions script/cbd/cbd_ck.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ async function getCookie() {

if (!csession) throw new Error(`⛔️ ${QL.envName}获取cookie失败!`);
const user = {
username: QL.username,
csession,
versionname,
versioncode,
Expand Down Expand Up @@ -75,14 +76,10 @@ async function main(user) {
if (selectedEnv) {
const envValues = JSON.parse(selectedEnv.value);
console.log(envValues)
let index = envValues.findIndex(e => e.csession == user.csession)
let index = envValues.findIndex(e => e.username == user.username)
index = index === -1 ? 0 : index
console.log('index: ' + index)
if (envValues[index].csession == user.csession) {
$.title = `${QL.envName}当前ck未过期,无需同步`;
DoubleLog(`⛔️ ${QL.envName}当前ck未过期,无需同步`);
return;
}
envValues[index] = user;
// 更新已存在的环境变量
await ql.updateEnv({ value: JSON.stringify(envValues), name: QL.envName, id: selectedEnv.id });
} else {
Expand Down
9 changes: 9 additions & 0 deletions subscribe/leiyiyan.boxjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,15 @@
"autoGrow": true,
"rows": 1,
"desc": "填入要同步到青龙的变量名称"
},
{
"id": "@CBD_QL.username",
"name": "用户名",
"val": "",
"type": "textarea",
"autoGrow": true,
"rows": 1,
"desc": "填入要同步到青龙的用户名(自定义)"
}
]
},
Expand Down

0 comments on commit bdbea3d

Please sign in to comment.