增加环境变量导入

This commit is contained in:
whyour
2022-10-11 22:16:36 +08:00
parent 6e9a4a29ef
commit 75fca715e3
4 changed files with 94 additions and 8 deletions
+4 -4
View File
@@ -67,12 +67,12 @@ export default class EnvService {
const envs = await this.envs();
if (toIndex === 0 || toIndex === envs.length - 1) {
targetPosition = isUpward
? envs[0].position * 2
: envs[toIndex].position / 2;
? envs[0].position! * 2
: envs[toIndex].position! / 2;
} else {
targetPosition = isUpward
? (envs[toIndex].position + envs[toIndex - 1].position) / 2
: (envs[toIndex].position + envs[toIndex + 1].position) / 2;
? (envs[toIndex].position! + envs[toIndex - 1].position!) / 2
: (envs[toIndex].position! + envs[toIndex + 1].position!) / 2;
}
const newDoc = await this.update({
id,