<?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', 'examine_mobile']);
        return view('set/chuanglansms', [
            'sms' => $sms,
        ]);
    }

    public function editSms()
    {
        $data = [
            'sms_chuanglan_appkey' => input('sms_chuanglan_appkey/s'),
            'sms_chuanglan_secret' => input('sms_chuanglan_secret/s'),
            'examine_mobile'       => input('examine_mobile/s'),
        ];
        ConfigModel::setConfigValue($data);
        exit(json_encode([
            'code' => 0,
            'msg'  => "",
        ]));
    }

}
	