|
|
setting.html代码:
- {template 'common/header'}
- <div class="main">
- <div class="alert alert-info" role="alert">参数设置说明:<br />
- <p>1、短信模板采用通用验证码模板,请在阿里云提交模板时复制下方引号内的短信模板内容到阿里云;短信签名需要是阿里云审核通过的签名;{$settings['key']}</p>
- <p>2、短信模板内容:“您的验证码是:${code},5分钟内有效,请不要告诉其他人。”;</p>
- </div>
- <iframe src="{$iframe}" marginheight="0" marginwidth="0" frameborder="0" width="100%" style="height:900px;" scrolling="yes" allowTransparency="true"></iframe>
- </div>
-
- {template 'common/footer'}
复制代码 module.php代码:
- <?php
- /**
- * wc_aliyun模块定义
- *
- * @author winchung
- * @url
- */
- defined('IN_IA') or exit('Access Denied');
- class Wc_aliyunModule extends WeModule {
- public function settingsDisplay($settings) {
- global $_W, $_GPC;
- load()->classs('cloudapi');
- $api = new CloudApi(true);
- $iframe = $api->url('debug', 'settingsDisplay', array(
- 'referer' => urlencode($_W['siteurl']),
- 'version' => $this->module['version'],
- 'v' => random(3),
- ), 'html');
- if (is_error($iframe)) {
- message($iframe['message'], '', 'error');
- }
- if($_W['ispost']) {
- $settings = $_GPC['setting'];
- $setting = $api->post('debug', 'saveSettings', array('setting' => $settings, 'version' => $this->module['version'], 'v' => random(3),), 'json');
- if (is_error($setting)) {
- die("<script>alert('{$setting['message']}');location.href = '{$iframe}';</script>");
- }
-
- $this->saveSettings($settings);
- die("<script>location.href = '{$iframe}';</script>");
- }
- include $this->template('setting');
- }
- }
复制代码 参数本地存储到ims_uni_account_modules表中,我们使用$this->module['config'][字段名]进行调用即可!
|
|