@whyour/qinglong 2.18.0 → 2.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whyour/qinglong",
3
- "version": "2.18.0",
3
+ "version": "2.18.1",
4
4
  "description": "Timed task management platform supporting Python3, JavaScript, Shell, Typescript",
5
5
  "repository": {
6
6
  "type": "git",
@@ -145,9 +145,16 @@ let OpenService = class OpenService {
145
145
  }
146
146
  }
147
147
  async generateSystemToken() {
148
- const [systemApp] = await open_1.AppModel.findOrCreate({
149
- where: { name: 'system', scopes: ['crons', 'system'] },
150
- });
148
+ var _a;
149
+ let systemApp = (_a = (await open_1.AppModel.findOne({
150
+ where: { name: 'system' },
151
+ }))) === null || _a === void 0 ? void 0 : _a.get({ plain: true });
152
+ if (!systemApp) {
153
+ systemApp = await this.create({
154
+ name: 'system',
155
+ scopes: ['crons', 'system'],
156
+ });
157
+ }
151
158
  const { data } = await this.authToken({
152
159
  client_id: systemApp.client_id,
153
160
  client_secret: systemApp.client_secret,