@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.
- package/index.js +17 -9
- 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
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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 };
|