|
@@ -152,13 +152,13 @@ class Utils {
|
|
|
return format;
|
|
|
}
|
|
|
|
|
|
- static trimJsonStr(src){
|
|
|
- //所有"'" 替换为"\""
|
|
|
- if(typeof(src) == "string"){
|
|
|
- return src.replace(new RegExp("'","gm"), "\"");
|
|
|
+ static trimJsonStr(src){
|
|
|
+ //所有"'" 替换为"\""
|
|
|
+ if(typeof(src) == "string"){
|
|
|
+ return src.replace(new RegExp("'","gm"), "\"");
|
|
|
+ }
|
|
|
+ return src;
|
|
|
}
|
|
|
- return src;
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* @desc uuid生成器
|
|
@@ -187,25 +187,25 @@ class Utils {
|
|
|
return uuid.join('');
|
|
|
}
|
|
|
|
|
|
- static getUuidForWeb() {
|
|
|
- const uuid = Utils.uuid(32);
|
|
|
- const start = uuid.slice(0,8);
|
|
|
- const next = uuid.slice(8,12);
|
|
|
- const nextNext = uuid.slice(13,17);
|
|
|
- const last = uuid.slice(17,32);
|
|
|
- return `${start}-${next}-${nextNext}-${last}`;
|
|
|
- }
|
|
|
-
|
|
|
- static videoUrlFormat(url) {
|
|
|
- if (!url) { return; }
|
|
|
- if (url.startsWith('http')) {
|
|
|
- return url.replace('http://ljvideo', 'https://efunvideo');
|
|
|
- } else if (url.startsWith('https')) {
|
|
|
- return url;
|
|
|
- } else {
|
|
|
- return url;
|
|
|
- }
|
|
|
- }
|
|
|
+ static getUuidForWeb() {
|
|
|
+ const uuid = Utils.uuid(32);
|
|
|
+ const start = uuid.slice(0,8);
|
|
|
+ const next = uuid.slice(8,12);
|
|
|
+ const nextNext = uuid.slice(13,17);
|
|
|
+ const last = uuid.slice(17,32);
|
|
|
+ return `${start}-${next}-${nextNext}-${last}`;
|
|
|
+ }
|
|
|
+
|
|
|
+ static videoUrlFormat(url) {
|
|
|
+ if (!url) { return; }
|
|
|
+ if (url.startsWith('http')) {
|
|
|
+ return url.replace('http://ljvideo.ai160.com', Consts.VIDEO_PATH);
|
|
|
+ } else if (url.startsWith('https')) {
|
|
|
+ return url;
|
|
|
+ } else {
|
|
|
+ return url;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
export default Utils;
|