要将这个方法中的image赋给前端字段,可以在方法外部定义一个前端字段,然后在方法内部给这个字段赋值。

例如,假设你想要将这个方法中的image赋给前端的一个字段叫做frontImage,可以按照以下方式修改代码:

var image = '';
var frontImage = '';

function getDoctorElectronicSignature(doctorId) {
    $http.get(Path.getUri('api/base/v2/staff-sign/detail?empId=' + doctorId))
        .success(function (data) {
            if (!HrStr.isNull(data)) {
                rotateBase64Img('data:image/*;base64,' + data.signImage, 270, function (child) {
                    if (!HrStr.isNull(child)) {
                        image = child.substring(22);
                        frontImage = image; // 将image赋给前端字段frontImage
                    }
                    //callback(image);
                    return image
                });
            } else {
                // callback(image);
                return image
            }
        });
}

在这个例子中,我们定义了一个前端字段frontImage,并在方法内部通过frontImage = image;image赋给了frontImage。这样,当方法执行完成后,frontImage就会被赋值为image的值。

var image = ; function getDoctorElectronicSignaturedoctorId $httpgetPathgetUriapibasev2staff-signdetailempId= + doctorId successfunction data if !

原文地址: https://www.cveoy.top/t/topic/jdmx 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录