Selaa lähdekoodia

新增微信分享

HW 4 vuotta sitten
vanhempi
commit
094466872b

+ 3 - 1
js/admin/index/content.jsx

@@ -57,6 +57,8 @@ import Product from '@/administration/weapp/product';
 import Pay from '@/administration/weapp/pay';
 //产品类型
 import ProductSort from '@/administration/weapp/productSort';
+//产品分享
+import WeappShare from '@/administration/weapp/weappShare';
 
 
 const { Content } = Layout;
@@ -89,7 +91,7 @@ export default class ContentRouter extends React.Component {
                     <Route path="/pay" component={Pay} />
                     <Route path="/product" component={Product} />
                     <Route path="/productSort" component={ProductSort} />
-
+                    <Route path="/weappShare" component={WeappShare} />
 
                     <Route path="/jzmList" component={JzmList} />
                     <Route path="/mcjList" component={McjList} />

+ 5 - 0
js/admin/menu.jsx

@@ -51,6 +51,11 @@ module.exports = {
             icon: "database"
         },
         {
+            name: "微信分享",
+            url: "weappShare",
+            icon: "database"
+        },
+        {
             name: "产品类型管理",
             url: "productSort",
             icon: "database"

+ 319 - 0
js/component/administration/weapp/product/addShare.jsx

@@ -0,0 +1,319 @@
+import React,{Component} from 'react';
+import SpinContainer from "../../../SpinContainer";
+import {Button, Form, Icon, Input, message, Modal, Select, Upload} from "antd";
+import {beforeUploadFile,splitUrl} from "@/tools.js";
+import Editors from "@/richTextEditors";
+import $ from "jquery/src/ajax";
+
+const FormItem = Form.Item;
+
+//上传图片组件
+const PicturesWall = React.createClass({
+    getInitialState() {
+        return {
+            previewVisible: false,
+            previewImage: "",
+            fileList: this.props.pictureUrl,
+            type:''
+        };
+    },
+    getDefaultProps() {
+        return {
+            changeClick: this.modifyChange
+        };
+    },
+    handleCancel() {
+        this.setState({ previewVisible: false });
+    },
+    handlePreview(file) {
+        let type = '';
+
+        if(file.type){
+            let str = file.type;
+            let index = str.indexOf("/");
+            type =str.substring(0,index) === 'video' ? 1 : str.substring(0,index) === 'audio' ? 2 : 0;
+        }else{
+            // let str = file.url || file.thumbUrl;
+            // let index = str.lastIndexOf(".");
+            // type = str.substring(index+1);
+            type = this.props.type;
+        }
+        this.setState({
+            type,
+            previewImage: file.url || file.thumbUrl,
+            previewVisible: true
+        });
+    },
+    handleChange(info) {
+        let fileList = info.fileList;
+        this.setState({ fileList });
+        this.props.fileList(fileList);
+    },
+    componentWillReceiveProps(nextProps) {
+        this.state.fileList = nextProps.pictureUrl;
+    },
+    render() {
+        const { previewVisible, previewImage, fileList } = this.state;
+        const uploadButton = (
+            <div>
+                <Icon type="plus" />
+                <div className="ant-upload-text">点击上传</div>
+            </div>
+        );
+        return (
+            <div style={{ display: "inline-block" }}>
+                <Upload
+                    accept={
+                        this.props.type === 0 ? "image/*" :
+                            this.props.type === 1 ?
+                                'video/mp4,video/rmvb,video/mkv,video/avi' :
+                                this.props.type === 2 ?
+                                "audio/mp3" : '*'}
+                    beforeUpload={beforeUploadFile}
+                    action={globalConfig.context + "/api/admin/project/uploadFile"}
+                    data={{ sign: "purchase_picture" }}
+                    listType="picture-card"
+                    fileList={fileList}
+                    onPreview={this.handlePreview}
+                    onChange={this.handleChange}
+                >
+                    {fileList && fileList.length >= 1 ? null : uploadButton}
+                </Upload>
+                <Modal
+                    maskClosable={false}
+                    visible={previewVisible}
+                    footer={null}
+                    onCancel={this.handleCancel}
+                >
+                    {
+                        this.state.type=== 0 ?
+                            <img alt="" style={{ width: "100%" }} src={previewImage} /> :
+                            this.state.type=== 1 ?
+                                <video style={{width:'100%'}} controls="controls" autoPlay="" name="media">
+                                    <source src={previewImage} type="video/mp4"/>
+                                </video>:
+                                this.state.type=== 2 ?
+                                    <audio src={previewImage} controls="controls">Your browser does not support the audio element.</audio>: ''
+                    }
+                </Modal>
+            </div>
+        );
+    }
+});
+
+class Add extends Component{
+    constructor(props) {
+        super(props);
+        this.state={
+            loading: false,
+            projectType: props.shareType || '',
+            name:'',
+            pictureImgUrl: '',
+            shareImgUrl:'',
+            shareId:'',
+        }
+        this.getOrgCodeUrl = this.getOrgCodeUrl.bind(this);
+        this.getShareOrgCodeUrl = this.getShareOrgCodeUrl.bind(this);
+        this.onOk = this.onOk.bind(this);
+        this.getWeChatShareDetals = this.getWeChatShareDetals.bind(this);
+    }
+
+    componentDidMount() {
+        if(this.props.id || this.props.shareId){
+            this.getWeChatShareDetals();
+        }
+    }
+
+    getOrgCodeUrl(e) {
+        this.setState({ pictureImgUrl: e });
+    }
+
+    getShareOrgCodeUrl(e) {
+        this.setState({ shareImgUrl: e });
+    }
+
+    onOk(){
+        if(!this.state.name){
+            message.warning('请输入分享标题');
+            return false;
+        }
+        if(isNaN(parseInt(this.state.projectType))){
+            message.warning('请选择分享位置');
+            return false;
+        }
+        if(this.state.pictureImgUrl.length === 0){
+            message.warning('请上传朋友分享图');
+            return false;
+        }
+        if(this.state.shareImgUrl.length === 0){
+            message.warning('请上传朋友圈分享图');
+            return false;
+        }
+        this.setState({
+            loading: true
+        });
+        let url = this.state.shareId ? "/api/admin/weChatShare/update" : "/api/admin/weChatShare/add"
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + url,
+            data: {
+                pid: this.props.id || undefined,       //项目编号
+                id: this.state.shareId || undefined,
+                title: this.state.name || undefined,
+                shareUrl: this.state.pictureImgUrl[0].response.data || undefined,
+                momentsUrl: this.state.shareImgUrl[0].response.data || undefined,
+                type: this.state.projectType,
+            },
+            success: function(data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                } else {
+                    message.success(this.state.shareId ? '修改成功' : '添加成功');
+                    this.props.onOk();
+                }
+            }.bind(this)
+        }).always(
+            function() {
+                this.setState({
+                    loading: false
+                });
+            }.bind(this)
+        );
+    }
+
+    getWeChatShareDetals() {
+        this.setState({
+            loading: true
+        });
+        let data = {};
+        if(this.props.id){
+            data.pid = this.props.id
+        }else if(this.props.shareId){
+            data.id = this.props.shareId
+        }
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/weChatShare/details",
+            data: data
+        }).done((data1) => {
+            if (data1.error.length !== 0) {
+                message.warning(data1.error[0].message);
+            } else {
+                if(data1.data){
+                    this.setState({
+                        name: data1.data.title,
+                        projectType: data1.data.type,
+                        pictureImgUrl: data1.data.shareUrl ? splitUrl(data1.data.shareUrl, ',', globalConfig.avatarHost + '/upload') : [],
+                        shareImgUrl: data1.data.momentsUrl ? splitUrl(data1.data.momentsUrl, ',', globalConfig.avatarHost + '/upload') : [],
+                        shareId:data1.data.id,
+                    })
+                }
+            }
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this))
+    }
+
+    render() {
+        return (
+            <Modal
+                className="customeDetails"
+                title={this.state.shareId ? "修改分享" : "添加分享"}
+                okText={"保存"}
+                width="1050"
+                visible={this.props.visible}
+                onCancel={this.props.onCancel}
+                footer={false}
+            >
+                <Form
+                    layout="horizontal"
+                    id="demand-form"
+                >
+                    <SpinContainer spinning={this.state.loading}>
+                        <div className="clearfix">
+                            <FormItem
+                                className="half-item"
+                                labelCol={{ span: 8 }}
+                                wrapperCol={{ span: 12 }}
+                                label="转发标题"
+                            >
+                                <Input
+                                    placeholder="请输入转发标题"
+                                    value={this.state.name}
+                                    onChange={(e) => {
+                                        this.setState({ name: e.target.value });
+                                    }}
+                                />
+                            </FormItem>
+                            {!this.props.shareType ? <FormItem
+                                className="half-item"
+                                labelCol={{ span: 8 }}
+                                wrapperCol={{ span: 12 }}
+                                label="分享位置"
+                            >
+                                <Select
+                                    value={this.state.projectType}
+                                    placeholder="请选择分享位置"
+                                    onChange={e => {
+                                        this.setState({
+                                            projectType: e
+                                        });
+                                    }}
+                                >
+                                    <Option value={1}>首页</Option>
+                                </Select>
+                            </FormItem> : null}
+                            <div className="clearfix">
+                                <FormItem
+                                    className="half-item"
+                                    labelCol={{ span: 8 }}
+                                    wrapperCol={{ span: 12 }}
+                                    label="朋友分享图"
+                                    extra='图片长宽比是 5:4,建议尺寸660*528'
+                                >
+                                    <PicturesWall
+                                        type={0}
+                                        fileList={this.getOrgCodeUrl}
+                                        pictureUrl={this.state.pictureImgUrl}
+                                    />
+                                </FormItem>
+                            </div>
+                            <div className="clearfix">
+                                <FormItem
+                                    className="half-item"
+                                    labelCol={{ span: 8 }}
+                                    wrapperCol={{ span: 12 }}
+                                    label="朋友圈分享图"
+                                    extra='图片长宽比是 1:1,会自动收缩,尺寸大小影响不大'
+                                >
+                                    <PicturesWall
+                                        type={0}
+                                        fileList={this.getShareOrgCodeUrl}
+                                        pictureUrl={this.state.shareImgUrl}
+                                    />
+                                </FormItem>
+                            </div>
+                        </div>
+                        <div style={{display:'flex',justifyContent: 'center'}}>
+                            <Button
+                                type="primary"
+                                onClick={()=>{
+                                    this.onOk();
+                                }}>
+                                保存
+                            </Button>
+                        </div>
+                    </SpinContainer>
+                </Form>
+            </Modal>
+        )
+    }
+}
+
+export default Add;

+ 31 - 2
js/component/administration/weapp/product/index.jsx

@@ -4,6 +4,7 @@ import SpinContainer from "../../../SpinContainer";
 import $ from "jquery/src/ajax";
 import moment from "moment";
 import Add from './add';
+import AddShare from './AddShare';
 import {getPicPath} from "@/tools.js";
 
 const { RangePicker } = DatePicker;
@@ -159,6 +160,16 @@ class Product extends Component{
                                         {record.host === 0 ? "推荐首页" : '首页撤下'}
                                     </Button>
                                 </Popconfirm>
+                                <Button
+                                    type="primary"
+                                    style={{ marginLeft: 10,background:'#2aaf65' }}
+                                    onClick={(e) => {
+                                        e.stopPropagation();
+                                        this.shareEdit(record);
+                                    }}
+                                >
+                                    编辑分享
+                                </Button>
                             </div>
                         );
                     }
@@ -178,6 +189,7 @@ class Product extends Component{
                 }
             },
             visible:false,
+            shareVisible:false,
 
         }
         this.search = this.search.bind(this);
@@ -187,6 +199,7 @@ class Product extends Component{
         this.addProduct = this.addProduct.bind(this);
         this.onCancel = this.onCancel.bind(this);
         this.edit = this.edit.bind(this);
+        this.shareEdit = this.shareEdit.bind(this);
         this.delete = this.delete.bind(this);
         this.homeOperation = this.homeOperation.bind(this);
     }
@@ -203,7 +216,6 @@ class Product extends Component{
     }
 
     tableRowClick(value){
-        console.log(value)
         this.setState({
             visible:true,
             id:value.id,
@@ -219,6 +231,14 @@ class Product extends Component{
         })
     }
 
+    shareEdit(value){
+        this.setState({
+            shareVisible:true,
+            id:value.id,
+            infor:value,
+        })
+    }
+
     loadData(pageNo = 1) {
         this.setState({
             loading: true
@@ -258,13 +278,14 @@ class Product extends Component{
     }
 
     addProduct(){
-        this.setState({visible:false});
+        this.setState({visible:false,shareVisible:false});
         this.loadData(this.state.pageNo)
     }
 
     onCancel(){
         this.setState({
             visible:false,
+            shareVisible:false,
             id:'',
             infor:'',
         })
@@ -382,6 +403,14 @@ class Product extends Component{
                     onOk={this.addProduct}
                     onCancel={this.onCancel}
                 /> : null}
+                {this.state.shareVisible ? <AddShare
+                    shareType='0'
+                    id={this.state.id}
+                    infor={this.state.infor}
+                    visible={this.state.shareVisible}
+                    onOk={this.addProduct}
+                    onCancel={this.onCancel}
+                /> : null}
                 <Modal
                     visible={this.state.imgeditvisible}
                     onCancel={()=>{this.imghandleCancel()}}

+ 389 - 0
js/component/administration/weapp/weappShare/index.jsx

@@ -0,0 +1,389 @@
+import React,{Component}from 'react';
+import {Button, DatePicker, Icon, Input, message, Modal, Popconfirm, Select, Table} from "antd";
+import SpinContainer from "../../../SpinContainer";
+import $ from "jquery/src/ajax";
+import moment from "moment";
+import AddShare from '../product/addShare';
+import {getPicPath} from "@/tools.js";
+
+const { RangePicker } = DatePicker;
+
+class WeappShare extends Component{
+    constructor(props) {
+        super(props);
+        this.state={
+            pageNo: 1,
+            searchUserName: '',
+            projectType: '',
+            loading: false,
+            imgeditvisible: false,
+            maximg: '',
+            columns:[
+                {
+                    title: '序号',
+                    dataIndex: 'key',
+                    key: 'key'
+                },
+                {
+                    title: '分享标题',
+                    dataIndex: 'title',
+                    key: 'title',
+                },
+                {
+                    title: '分享位置',
+                    dataIndex: 'type',
+                    key: 'type',
+                    render: type => (
+                        type === 0 ? '项目详情' :
+                            type === 1 ? '首页' : ''
+                    )
+                },
+                {
+                    title: '朋友分享缩略图',
+                    dataIndex: 'shareUrl',
+                    key: 'shareUrl',
+                    render: url => {
+                        let path = getPicPath(globalConfig.avatarUploadHost, url);
+                        return (
+                            <div style={{
+                                display: 'flex',
+                                alignItems: 'center',
+                            }}>
+                                <img src={path} style={{ width: "100px", height: 50 }} />
+                                <Button
+                                    className="buttonimg"
+                                    style={{ marginLeft: 10 }}
+                                    onClick={e => {
+                                        e.stopPropagation();
+                                        this.setState({
+                                            imgeditvisible: true,
+                                            maximg: path,
+                                        })
+                                    }}
+                                >
+                                    查看大图
+                                </Button>
+                            </div>
+                        );
+                    }
+                },
+                {
+                    title: '朋友圈分享缩略图',
+                    dataIndex: 'momentsUrl',
+                    key: 'momentsUrl',
+                    render: url => {
+                        let path = getPicPath(globalConfig.avatarUploadHost, url);
+                        return (
+                            <div style={{
+                                display: 'flex',
+                                alignItems: 'center',
+                            }}>
+                                <img src={path} style={{ width: "100px", height: 50 }} />
+                                <Button
+                                    className="buttonimg"
+                                    style={{ marginLeft: 10 }}
+                                    onClick={e => {
+                                        e.stopPropagation();
+                                        this.setState({
+                                            imgeditvisible: true,
+                                            maximg: path,
+                                        })
+                                    }}
+                                >
+                                    查看大图
+                                </Button>
+                            </div>
+                        );
+                    }
+                },
+                {
+                    title: "操作",
+                    dataIndex: "aab",
+                    key: "aab",
+                    render: (text, record) => {
+                        return (
+                            <div>
+                                <Button
+                                    type="primary"
+                                    onClick={(e) => {
+                                        e.stopPropagation();
+                                        this.edit(record);
+                                    }}
+                                >
+                                    编辑
+                                </Button>
+                                <Popconfirm
+                                    placement="top"
+                                    title={"是否确认删除?"}
+                                    onConfirm={e => {
+                                        e.stopPropagation();
+                                        this.delete(record.id);
+                                    }}
+                                    okText="确认"
+                                    cancelText="取消"
+                                >
+                                    <Button
+                                        type="primary"
+                                        style={{ marginLeft: 10,background:'#f00' }}
+                                        onClick={(e)=>{
+                                            e.stopPropagation();
+                                        }}
+                                    >
+                                        删除
+                                    </Button>
+                                </Popconfirm>
+                            </div>
+                        );
+                    }
+                }
+            ],
+            dataSource:[],
+            pagination: {
+                defaultCurrent: 1,
+                defaultPageSize: 10,
+                showQuickJumper: true,
+                pageSize: 10,
+                onChange: function (page) {
+                    this.loadData(page);
+                }.bind(this),
+                showTotal: function (total) {
+                    return '共' + total + '条数据';
+                }
+            },
+            visible:false,
+
+        }
+        this.search = this.search.bind(this);
+        this.reset = this.reset.bind(this);
+        this.tableRowClick = this.tableRowClick.bind(this);
+        this.loadData = this.loadData.bind(this);
+        this.addProduct = this.addProduct.bind(this);
+        this.onCancel = this.onCancel.bind(this);
+        this.edit = this.edit.bind(this);
+        this.delete = this.delete.bind(this);
+        this.homeOperation = this.homeOperation.bind(this);
+    }
+
+    search(){this.loadData();}
+
+    reset(){
+        this.setState({
+            projectType:'',
+            searchUserName: '',
+        },()=>{
+            this.loadData();
+        })
+    }
+
+    tableRowClick(value){
+        console.log(value)
+        this.setState({
+            visible:true,
+            id:value.pid,
+            shareType:value.type+'',
+            infor:value,
+            shareId:value.id,
+        })
+    }
+
+    edit(value){
+        this.setState({
+            visible:true,
+            id:value.pid,
+            infor:value,
+            shareType:value.type+'',
+            shareId:value.id,
+        })
+    }
+
+    loadData(pageNo = 1) {
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "get",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/weChatShare/pageList",
+            data: {
+                pageNo: pageNo || 1,
+                pageSize: 10,
+                name: this.state.searchUserName || undefined,
+                type: this.state.projectType,
+            }
+        }).done((data1) => {
+            if (data1.error.length !== 0) {
+                message.warning(data1.error[0].message);
+            } else {
+                for (let i = 0; i < data1.data.list.length; i++) {
+                    data1.data.list[i].key = (data1.data.pageNo-1)*10+(i+1);
+                }
+                this.state.pagination.current = data1.data.pageNo;
+                this.state.pagination.total = data1.data.totalCount;
+            }
+            this.setState({
+                dataSource: data1.data.list,
+                pagination: this.state.pagination,
+                pageNo: data1.data.pageNo
+            });
+        }).always(function () {
+            this.setState({
+                loading: false
+            });
+        }.bind(this))
+    }
+
+    addProduct(){
+        this.setState({visible:false,shareType:'',shareId:''});
+        this.loadData(this.state.pageNo)
+    }
+
+    onCancel(){
+        this.setState({
+            visible:false,
+            id:'',
+            infor:'',
+            shareType:'',
+            shareId:'',
+        })
+    }
+
+    homeOperation(id,host){
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/project/update",
+            data: {
+                id,
+                host
+            },
+            success: function(data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                } else {
+                    message.warning('操作成功');
+                    this.loadData(this.state.pageNo);
+                }
+            }.bind(this)
+        }).always(
+            function() {
+                this.setState({
+                    loading: false
+                });
+            }.bind(this)
+        );
+    }
+
+    delete(id){
+        this.setState({
+            loading: true
+        });
+        $.ajax({
+            method: "post",
+            dataType: "json",
+            crossDomain: false,
+            url: globalConfig.context + "/api/admin/weChatShare/delete",
+            data: {
+                id
+            },
+            success: function(data) {
+                if (data.error && data.error.length) {
+                    message.warning(data.error[0].message);
+                } else {
+                    message.warning('删除成功');
+                    this.loadData(this.state.pageNo);
+                }
+            }.bind(this)
+        }).always(
+            function() {
+                this.setState({
+                    loading: false
+                });
+            }.bind(this)
+        );
+    }
+
+    componentDidMount() {
+        this.loadData();
+    }
+
+    imghandleCancel() {
+        this.setState({
+            imgeditvisible: false
+        });
+    }
+
+    render() {
+        return (
+            <div className="user-content" >
+                <div className="content-title">
+                    <span>小程序分享管理</span>
+                </div>
+                <div className="user-search">
+                    <Input
+                        placeholder="请输入分享标题"
+                        value={this.state.searchUserName}
+                        onChange={(e) => { this.setState({ searchUserName: e.target.value }); }}
+                        style={{
+                            marginRight: "10px",
+                            marginBottom: "10px"
+                        }}
+                    />
+                    <Select
+                        style={{width:130}}
+                        value={this.state.projectType || undefined}
+                        placeholder="请选择分享位置"
+                        onChange={e => {
+                            this.setState({
+                                projectType: e
+                            });
+                        }}
+                    >
+                        <Option value={0}>项目详情</Option>
+                        <Option value={1}>首页</Option>
+                    </Select>
+                    <Button type="primary" onClick={this.search} style={{marginLeft:'10px'}}>搜索</Button>
+                    <Button onClick={this.reset}>重置</Button>
+                    <Button
+                        type="primary"
+                        onClick={()=>{this.setState({visible:true,shareType: '',shareId:''})}}
+                        style={{ marginLeft: "100px" }}
+                    >
+                        新增分享
+                    </Button>
+                </div>
+                <div className="patent-table">
+                    <SpinContainer spinning={this.state.loading}>
+                        <Table columns={this.state.columns}
+                               dataSource={this.state.dataSource}
+                               pagination={this.state.pagination}
+                               onRowClick={this.tableRowClick} />
+                    </SpinContainer>
+                </div>
+                {this.state.visible ? <AddShare
+                    id={this.state.id}
+                    shareType={this.state.shareType}
+                    shareId={this.state.shareId}
+                    infor={this.state.infor}
+                    visible={this.state.visible}
+                    onOk={this.addProduct}
+                    onCancel={this.onCancel}
+                /> : null}
+                <Modal
+                    visible={this.state.imgeditvisible}
+                    onCancel={()=>{this.imghandleCancel()}}
+                    onOk={()=>{this.imghandleCancel()}}
+                    footer={false}
+                >
+                    <img style={{ width: "100%" }} src={this.state.maximg} />
+                </Modal>
+            </div >
+        )
+    }
+}
+
+export default WeappShare;

