Skip to content

Commit

Permalink
#: Modify Authorization.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
zdu-strong committed Jan 18, 2025
1 parent 55b461e commit 725d9bd
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 23 deletions.
7 changes: 2 additions & 5 deletions capacitor/src/api/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import * as Git from '@/api/Git'
import * as Resource from '@/api/Resource'
import * as LongTermTask from '@/api/LongTermTask'

export default {
Git,
Resource,
LongTermTask,
}





Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import registerWebworker from 'webworker-promise/lib/register'
import axios from "axios";
import { concatMap, from, lastValueFrom, map, range, timer, toArray } from "rxjs";
import * as mathjs from 'mathjs'
import { getLongTermTask } from '@/api/LongTermTask';
import api from '@/api';
import { addMilliseconds } from 'date-fns'
import linq from 'linq'

Expand Down Expand Up @@ -78,7 +78,7 @@ registerWebworker(async ({
}),
map((response) => response.data),
toArray(),
concatMap((urlList) => from(getLongTermTask(async () => axios.post<string>(`/upload/merge`, urlList)))),
concatMap((urlList) => from(api.LongTermTask.getLongTermTask(async () => axios.post<string>(`/upload/merge`, urlList)))),
map((result) => result as string)
));
return url;
Expand Down
7 changes: 2 additions & 5 deletions electron/src/api/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import * as Git from '@/api/Git'
import * as Resource from '@/api/Resource'
import * as LongTermTask from '@/api/LongTermTask'

export default {
Git,
Resource,
LongTermTask,
}





Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import registerWebworker from 'webworker-promise/lib/register'
import axios from "axios";
import { concatMap, from, lastValueFrom, map, range, timer, toArray } from "rxjs";
import * as mathjs from 'mathjs'
import { getLongTermTask } from '@/api/LongTermTask';
import api from '@/api';
import { addMilliseconds } from 'date-fns'
import linq from 'linq'

Expand Down Expand Up @@ -78,7 +78,7 @@ registerWebworker(async ({
}),
map((response) => response.data),
toArray(),
concatMap((urlList) => from(getLongTermTask(async () => axios.post<string>(`/upload/merge`, urlList)))),
concatMap((urlList) => from(api.LongTermTask.getLongTermTask(async () => axios.post<string>(`/upload/merge`, urlList)))),
map((result) => result as string)
));
return url;
Expand Down
4 changes: 2 additions & 2 deletions react/src/api/Authorization.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getKeyOfRSAPublicKey } from '@/api/EncryptDecrypt';
import api from '@/api';
import { encryptByPublicKeyOfRSA } from "@/common/RSAUtils";
import { GlobalUserInfo, removeGlobalUserInfo, setGlobalUserInfo } from "@/common/Server";
import { UserEmailModel } from "@/model/UserEmailModel";
Expand Down Expand Up @@ -29,7 +29,7 @@ export async function signIn(username: string, password: string): Promise<void>
const { data } = await axios.post(`/sign_in/one_time_password`, null, {
params: {
username: username,
password: await encryptByPublicKeyOfRSA(password, await getKeyOfRSAPublicKey()),
password: await encryptByPublicKeyOfRSA(password, await api.EncryptDecrypt.getKeyOfRSAPublicKey()),
}
});
const user = new TypedJSON(UserModel).parse(data)!;
Expand Down
11 changes: 6 additions & 5 deletions react/src/api/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import * as Resource from '@/api/Resource'
import * as Friendship from '@/api/Friendship'
import * as SuperAdminSystemRoleQuery from '@/api/SuperAdminUserRoleQuery'
import * as SuperAdminUserQuery from '@/api/SuperAdminUserQuery'
import * as EncryptDecrypt from '@/api/EncryptDecrypt'
import * as LongTermTask from '@/api/LongTermTask'
import * as User from '@/api/User'

export default {
Authorization,
Expand All @@ -14,9 +17,7 @@ export default {
Resource,
SuperAdminSystemRoleQuery,
SuperAdminUserQuery,
EncryptDecrypt,
LongTermTask,
User,
}





Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import registerWebworker from 'webworker-promise/lib/register'
import axios from "axios";
import { concatMap, from, lastValueFrom, map, range, timer, toArray } from "rxjs";
import * as mathjs from 'mathjs'
import { getLongTermTask } from '@/api/LongTermTask';
import api from '@/api';
import { addMilliseconds } from 'date-fns'
import linq from 'linq'

Expand Down Expand Up @@ -78,7 +78,7 @@ registerWebworker(async ({
}),
map((response) => response.data),
toArray(),
concatMap((urlList) => from(getLongTermTask(async () => axios.post<string>(`/upload/merge`, urlList)))),
concatMap((urlList) => from(api.LongTermTask.getLongTermTask(async () => axios.post<string>(`/upload/merge`, urlList)))),
map((result) => result as string)
));
return url;
Expand Down

0 comments on commit 725d9bd

Please sign in to comment.