mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]修改微信模块
This commit is contained in:
parent
5281569ff5
commit
d628e54ef9
@ -66,6 +66,17 @@ class Keys extends BasicAdmin {
|
||||
return $this->_form($this->table, 'form', 'id');
|
||||
}
|
||||
|
||||
|
||||
protected function _form_filter($data) {
|
||||
if ($this->request->isPost() && isset($data['keys'])) {
|
||||
$db = Db::name($this->table)->where('keys', $data['keys']);
|
||||
!empty($data['id']) && $db->where('id', 'neq', $data['id']);
|
||||
if ($db->count() > 0) {
|
||||
$this->error('关键字已经存在,请使用其它关键字!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除关键字
|
||||
*/
|
||||
|
@ -51,7 +51,7 @@
|
||||
<div class="nowrap">
|
||||
<input title="apiclient_key.pem" type="hidden" name="wechat_cert_key_md5">
|
||||
<input title="apiclient_cert.pem" type="hidden" name="wechat_cert_cert_md5">
|
||||
<button data-file="one" data-type="pem" data-field="wechat_cert_key_md5"
|
||||
<button data-file="one" data-type="pem" data-field="wechat_cert_key_md5" data-uptype="local"
|
||||
type="button" class="layui-btn layui-btn-primary">
|
||||
{if file_exists(sysconf('wechat_cert_key'))}
|
||||
已上传 apiclient_key.pem
|
||||
@ -59,7 +59,7 @@
|
||||
请上传 apiclient_key.pem
|
||||
{/if}
|
||||
</button>
|
||||
<button data-file="one" data-type="pem" data-field="wechat_cert_cert_md5"
|
||||
<button data-file="one" data-type="pem" data-field="wechat_cert_cert_md5" data-uptype="local"
|
||||
type="button" class="layui-btn layui-btn-primary">
|
||||
{if file_exists(sysconf('wechat_cert_cert'))}
|
||||
已上传 apiclient_cert.pem
|
||||
|
@ -26,19 +26,20 @@
|
||||
<td class="text-center">{$vo.type}</td>
|
||||
<td class="text-center">
|
||||
{if $vo.type eq '音乐'}
|
||||
<a class="btn btn-link" data-tips-text="预览" data-tips-placement="bottom"
|
||||
data-phone-view='{:url("@wechat/review")}&type=music&title={$vo.music_title}&desc={$vo.music_desc}'>
|
||||
<i class="fa fa-eye"></i> 预览
|
||||
<a data-phone-view='{:url("@wechat/review")}?type=music&title={$vo.music_title}&desc={$vo.music_desc}'
|
||||
class="btn btn-link"><i class="fa fa-eye"></i> 预览
|
||||
</a>
|
||||
{elseif $vo.type eq '图片'}
|
||||
<a data-phone-view='{:url("@wechat/review")}?type=image&title={$vo.image_url}'
|
||||
class="btn btn-link"><i class="fa fa-eye"></i> 预览
|
||||
</a>
|
||||
{elseif $vo.type eq '图文'}
|
||||
<a class="btn btn-link" data-tips-text="预览" data-tips-placement="bottom"
|
||||
data-phone-view='{:url("@wechat/review")}&type=news&content={$vo.news_id}'>
|
||||
<i class="fa fa-eye"></i> 预览
|
||||
<a data-phone-view='{:url("@wechat/review")}?type=news&content={$vo.news_id}'
|
||||
class="btn btn-link"><i class="fa fa-eye"></i> 预览
|
||||
</a>
|
||||
{elseif $vo.type eq '视频'}
|
||||
<a class="btn btn-link" data-tips-text="预览" data-tips-placement="bottom"
|
||||
data-phone-view='{:url("@wechat/review")}&type=video&title={$vo.video_title}&desc={$vo.video_desc}&url={$vo.video_url}'>
|
||||
<i class="fa fa-eye"></i> 预览
|
||||
<a data-phone-view='{:url("@wechat/review")}?type=video&title={$vo.video_title}&desc={$vo.video_desc}&url={$vo.video_url}'
|
||||
class="btn btn-link"><i class="fa fa-eye"></i> 预览
|
||||
</a>
|
||||
{else}
|
||||
{$vo.content}
|
||||
@ -46,14 +47,18 @@
|
||||
</td>
|
||||
<td class="text-center">{$vo.create_at}</td>
|
||||
<td class='text-center nowrap'>
|
||||
|
||||
{if auth("$classuri/edit")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-open='{:url("@wechat/keys/edit")}?id={$vo.id}'>编辑</a>
|
||||
<a data-open='{:url("edit")}?id={$vo.id}'>编辑</a>
|
||||
{/if}
|
||||
|
||||
{if auth("$classuri/del")}
|
||||
<span class="text-explode">|</span>
|
||||
<a data-delete='{$vo.id}' data-action='{:url("@wechat/keys/del")}' href="javascript:void(0)">删除</a>
|
||||
<a data-update="{$vo.id}" data-field='delete' data-action='{:url("del")}'
|
||||
href="javascript:void(0)">删除</a>
|
||||
{/if}
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
|
8
composer.lock
generated
8
composer.lock
generated
@ -455,12 +455,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zoujingli/wechat-php-sdk.git",
|
||||
"reference": "bb509f17ad860322b39a607731c37adbd8f21e75"
|
||||
"reference": "38f86a42b1c0058d889a0969190540037629606a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://files.phpcomposer.com/files/zoujingli/wechat-php-sdk/bb509f17ad860322b39a607731c37adbd8f21e75.zip",
|
||||
"reference": "bb509f17ad860322b39a607731c37adbd8f21e75",
|
||||
"url": "https://files.phpcomposer.com/files/zoujingli/wechat-php-sdk/38f86a42b1c0058d889a0969190540037629606a.zip",
|
||||
"reference": "38f86a42b1c0058d889a0969190540037629606a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -481,7 +481,7 @@
|
||||
"keywords": [
|
||||
"wechat-php-sdk"
|
||||
],
|
||||
"time": "2017-04-17 09:22:40"
|
||||
"time": "2017-04-19 13:34:58"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
|
@ -72,7 +72,6 @@ class WechatService {
|
||||
# 上传图片素材
|
||||
$result = $wechat->uploadForeverMedia(array('media' => "@{$upload['file']}"), $type, $is_video, $video_info);
|
||||
# 删除本地文件
|
||||
@unlink($filename);
|
||||
if (false !== $result) {
|
||||
$data = ['md5' => $md5, 'type' => $type, 'appid' => $wechat->appid, 'media_id' => $result['media_id'], 'local_url' => $local_url,];
|
||||
isset($result['url']) && $data['media_url'] = $result['url'];
|
||||
|
2
vendor/autoload.php
vendored
2
vendor/autoload.php
vendored
@ -4,4 +4,4 @@
|
||||
|
||||
require_once __DIR__ . '/composer/autoload_real.php';
|
||||
|
||||
return ComposerAutoloaderInita5b88035fa8b1d8f6696f1aa3e286eea::getLoader();
|
||||
return ComposerAutoloaderInitf55cea7455d6b0f7edeb2950251d39c5::getLoader();
|
||||
|
14
vendor/composer/autoload_real.php
vendored
14
vendor/composer/autoload_real.php
vendored
@ -2,7 +2,7 @@
|
||||
|
||||
// autoload_real.php @generated by Composer
|
||||
|
||||
class ComposerAutoloaderInita5b88035fa8b1d8f6696f1aa3e286eea
|
||||
class ComposerAutoloaderInitf55cea7455d6b0f7edeb2950251d39c5
|
||||
{
|
||||
private static $loader;
|
||||
|
||||
@ -19,15 +19,15 @@ class ComposerAutoloaderInita5b88035fa8b1d8f6696f1aa3e286eea
|
||||
return self::$loader;
|
||||
}
|
||||
|
||||
spl_autoload_register(array('ComposerAutoloaderInita5b88035fa8b1d8f6696f1aa3e286eea', 'loadClassLoader'), true, true);
|
||||
spl_autoload_register(array('ComposerAutoloaderInitf55cea7455d6b0f7edeb2950251d39c5', 'loadClassLoader'), true, true);
|
||||
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInita5b88035fa8b1d8f6696f1aa3e286eea', 'loadClassLoader'));
|
||||
spl_autoload_unregister(array('ComposerAutoloaderInitf55cea7455d6b0f7edeb2950251d39c5', 'loadClassLoader'));
|
||||
|
||||
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION');
|
||||
if ($useStaticLoader) {
|
||||
require_once __DIR__ . '/autoload_static.php';
|
||||
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInita5b88035fa8b1d8f6696f1aa3e286eea::getInitializer($loader));
|
||||
call_user_func(\Composer\Autoload\ComposerStaticInitf55cea7455d6b0f7edeb2950251d39c5::getInitializer($loader));
|
||||
} else {
|
||||
$map = require __DIR__ . '/autoload_namespaces.php';
|
||||
foreach ($map as $namespace => $path) {
|
||||
@ -48,19 +48,19 @@ class ComposerAutoloaderInita5b88035fa8b1d8f6696f1aa3e286eea
|
||||
$loader->register(true);
|
||||
|
||||
if ($useStaticLoader) {
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInita5b88035fa8b1d8f6696f1aa3e286eea::$files;
|
||||
$includeFiles = Composer\Autoload\ComposerStaticInitf55cea7455d6b0f7edeb2950251d39c5::$files;
|
||||
} else {
|
||||
$includeFiles = require __DIR__ . '/autoload_files.php';
|
||||
}
|
||||
foreach ($includeFiles as $fileIdentifier => $file) {
|
||||
composerRequirea5b88035fa8b1d8f6696f1aa3e286eea($fileIdentifier, $file);
|
||||
composerRequiref55cea7455d6b0f7edeb2950251d39c5($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
}
|
||||
}
|
||||
|
||||
function composerRequirea5b88035fa8b1d8f6696f1aa3e286eea($fileIdentifier, $file)
|
||||
function composerRequiref55cea7455d6b0f7edeb2950251d39c5($fileIdentifier, $file)
|
||||
{
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
require $file;
|
||||
|
8
vendor/composer/autoload_static.php
vendored
8
vendor/composer/autoload_static.php
vendored
@ -4,7 +4,7 @@
|
||||
|
||||
namespace Composer\Autoload;
|
||||
|
||||
class ComposerStaticInita5b88035fa8b1d8f6696f1aa3e286eea
|
||||
class ComposerStaticInitf55cea7455d6b0f7edeb2950251d39c5
|
||||
{
|
||||
public static $files = array (
|
||||
'9b552a3cc426e3287cc811caefa3cf53' => __DIR__ . '/..' . '/topthink/think-helper/src/helper.php',
|
||||
@ -313,9 +313,9 @@ class ComposerStaticInita5b88035fa8b1d8f6696f1aa3e286eea
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInita5b88035fa8b1d8f6696f1aa3e286eea::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInita5b88035fa8b1d8f6696f1aa3e286eea::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInita5b88035fa8b1d8f6696f1aa3e286eea::$classMap;
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInitf55cea7455d6b0f7edeb2950251d39c5::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInitf55cea7455d6b0f7edeb2950251d39c5::$prefixDirsPsr4;
|
||||
$loader->classMap = ComposerStaticInitf55cea7455d6b0f7edeb2950251d39c5::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
8
vendor/composer/installed.json
vendored
8
vendor/composer/installed.json
vendored
@ -49,18 +49,18 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zoujingli/wechat-php-sdk.git",
|
||||
"reference": "bb509f17ad860322b39a607731c37adbd8f21e75"
|
||||
"reference": "38f86a42b1c0058d889a0969190540037629606a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://files.phpcomposer.com/files/zoujingli/wechat-php-sdk/bb509f17ad860322b39a607731c37adbd8f21e75.zip",
|
||||
"reference": "bb509f17ad860322b39a607731c37adbd8f21e75",
|
||||
"url": "https://files.phpcomposer.com/files/zoujingli/wechat-php-sdk/38f86a42b1c0058d889a0969190540037629606a.zip",
|
||||
"reference": "38f86a42b1c0058d889a0969190540037629606a",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3"
|
||||
},
|
||||
"time": "2017-04-17 09:22:40",
|
||||
"time": "2017-04-19 13:34:58",
|
||||
"type": "project",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
|
@ -153,7 +153,6 @@ class Tools {
|
||||
$value = new CURLFile(realpath(trim($value, '@')));
|
||||
}
|
||||
}
|
||||
$data = http_build_query($data);
|
||||
}
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
||||
$data = curl_exec($ch);
|
||||
|
Loading…
x
Reference in New Issue
Block a user