@freelog/tools-lib 0.1.147 → 0.1.148
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/dist/tools-lib.cjs.development.js +16 -2
- package/dist/tools-lib.cjs.development.js.map +1 -1
- package/dist/tools-lib.cjs.production.min.js +1 -1
- package/dist/tools-lib.cjs.production.min.js.map +1 -1
- package/dist/tools-lib.esm.js +16 -2
- package/dist/tools-lib.esm.js.map +1 -1
- package/dist/utils/tools.d.ts +5 -0
- package/package.json +1 -1
- package/src/i18n/I18nNext.ts +155 -155
- package/src/utils/tools.ts +8 -0
|
@@ -2821,6 +2821,19 @@ function promiseSleep(ms) {
|
|
|
2821
2821
|
}, ms);
|
|
2822
2822
|
});
|
|
2823
2823
|
}
|
|
2824
|
+
/**
|
|
2825
|
+
* 获取用户头像URL
|
|
2826
|
+
* @param userID
|
|
2827
|
+
*/
|
|
2828
|
+
|
|
2829
|
+
function getAvatarUrl(userID) {
|
|
2830
|
+
if (userID === void 0) {
|
|
2831
|
+
userID = 0;
|
|
2832
|
+
}
|
|
2833
|
+
|
|
2834
|
+
// return `${completeUrlByDomain('image')}/headImage/${userID || getUserIDByCookies()}?t=${Date.now()}`;
|
|
2835
|
+
return "https://image.freelog.com/headImage/" + (userID || getUserIDByCookies()) + "?t=" + Date.now();
|
|
2836
|
+
}
|
|
2824
2837
|
|
|
2825
2838
|
var Tool = {
|
|
2826
2839
|
__proto__: null,
|
|
@@ -2828,7 +2841,8 @@ var Tool = {
|
|
|
2828
2841
|
generateRandomCode: generateRandomCode,
|
|
2829
2842
|
getUserIDByCookies: getUserIDByCookies,
|
|
2830
2843
|
transformServerAPIContractState: transformServerAPIContractState,
|
|
2831
|
-
promiseSleep: promiseSleep
|
|
2844
|
+
promiseSleep: promiseSleep,
|
|
2845
|
+
getAvatarUrl: getAvatarUrl
|
|
2832
2846
|
};
|
|
2833
2847
|
|
|
2834
2848
|
function getFilesSha1Info(_x, _x2) {
|
|
@@ -3259,7 +3273,7 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3259
3273
|
}();
|
|
3260
3274
|
|
|
3261
3275
|
_proto.t = function t(key, options) {
|
|
3262
|
-
return i18next.t(key, options);
|
|
3276
|
+
return i18next.t(key.trim(), options);
|
|
3263
3277
|
};
|
|
3264
3278
|
|
|
3265
3279
|
_proto.changeLanguage = function changeLanguage(lng) {
|