ncloudchat 0.0.26-beta → 0.0.27-beta
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/esm/mutations/user.js
CHANGED
|
@@ -44,6 +44,7 @@ export var login = function (user_id, name, profile, token) {
|
|
|
44
44
|
return __generator(this, function (_a) {
|
|
45
45
|
switch (_a.label) {
|
|
46
46
|
case 0:
|
|
47
|
+
CoreManager.set("TOKEN", token);
|
|
47
48
|
projectId = CoreManager.get("PROJECT_ID");
|
|
48
49
|
endpoint = CoreManager.get('SERVER_URL') + '/graphql';
|
|
49
50
|
mutation = "mutation login ($projectId: String!, $userId: String!, $name: String, $profile: String) {\n login(input :{ projectId: $projectId, userId:$userId, name:$name, profile:$profile}) {\n token\n }\n }";
|
|
@@ -71,8 +72,9 @@ export var login = function (user_id, name, profile, token) {
|
|
|
71
72
|
throw data.errors[0];
|
|
72
73
|
else if (data.message)
|
|
73
74
|
throw data;
|
|
74
|
-
else if (data.data.login.token)
|
|
75
|
+
else if (data.data.login.token) {
|
|
75
76
|
return data.data.login.token;
|
|
77
|
+
}
|
|
76
78
|
else
|
|
77
79
|
return false;
|
|
78
80
|
})];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/mutations/user.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,WAAW,MAAM,gBAAgB,CAAC;AACzC,MAAM,CAAC,IAAM,KAAK,GAAG,UAAO,OAAe,EAAE,IAAiB,EAAE,OAAmB,EAAE,KAAiB;IAAzD,qBAAA,EAAA,SAAiB;IAAE,wBAAA,EAAA,YAAmB;IAAE,sBAAA,EAAA,UAAiB;;;;;;
|
|
1
|
+
{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/mutations/user.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,WAAW,MAAM,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BACrB,CAAC,CAAC,EAAA;wBA/BF,sBAAO,SA+BL,EAAC;;;;CACN,CAAA"}
|
package/lib/mutations/user.js
CHANGED
|
@@ -181,6 +181,8 @@ var login = function login(user_id, name, profile, token) {
|
|
|
181
181
|
return __generator(this, function (_a) {
|
|
182
182
|
switch (_a.label) {
|
|
183
183
|
case 0:
|
|
184
|
+
_CoreManager["default"].set("TOKEN", token);
|
|
185
|
+
|
|
184
186
|
projectId = _CoreManager["default"].get("PROJECT_ID");
|
|
185
187
|
endpoint = _CoreManager["default"].get('SERVER_URL') + '/graphql';
|
|
186
188
|
mutation = "mutation login ($projectId: String!, $userId: String!, $name: String, $profile: String) {\n login(input :{ projectId: $projectId, userId:$userId, name:$name, profile:$profile}) {\n token\n }\n }";
|
|
@@ -206,7 +208,9 @@ var login = function login(user_id, name, profile, token) {
|
|
|
206
208
|
}).then(function (res) {
|
|
207
209
|
return res.json();
|
|
208
210
|
}).then(function (data) {
|
|
209
|
-
if (data.errors) throw data.errors[0];else if (data.message) throw data;else if (data.data.login.token)
|
|
211
|
+
if (data.errors) throw data.errors[0];else if (data.message) throw data;else if (data.data.login.token) {
|
|
212
|
+
return data.data.login.token;
|
|
213
|
+
} else return false;
|
|
210
214
|
})];
|
|
211
215
|
|
|
212
216
|
case 1:
|