@xuda.io/account_module 1.2.135 → 1.2.137

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.
Files changed (2) hide show
  1. package/index.js +17 -9
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -92,15 +92,13 @@ exports.update_account_info = async function (req) {
92
92
  delete account_obj.account_info.client_id;
93
93
  delete account_obj.account_info.uid;
94
94
 
95
- if (!account_obj.account_project_id) {
96
- const app_module = require(`${module_path}/app_module`);
97
-
98
- const ret = await app_module.create_project({ token_ret: req.token_ret, uid, data: { app_name: `Account ${uid} main project`, is_account_project: true } });
99
-
100
- if (ret.code > -1) {
101
- account_obj.account_project_id = ret.data;
102
- }
103
- }
95
+ // if (!account_obj.account_project_id) {
96
+ // const app_module = require(`${module_path}/app_module`);
97
+ // const ret = await app_module.create_project({ token_ret: req.token_ret, uid, data: { app_name: `Account ${uid} main project`, is_account_project: true } });
98
+ // if (ret.code > -1) {
99
+ // account_obj.account_project_id = ret.data;
100
+ // }
101
+ // }
104
102
 
105
103
  const ret2 = await db_module.save_couch_doc('xuda_accounts', account_obj);
106
104
  if (ret2.code > 0) {
@@ -446,6 +444,16 @@ exports.get_account_data = async function (req) {
446
444
  // }
447
445
  // }
448
446
 
447
+ if (!acc_obj.account_project_id) {
448
+ let = account_obj = acc_obj;
449
+ const app_module = require(`${module_path}/app_module`);
450
+ const ret = await app_module.create_project({ token_ret: req.token_ret, uid, data: { app_name: `Account ${uid} main project`, is_account_project: true } });
451
+ if (ret.code > -1) {
452
+ account_obj.account_project_id = ret.data;
453
+ const ret2 = await db_module.save_couch_doc('xuda_accounts', account_obj);
454
+ }
455
+ }
456
+
449
457
  return ret;
450
458
  } catch (error) {
451
459
  return { code: -1, data: error };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/account_module",
3
- "version": "1.2.135",
3
+ "version": "1.2.137",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {