Merge branch 'dev' of gitea.51mars.com:Oak-Team/oak-general-business into dev

This commit is contained in:
Xu Chang 2024-05-12 23:36:00 +08:00
commit 487b4ed58e
3 changed files with 18 additions and 0 deletions

View File

@ -1381,6 +1381,10 @@ export async function refreshToken(params, context) {
const interval = tokenRefreshTime || intervals[process.env.NODE_ENV];
if (tokenRefreshTime !== 0 && now - token.refreshedAt > interval) {
const newValue = await generateNewIdAsync();
console.log('####### refreshToken token update start #######\n');
console.log('刷新前tokenId:', token?.id);
console.log('刷新前tokenValue:', token?.value);
console.log('---------------------\n');
await context.operate('token', {
id: await generateNewIdAsync(),
action: 'update',
@ -1392,6 +1396,8 @@ export async function refreshToken(params, context) {
id: token.id,
},
}, {});
console.log('刷新后tokenValue:', newValue);
console.log('####### refreshToken token update end #######\n');
closeRootMode();
return newValue;
}

View File

@ -1396,6 +1396,10 @@ async function refreshToken(params, context) {
const interval = tokenRefreshTime || intervals[process.env.NODE_ENV];
if (tokenRefreshTime !== 0 && now - token.refreshedAt > interval) {
const newValue = await (0, uuid_1.generateNewIdAsync)();
console.log('####### refreshToken token update start #######\n');
console.log('刷新前tokenId:', token?.id);
console.log('刷新前tokenValue:', token?.value);
console.log('---------------------\n');
await context.operate('token', {
id: await (0, uuid_1.generateNewIdAsync)(),
action: 'update',
@ -1407,6 +1411,8 @@ async function refreshToken(params, context) {
id: token.id,
},
}, {});
console.log('刷新后tokenValue:', newValue);
console.log('####### refreshToken token update end #######\n');
closeRootMode();
return newValue;
}

View File

@ -1891,6 +1891,10 @@ export async function refreshToken<ED extends EntityDict>(
const interval = tokenRefreshTime || intervals[process.env.NODE_ENV];
if (tokenRefreshTime !== 0 && now - (token.refreshedAt as number) > interval) {
const newValue = await generateNewIdAsync();
console.log('####### refreshToken token update start #######\n');
console.log('刷新前tokenId:', token?.id);
console.log('刷新前tokenValue:', token?.value);
console.log('---------------------\n');
await context.operate(
'token',
{
@ -1906,6 +1910,8 @@ export async function refreshToken<ED extends EntityDict>(
},
{}
);
console.log('刷新后tokenValue:', newValue);
console.log('####### refreshToken token update end #######\n');
closeRootMode();
return newValue;
}