wjt
2024-06-26 59f4dc012a2c42eebd31301444e0f8df9af088e0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import {
    config
} from "@/common/config.js"
function getArrayImgPath(jsonArray, url) {
    var result = ''
    if (!jsonArray) {
        return "";
    }
    try {
        var json = JSON.parse(jsonArray)[0];
        var baseUrl = url || config.ftpUrl
        // var result = 'https://scstq.183.sc.cn/f-static' + json.path;//邮政
        result = baseUrl + json.path; //金明源
    } catch (e) {
        //TODO handle the exception
    }
 
    return result;
}
 
function getImgPath(jsonstr, url) {
    //if (jsonstr != null && jsonstr != 'null') {
    // }
    // var result = 'https://scstq.183.sc.cn/f-static' + jsonstr.path;//邮政
    var baseUrl = url || config.ftpUrl
    var result = baseUrl + jsonstr.path;
    return result;
}
 
module.exports = {
    getArrayImgPath: getArrayImgPath,
    getImgPath: getImgPath
}