企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# 第二课常用函数 ### 微擎常用不需要加载自带函数 ``` <pre class="calibre14">``` 写入cookie 过期时间秒<span class="token2">,</span><span class="token3">0</span>表示跟随浏览器<span class="token2">,</span><span class="token3">false</span><span class="token2">,</span>不允许js读取 <span class="token1">isetcookie</span><span class="token2">(</span>$key<span class="token2">,</span> $value<span class="token2">,</span> $expire <span class="token">=</span> <span class="token3">0</span><span class="token2">,</span> $httponly <span class="token">=</span> <span class="token3">false</span><span class="token2">)</span> 获取客户端IP $ip <span class="token">=</span> <span class="token1">getip</span><span class="token2">(</span><span class="token2">)</span><span class="token2">;</span> 随机字符串<span class="token2">,</span><span class="token3">6</span>是长度<span class="token2">,</span><span class="token3">1</span>为是否数字<span class="token2">,</span> <span class="token1">random</span><span class="token2">(</span><span class="token3">6</span><span class="token2">,</span><span class="token3">true</span><span class="token2">)</span><span class="token2">;</span> 获取表明 <span class="token1">tablename</span><span class="token2">(</span><span class="token4">'account'</span><span class="token2">)</span> c、a、<span class="token5">do</span><span class="token2">,</span>a为<span class="token1">webapp</span><span class="token2">(</span>PC<span class="token2">)</span>、<span class="token1">wxapp</span><span class="token2">(</span>小程序<span class="token2">)</span> <span class="token1">site</span><span class="token2">(</span>公众号<span class="token2">)</span> 生成如下地址 <span class="token3">true</span>不带微信拼接字符<span class="token2">,</span>第二个<span class="token3">true</span>表示添加域名 <span class="token1">murl</span><span class="token2">(</span><span class="token4">'entry/site/fm'</span><span class="token2">,</span><span class="token2">[</span><span class="token4">'m'</span><span class="token">=</span><span class="token">></span><span class="token4">'yoby_test'</span><span class="token2">]</span><span class="token2">,</span><span class="token3">false</span><span class="token2">,</span><span class="token3">true</span><span class="token2">)</span> 一般手机端 $this<span class="token">-</span><span class="token">></span><span class="token1">createMobileUrl</span><span class="token2">(</span><span class="token4">'rank'</span><span class="token2">,</span><span class="token2">[</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span> $this<span class="token">-</span><span class="token">></span><span class="token1">createWebUrl</span><span class="token2">(</span><span class="token4">'rank'</span><span class="token2">,</span><span class="token2">[</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span> <span class="token1">wurl</span><span class="token2">(</span><span class="token4">'site/entry/rank'</span><span class="token2">,</span><span class="token2">[</span><span class="token4">'m'</span><span class="token">=</span><span class="token">></span><span class="token4">'yoby_test'</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span><span class="token6">//后台管理</span> 分页 <span class="token1">pagination</span><span class="token2">(</span>$total<span class="token2">,</span> $pageIndex<span class="token2">,</span> $pageSize <span class="token">=</span> <span class="token3">15</span><span class="token2">)</span><span class="token2">;</span> 返回媒体或图片路径 <span class="token1">tomedia</span><span class="token2">(</span>$src<span class="token2">)</span> 查找字符串 <span class="token1">strexists</span><span class="token2">(</span><span class="token4">'helloworld'</span><span class="token2">,</span> <span class="token4">'h'</span><span class="token2">)</span><span class="token2">;</span> 截取字符串 <span class="token1">cutstr</span><span class="token2">(</span>$string<span class="token2">,</span>$length<span class="token2">,</span> TRUE<span class="token2">,</span><span class="token4">'utf-8'</span><span class="token2">)</span><span class="token2">;</span> 计算字符串长度<span class="token2">,</span>中英文都为<span class="token3">1</span> <span class="token1">istrlen</span><span class="token2">(</span><span class="token4">'hello-微擎'</span><span class="token2">)</span><span class="token2">;</span> 字符串加密或解密<span class="token2">,</span>默认解密<span class="token2">,</span>ENCODE加密<span class="token2">,</span>key秘钥<span class="token2">,</span><span class="token3">0</span>过期时间 <span class="token1">authcode</span><span class="token2">(</span>$string<span class="token2">,</span> $operation <span class="token">=</span> <span class="token4">'DECODE'</span><span class="token2">,</span> $key <span class="token">=</span> <span class="token4">''</span><span class="token2">,</span> $expiry <span class="token">=</span> <span class="token3">0</span><span class="token2">)</span> <span class="token1">emoji_unicode_decode</span><span class="token2">(</span><span class="token2">)</span>emoji_unicode_encode 解码emoji <span class="token1">get_first_pinyin</span><span class="token2">(</span>$str<span class="token2">)</span>拼音首字母 ihtml_entity_decode 显示html array2xml xml2array xml数组互换 ``` ``` web默认加载,微信端也有以下函数 ``` <pre class="calibre14">``` 第二个参数为空<span class="token2">,</span>不跳转<span class="token2">,</span>warning警告<span class="token2">,</span>error错误<span class="token2">,</span>info提示<span class="token2">,</span>ajax <span class="token1">message</span><span class="token2">(</span><span class="token4">'成功'</span><span class="token2">,</span> <span class="token1">referer</span><span class="token2">(</span><span class="token2">)</span><span class="token2">,</span> <span class="token4">'success'</span><span class="token2">)</span><span class="token2">;</span> ajax 返回 <span class="token2">{</span><span class="token4">"message"</span><span class="token2">:</span><span class="token4">"\u6210\u529f"</span><span class="token2">,</span><span class="token4">"redirect"</span><span class="token2">:</span><span class="token4">""</span><span class="token2">,</span><span class="token4">"type"</span><span class="token2">:</span><span class="token4">"ajax"</span><span class="token2">}</span> 模板加载 <span class="token1">template</span><span class="token2">(</span><span class="token4">'common/template'</span><span class="token2">)</span><span class="token2">;</span> <span class="token1">iajax</span><span class="token2">(</span>code<span class="token2">,</span>message<span class="token2">,</span>redirect<span class="token2">)</span><span class="token2">;</span>参数<span class="token3">2</span>支持数组或字符串 <span class="token1">itoast</span><span class="token2">(</span><span class="token4">"配置保存成功"</span><span class="token2">,</span> <span class="token1">referer</span><span class="token2">(</span><span class="token2">)</span><span class="token2">,</span> <span class="token4">'success'</span><span class="token2">)</span><span class="token2">;</span> ``` ``` ### 文件操作函数 ``` <pre class="calibre14">``` <span class="token1">load</span><span class="token2">(</span><span class="token2">)</span><span class="token">-</span><span class="token">></span><span class="token1">func</span><span class="token2">(</span><span class="token4">'file'</span><span class="token2">)</span><span class="token2">;</span> <span class="token1">file_copy</span><span class="token2">(</span>IA_ROOT <span class="token2">.</span> <span class="token4">'/web'</span><span class="token2">,</span> IA_ROOT <span class="token2">.</span> <span class="token4">'/data'</span><span class="token2">,</span> <span class="token1">array</span><span class="token2">(</span><span class="token4">'php'</span><span class="token2">)</span><span class="token2">)</span> 文件复制 过滤php <span class="token1">file_delete</span><span class="token2">(</span><span class="token4">'test.png'</span><span class="token2">)</span><span class="token2">;</span> <span class="token1">file_image_crop</span><span class="token2">(</span>IA_ROOT <span class="token2">.</span> <span class="token4">'/test.png'</span><span class="token2">,</span> IA_ROOT <span class="token2">.</span> <span class="token4">'/test2.png'</span><span class="token2">,</span> <span class="token3">50</span><span class="token2">,</span> <span class="token3">50</span><span class="token2">)</span><span class="token2">;</span> 剪切 <span class="token1">file_image_thumb</span><span class="token2">(</span>IA_ROOT <span class="token2">.</span> <span class="token4">'/test.png'</span><span class="token2">,</span> IA_ROOT <span class="token2">.</span> <span class="token4">'/test2.png'</span><span class="token2">,</span> <span class="token3">500</span><span class="token2">)</span><span class="token2">;</span> 生成缩率图 最后是宽 <span class="token1">file_move</span><span class="token2">(</span>IA_ROOT <span class="token2">.</span> <span class="token4">'/test.log'</span><span class="token2">,</span> IA_ROOT <span class="token2">.</span> <span class="token4">'/web/test.log'</span><span class="token2">)</span><span class="token2">;</span>文件移动 <span class="token1">file_upload</span><span class="token2">(</span>$_FILE<span class="token2">[</span><span class="token4">'test'</span><span class="token2">]</span><span class="token2">,</span> <span class="token4">'image'</span><span class="token2">,</span> <span class="token4">'test.png'</span><span class="token2">)</span><span class="token2">;</span> 上传 <span class="token1">file_write</span><span class="token2">(</span>IA_ROOT <span class="token2">.</span> <span class="token4">'/test.log'</span><span class="token2">,</span> <span class="token4">'hello-world'</span><span class="token2">)</span><span class="token2">;</span>文件写入 <span class="token1">mkdirs</span><span class="token2">(</span>IA_ROOT <span class="token2">.</span> <span class="token4">'/web/hello/world/example'</span><span class="token2">)</span><span class="token2">;</span>创建目录 file_remote_delete远程删除 写入远程 $filename <span class="token">=</span><span class="token4">"images/$weid/yoby_tougao_"</span><span class="token2">.</span>$snid<span class="token2">.</span><span class="token4">'.jpg'</span><span class="token2">;</span> <span class="token1">file_write</span><span class="token2">(</span>$filename<span class="token2">,</span> $data<span class="token2">)</span><span class="token2">;</span> <span class="token5">if</span> <span class="token2">(</span><span class="token">!</span><span class="token1">empty</span><span class="token2">(</span>$_W<span class="token2">[</span><span class="token4">'setting'</span><span class="token2">]</span><span class="token2">[</span><span class="token4">'remote'</span><span class="token2">]</span><span class="token2">[</span><span class="token4">'type'</span><span class="token2">]</span><span class="token2">)</span><span class="token2">)</span> <span class="token2">{</span> <span class="token6">// 判断系统是否开启了远程附件</span> $remotestatus <span class="token">=</span> <span class="token1">file_remote_upload</span><span class="token2">(</span>$filename<span class="token2">)</span><span class="token2">;</span> <span class="token6">//上传图片到远程</span> <span class="token5">if</span> <span class="token2">(</span><span class="token1">is_error</span><span class="token2">(</span>$remotestatus<span class="token2">)</span><span class="token2">)</span> <span class="token2">{</span> <span class="token1">message</span><span class="token2">(</span><span class="token4">'远程附件上传失败,请检查配置并重新上传'</span><span class="token2">)</span> <span class="token2">;</span> <span class="token2">}</span> <span class="token2">}</span> ``` ``` ### http操作函数 ``` <pre class="calibre14">``` <span class="token1">load</span><span class="token2">(</span><span class="token2">)</span><span class="token">-</span><span class="token">></span><span class="token1">func</span><span class="token2">(</span><span class="token4">'communication'</span><span class="token2">)</span><span class="token2">;</span> $result <span class="token">=</span> <span class="token1">ihttp_get</span><span class="token2">(</span><span class="token4">'http://x.com'</span><span class="token2">)</span><span class="token2">[</span><span class="token4">'content'</span><span class="token2">]</span><span class="token2">;</span> 文件上传@<span class="token">+</span>绝对路径 $result <span class="token">=</span> <span class="token1">ihttp_post</span><span class="token2">(</span><span class="token4">'https://www.baidu.com'</span><span class="token2">,</span> <span class="token1">array</span><span class="token2">(</span><span class="token4">'username'</span> <span class="token">=</span><span class="token">></span> <span class="token4">'we7'</span><span class="token2">)</span><span class="token2">)</span><span class="token2">;</span> 高级请求<span class="token2">,</span>第三个参数附加传入 <span class="token1">ihttp_request</span><span class="token2">(</span>$url<span class="token2">,</span> $post <span class="token">=</span> <span class="token4">''</span><span class="token2">,</span> $extra <span class="token">=</span> <span class="token1">array</span><span class="token2">(</span><span class="token2">)</span><span class="token2">,</span> $timeout <span class="token">=</span> <span class="token3">60</span><span class="token2">)</span> ``` ``` 记录日志 ``` <pre class="calibre14">``` <span class="token1">load</span><span class="token2">(</span><span class="token2">)</span><span class="token">-</span><span class="token">></span><span class="token1">func</span><span class="token2">(</span><span class="token4">'logging'</span><span class="token2">)</span><span class="token2">;</span> <span class="token1">logging_run</span><span class="token2">(</span><span class="token4">'记录字符串日志数据'</span><span class="token2">)</span><span class="token2">;</span> <span class="token1">logging_run</span><span class="token2">(</span><span class="token2">[</span><span class="token3">1</span><span class="token2">,</span><span class="token3">2</span><span class="token2">,</span><span class="token3">3</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span> ``` ``` 用户中心 ``` <pre class="calibre14">``` <span class="token1">load</span><span class="token2">(</span><span class="token2">)</span><span class="token">-</span><span class="token">></span><span class="token1">model</span><span class="token2">(</span><span class="token4">'mc'</span><span class="token2">)</span><span class="token2">;</span> 检测是否登录<span class="token2">,</span>没登陆跳到登陆 <span class="token1">checkauth</span><span class="token2">(</span><span class="token2">)</span><span class="token2">;</span>用于微信端 <span class="token1">checklogin</span><span class="token2">(</span><span class="token2">)</span>用于web openid转换uid $uid <span class="token">=</span> $_W<span class="token2">[</span><span class="token4">'member'</span><span class="token2">]</span><span class="token2">[</span><span class="token4">'uid'</span><span class="token2">]</span><span class="token2">;</span> Array <span class="token2">(</span> <span class="token2">[</span>uid<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">10128</span> <span class="token2">[</span>realname<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 用户昵称 <span class="token2">[</span>mobile<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 手机号码 <span class="token2">[</span>email<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 邮箱 <span class="token2">[</span>groupid<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 用户组ID <span class="token2">[</span>groupname<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 用户组名称 <span class="token2">[</span>credit1<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 积分 <span class="token2">[</span>credit2<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 余额 <span class="token2">[</span>credit3<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 其它积分 <span class="token2">[</span>credit4<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 其它积分 <span class="token2">[</span>credit5<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 其它积分 <span class="token2">[</span>credit6<span class="token2">]</span> <span class="token">=</span><span class="token">></span> 其它积分 <span class="token2">)</span> $uid <span class="token">=</span> <span class="token1">mc_openid2uid</span><span class="token2">(</span>$openid<span class="token2">)</span><span class="token2">;</span> $openid <span class="token">=</span> <span class="token1">mc_uid2openid</span><span class="token2">(</span>$uid<span class="token2">)</span><span class="token2">;</span> <span class="token1">mc_credit_update</span><span class="token2">(</span>$uid<span class="token2">,</span><span class="token4">'credit2'</span><span class="token2">,</span> <span class="token">-</span><span class="token3">10</span><span class="token2">,</span><span class="token2">[</span>$uid<span class="token2">,</span><span class="token4">'测试减少10积分'</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span><span class="token6">//增减积分</span> $num <span class="token">=</span> <span class="token1">mc_credit_fetch</span><span class="token2">(</span>$uid<span class="token2">,</span><span class="token2">[</span><span class="token4">'credit2'</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span><span class="token6">//查询积分</span> 积分通知 <span class="token1">mc_notice_credit1</span><span class="token2">(</span>$openid<span class="token2">,</span> $uid<span class="token2">,</span> <span class="token3">10</span><span class="token2">,</span> <span class="token4">'充值积分到账10分'</span><span class="token2">,</span> $url <span class="token">=</span> <span class="token4">'http://w.cn'</span><span class="token2">,</span> $remark <span class="token">=</span> <span class="token4">'谢谢惠顾,点击查看详情'</span><span class="token2">)</span><span class="token2">;</span> 弹出填写信息 <span class="token1">mc_require</span><span class="token2">(</span>$openid<span class="token2">,</span><span class="token2">[</span><span class="token4">'realname'</span><span class="token2">,</span> <span class="token4">'mobile'</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span> 更新填写信息 <span class="token1">mc_update</span><span class="token2">(</span>$openid<span class="token2">,</span><span class="token2">[</span><span class="token4">'email'</span> <span class="token">=</span><span class="token">></span> <span class="token4">'test@163.com'</span><span class="token2">]</span><span class="token2">)</span><span class="token2">;</span> 查询用户信息uid<span class="token2">,</span>返回字段 <span class="token1">mc_fansinfo</span><span class="token2">(</span>$uidoropenid<span class="token2">)</span> Oauth获取用户信息 <span class="token1">mc_oauth_userinfo</span><span class="token2">(</span>$acid<span class="token2">)</span> 通过openid获取 <span class="token1">mc_oauth_fans</span><span class="token2">(</span>$openid<span class="token2">)</span> 查询用户信息 <span class="token1">mc_fetch</span><span class="token2">(</span>$uid<span class="token">/</span>openid<span class="token2">,</span><span class="token2">[</span><span class="token2">]</span><span class="token2">)</span>返回字段 uid<span class="token2">,</span>mobile<span class="token2">,</span>credit1积分<span class="token2">,</span>credit2余额<span class="token2">,</span>realname<span class="token2">,</span>nickname<span class="token2">,</span>avatar<span class="token2">,</span>gender <span class="token3">1</span>男<span class="token3">2</span>女<span class="token2">,</span>residecity市 ``` ``` 自定义函数 ``` <pre class="calibre14">``` 微信中做了base64的加密字符串解密<span class="token2">,</span>解密之前不需要base64解密 <span class="token1">openssl_decrypt</span><span class="token2">(</span>$wechat_data<span class="token2">[</span><span class="token4">'req_info'</span><span class="token2">]</span><span class="token2">,</span> <span class="token4">"AES-256-ECB"</span><span class="token2">,</span> <span class="token1">md5</span><span class="token2">(</span><span class="token4">'appid'</span><span class="token2">)</span><span class="token2">)</span><span class="token2">;</span> serialize unserialize 序列化 <span class="token1">extract</span><span class="token2">(</span>$arr<span class="token2">)</span><span class="token2">;</span><span class="token1">compact</span><span class="token2">(</span><span class="token4">'a'</span><span class="token2">,</span><span class="token4">'b'</span><span class="token2">,</span><span class="token4">'c'</span><span class="token2">,</span><span class="token4">'d'</span><span class="token2">,</span><span class="token4">'i'</span><span class="token2">)</span><span class="token2">;</span>解码成字符串 <span class="token1">explode</span><span class="token2">(</span><span class="token4">'-'</span><span class="token2">,</span><span class="token4">'1-2-3-4'</span><span class="token2">)</span><span class="token2">;</span><span class="token6">//分割成数组</span> <span class="token1">implode</span><span class="token2">(</span><span class="token4">'-'</span><span class="token2">,</span>$arr<span class="token2">)</span><span class="token2">;</span><span class="token6">//转换成字符串</span> <span class="token1">mb_convert_encoding</span><span class="token2">(</span><span class="token4">'李太白'</span><span class="token2">,</span><span class="token4">"utf-8"</span><span class="token2">,</span><span class="token4">'auto'</span><span class="token2">)</span><span class="token2">;</span>自动转换成uft8 <span class="token1">foreach</span><span class="token2">(</span>$list as <span class="token">&</span>$row<span class="token2">)</span><span class="token2">{</span> 处理数据 <span class="token2">}</span> <span class="token1">unset</span><span class="token2">(</span>$row<span class="token2">)</span><span class="token2">;</span> ``` ``` 支付几种返回 ``` <pre class="calibre16">``` $wechat <span class="token">=</span> <span class="token1">uni_setting</span><span class="token2">(</span><span class="token3">1</span><span class="token2">,</span> <span class="token1">array</span><span class="token2">(</span><span class="token4">'payment'</span><span class="token2">)</span><span class="token2">)</span><span class="token2">;</span> 借用返回 Array <span class="token2">(</span> <span class="token2">[</span>payment<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array <span class="token2">(</span> <span class="token2">[</span>credit<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array <span class="token2">(</span> <span class="token2">[</span>switch<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token2">)</span> <span class="token2">[</span>alipay<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array <span class="token2">(</span> <span class="token2">[</span>switch<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token2">[</span>account<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token2">[</span>partner<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token2">[</span>secret<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token2">)</span> <span class="token2">[</span>wechat<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array <span class="token2">(</span> <span class="token2">[</span>switch<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">2</span> <span class="token2">[</span>account<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">1</span> <span class="token2">[</span>signkey<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token2">[</span>partner<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token2">[</span>key<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token2">[</span>borrow<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">2</span> <span class="token2">)</span> <span class="token2">[</span>delivery<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array <span class="token2">(</span> <span class="token2">[</span>switch<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token2">)</span> <span class="token2">)</span> <span class="token2">)</span> 本身返回 Array <span class="token2">(</span> <span class="token2">[</span>payment<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array <span class="token2">(</span> <span class="token2">[</span>wechat<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array <span class="token2">(</span> <span class="token2">[</span>switch<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">1</span> <span class="token2">[</span>version<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">2</span> <span class="token2">[</span>apikey<span class="token2">]</span> <span class="token">=</span><span class="token">></span> J8BNZ88rR8hhHH9Z7bqhbB57HbQOp3F9 <span class="token2">[</span>mchid<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">1493418902</span> <span class="token2">[</span>account<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">2</span> <span class="token2">[</span>signkey<span class="token2">]</span> <span class="token">=</span><span class="token">></span> J8BNZ88rR8hhHH9Z7bqhbB57HbQOp3F9 <span class="token2">)</span> <span class="token2">)</span> <span class="token2">)</span> 非支付id返回 Array <span class="token2">(</span> <span class="token2">[</span>payment<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array <span class="token2">(</span> <span class="token2">[</span>wechat<span class="token2">]</span> <span class="token">=</span><span class="token">></span> Array <span class="token2">(</span> <span class="token2">[</span>switch<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">2</span> <span class="token2">[</span>borrow<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">2</span> <span class="token2">[</span>account<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token3">3</span> <span class="token2">[</span>signkey<span class="token2">]</span> <span class="token">=</span><span class="token">></span> <span class="token2">)</span> <span class="token2">)</span> <span class="token2">)</span> ``` ```