@xuda.io/account_module 1.2.136 → 1.2.138

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 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -92,13 +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
- 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
- }
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
+ // }
102
102
 
103
103
  const ret2 = await db_module.save_couch_doc('xuda_accounts', account_obj);
104
104
  if (ret2.code > 0) {
@@ -444,6 +444,16 @@ exports.get_account_data = async function (req) {
444
444
  // }
445
445
  // }
446
446
 
447
+ if (!acc_obj.account_project_id && req.token_ret) {
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
+
447
457
  return ret;
448
458
  } catch (error) {
449
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.136",
3
+ "version": "1.2.138",
4
4
  "description": "Xuda Account Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {