0
点赞
收藏
分享

微信扫一扫

Thinkphp+Vue,kotlin数据类

追风骚年 2022-02-02 阅读 66

    • 上传必看:
    • 1、只能上传jpg/png/gif类型的图片,且大小不能超过2MB;
    • 2、本页面功能方便用户快速批量上传固定金额的收款二维码;
    • 3、建议把金额设置为文件名称,方便系统自动识别输入固定收款金额;
    • 4、鼠标悬浮于收款码缩略图上,可以放大图片,方便查看收款码的金额;
    • 立即提交

      返回

      js部分:

      thinkphp后端控制器:

      public function upload() {

      if(request()->isPost()) {

      $postdata=input(‘post.’);

      //不限制最大执行时间

      ini_set(‘max_execution_time’,‘0’);

      //保存图片

      $path = ROOT_PATH . ‘public/uploads/usercode/’;

      if(!file_exists($path)) {

      mkdir($path,0777,true);

      }

      $alldata= array();

      $files = request()->file(‘image’);

      if($files) {

      foreach ($files as k e y = > key=> key=>file) {

      $itemdata= [

      ‘amount’ => p o s t d a t a [ ′ a m o u n t ′ ] [ postdata['amount'][ postdata[amount][key],

      ‘floating’ => p o s t d a t a [ ′ f l o a t i n g ′ ] [ postdata['floating'][ postdata[floating][key]

      ];

      //限制只能上传2MB图片

      $info = f i l e − > r u l e ( f u n c t i o n ( ) r e t u r n m d 5 ( m i c r o t i m e ( t r u e ) ) ; ) − > v a l i d a t e ( [ ′ s i z e ′ = > 1024 ∗ 1024 ∗ 2 , ′ e x t ′ = > file->rule(function() {return md5(microtime(true));})->validate(['size'=>1024*1024*2,'ext'=> file>rule(function()returnmd5(microtime(true));)>validate([size=>102410242,ext=>this->config[‘uploadtype’]])->move($path);

      最后

      针对Android程序员,我这边给大家整理了一些资料,包括不限于高级UI、性能优化、架构师课程、NDK、混合式开发(ReactNative+Weex)微信小程序、Flutter等全方面的Android进阶实践技术;希望能帮助到大家,也节省大家在网上搜索资料的时间来学习,也可以分享动态给身边好友一起学习!

      • Android前沿技术大纲

      • 全套体系化高级架构视频

      资料领取:点赞+点击GitHub免费获取

      9F%E5%A6%82%E4%BD%95%E9%9D%A2%E8%AF%95%E6%8B%BF%E9%AB%98%E8%96%AA%EF%BC%81.md)**

    举报

    相关推荐

    0 条评论