<?php
namespace app\admin\controller;

use app\admin\BaseController;
use app\common\model\Config as ConfigModel;

class Chuanglansms extends BaseController
{
	
	public function index()
	{
		$sms = ConfigModel::getConfigValue(['sms_chuanglan_appkey','sms_chuanglan_secret']);
		return view('set/chuanglansms',[
			'sms' => $sms
		]);
	}
	
	public function editSms()
	{
		$data = array(
			'sms_chuanglan_appkey'		=> input('sms_chuanglan_appkey/s'),
			'sms_chuanglan_secret'	=> input('sms_chuanglan_secret/s'),
		);
        ConfigModel::setConfigValue($data);
		exit(json_encode(array(
			'code' 	=> 0,
			'msg'   => ""
		)));
	}
	
}
	