|
1 | | -var abp = abp || {}; |
| 1 | +var abp = abp || {}; |
2 | 2 | (function () { |
3 | 3 |
|
4 | 4 | /* Application paths *****************************************/ |
|
55 | 55 |
|
56 | 56 | /* SESSION */ |
57 | 57 |
|
58 | | - abp.session = abp.session || { |
59 | | - multiTenancySide: abp.multiTenancy.sides.HOST |
60 | | - }; |
| 58 | + abp.session = abp.session || |
| 59 | + { |
| 60 | + multiTenancySide: abp.multiTenancy.sides.HOST |
| 61 | + }; |
61 | 62 |
|
62 | 63 | /* LOCALIZATION ***********************************************/ |
63 | 64 | //Implements Localization API that simplifies usage of localization scripts generated by Abp. |
|
104 | 105 |
|
105 | 106 | abp.localization.isCurrentCulture = function (name) { |
106 | 107 | return abp.localization.currentCulture |
107 | | - && abp.localization.currentCulture.name |
108 | | - && abp.localization.currentCulture.name.indexOf(name) == 0; |
109 | | - }; |
| 108 | + && abp.localization.currentCulture.name |
| 109 | + && abp.localization.currentCulture.name.indexOf(name) == 0; |
| 110 | + }; |
110 | 111 |
|
111 | 112 | abp.localization.defaultSourceName = undefined; |
112 | 113 | abp.localization.abpWeb = abp.localization.getSource('AbpWeb'); |
|
137 | 138 |
|
138 | 139 | abp.auth.isGranted = function (permissionName) { |
139 | 140 | return abp.auth.allPermissions[permissionName] != undefined && |
140 | | - abp.auth.grantedPermissions[permissionName] != undefined; |
141 | | - }; |
| 141 | + abp.auth.grantedPermissions[permissionName] != undefined; |
| 142 | + }; |
142 | 143 |
|
143 | 144 | abp.auth.isAnyGranted = function () { |
144 | 145 | if (!arguments || arguments.length <= 0) { |
|
176 | 177 |
|
177 | 178 | abp.auth.getToken = function () { |
178 | 179 | return abp.utils.getCookieValue(abp.auth.tokenCookieName); |
179 | | - } |
| 180 | + }; |
180 | 181 |
|
181 | 182 | abp.auth.clearToken = function () { |
182 | 183 | abp.auth.setToken(); |
183 | | - } |
| 184 | + }; |
| 185 | + |
| 186 | + abp.auth.refreshTokenCookieName = 'Abp.AuthRefreshToken'; |
| 187 | + |
| 188 | + abp.auth.setRefreshToken = function (refreshToken, expireDate) { |
| 189 | + abp.utils.setCookieValue(abp.auth.refreshTokenCookieName, refreshToken, expireDate, abp.appPath, abp.domain); |
| 190 | + }; |
| 191 | + |
| 192 | + abp.auth.getRefreshToken = function () { |
| 193 | + return abp.utils.getCookieValue(abp.auth.refreshTokenCookieName); |
| 194 | + }; |
| 195 | + |
| 196 | + abp.auth.clearRefreshToken = function () { |
| 197 | + abp.auth.setRefreshToken(); |
| 198 | + }; |
184 | 199 |
|
185 | 200 | /* FEATURE SYSTEM *********************************************/ |
186 | 201 | //Implements Features API that simplifies usage of feature scripts generated by Abp. |
|
280 | 295 |
|
281 | 296 | abp.notifications.messageFormatters['Abp.Notifications.LocalizableMessageNotificationData'] = |
282 | 297 | function (userNotification) { |
283 | | - var message = userNotification.notification.data.message || |
284 | | - userNotification.notification.data.properties.Message; |
285 | | - var localizedMessage = abp.localization.localize( |
286 | | - message.name, |
287 | | - message.sourceName |
288 | | - ); |
| 298 | + var message = userNotification.notification.data.message || |
| 299 | + userNotification.notification.data.properties.Message; |
| 300 | + var localizedMessage = abp.localization.localize( |
| 301 | + message.name, |
| 302 | + message.sourceName |
| 303 | + ); |
289 | 304 |
|
290 | 305 | if (userNotification.notification.data.properties) { |
291 | 306 | var properties = Object.keys(userNotification.notification.data.properties); |
|
396 | 411 |
|
397 | 412 | abp.message = abp.message || {}; |
398 | 413 |
|
399 | | - var showMessage = function (message, title) { |
| 414 | + var showMessage = function (message, title, options) { |
400 | 415 | alert((title || '') + ' ' + message); |
401 | 416 |
|
402 | 417 | }; |
|
510 | 525 | }; |
511 | 526 | })(); |
512 | 527 |
|
513 | | - |
514 | 528 | /* UTILS ***************************************************/ |
515 | 529 |
|
516 | 530 | abp.utils = abp.utils || {}; |
|
623 | 637 | includeQuestionMark = true; |
624 | 638 | } |
625 | 639 |
|
626 | | - |
627 | 640 | var qs = ''; |
628 | 641 |
|
629 | 642 | function addSeperator() { |
|
0 commit comments