+ 12 - 0
js/component/richTextEditors.jsx

@@ -44,6 +44,10 @@ function uploadImg(s,_this) {
     let myform = new FormData()
     let file = document.getElementById(_this.props.id + "fileToUpload").files[0];
     if (!file) { return; };
+    if(file.size > 52428800){
+        message.warning('图片大小不能超过50M');
+        return
+    }
     myform.append('file', file);
     myform.append('sign', RichTextUploadSign);
     $.ajax({
@@ -102,6 +106,10 @@ function uploadAudio(s,_this) {
     let myform = new FormData()
     let file = document.getElementById(_this.props.id + "fileToUploadAudio").files[0]
     if (!file) { return; };
+    if(file.size > 52428800){
+        message.warning('音频大小不能超过50M');
+        return
+    }
     myform.append('file', file);
     myform.append('sign', RichTextUploadSign);
     $.ajax({
@@ -150,6 +158,10 @@ function uploadVideo(s,_this) {
     let myform = new FormData()
     let file = document.getElementById(_this.props.id + "fileToUploadVideo").files[0]
     if (!file) { return; };
+    if(file.size > 52428800){
+        message.warning('视频大小不能超过50M');
+        return
+    }
     myform.append('file', file);
     myform.append('sign', RichTextUploadSign);
     $.ajax({

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "afanti",
-  "version": "1.0.4",
+  "version": "1.0.3",
   "description": "",
   "main": "index.js",
   "scripts": {

+ 1 - 1
webpack-dll.config.js

@@ -10,7 +10,7 @@ let theme = {
     '@link-color': '#58a3ff'
 };
 module.exports = (function () {
-    let staticHost = 'http://172.16.0.254';
+    let staticHost = 'http://172.16.0.253';
     switch (argv.env.deploy) {
         case 'test':
             staticHost = 'http://statics.jishutao.com';