Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

能否来个图片上传的后台接参demo #43

Closed
RsirJJ opened this issue Aug 4, 2017 · 5 comments
Closed

能否来个图片上传的后台接参demo #43

RsirJJ opened this issue Aug 4, 2017 · 5 comments

Comments

@RsirJJ
Copy link

RsirJJ commented Aug 4, 2017

No description provided.

@lgc1994
Copy link

lgc1994 commented Oct 16, 2017

同问

@hehaibao
Copy link

示例代码,可以参考一下,uploadUrl是接口路径,uploadField是上传图片的字段(post时会作为参数传过去)

$content.artEditor({
        imgTar: '#uploadfile', //图片上传按钮
        limitSize: 5, //默认限制图片最大5兆
        showServer: true, //显示从服务端返回的图片,默认是显示本地资源的图片
        uploadUrl: '/upload/steam',
        uploadField: 'image_code', //上传图片字段
        beforeUpload: function(code) {
            //上传前, 处理base64格式
            return code.split(',')[1];
        },
        uploadSuccess: function(result) {
            //上传成功后的操作
            toast('上传成功');
        },
        uploadError: function(status, error) {
            //这里做上传失败的操作
            toast(status);
        }
    });

@ha321456
Copy link

我也需要大神来个吧

@hehaibao
Copy link

hehaibao commented Jan 19, 2018 via email

@siliushi
Copy link
Owner

已经上传

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants