修复重置应用秘钥

This commit is contained in:
whyour 2022-01-16 18:55:18 +08:00
parent e96a2818b7
commit 5461325e69

View File

@ -54,7 +54,17 @@ export default class OpenService {
} }
public async resetSecret(id: number): Promise<App> { public async resetSecret(id: number): Promise<App> {
const tab: any = { client_secret: createRandomString(24, 24), tokens: [] }; const tab: any = {
client_secret: createRandomString(24, 24),
tokens: [],
id,
};
// const doc = await this.get(id);
// const tab = new App({ ...doc });
// tab.client_secret = createRandomString(24, 24);
// tab.tokens = [];
// const newDoc = await this.updateDb(tab);
// return newDoc;
const newDoc = await this.updateDb(tab); const newDoc = await this.updateDb(tab);
return newDoc; return newDoc;
} }