<?php
namespace app\admin\controller;

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

class Alisms extends BaseController
{
	
	public function index()
	{
		$alisms = ConfigModel::getConfigValue(['sms_ali_accesskeyid','sms_ali_accesskeysecret','sms_ali_signname','sms_ali_register','sms_ali_getpassword','sms_ali_mobilelogin']);
		return view('set/alisms',[
			'alisms' => $alisms 
		]);
	}
	
	public function editAlisms()
	{
		$data = array(
			'sms_ali_accesskeyid'		=> input('sms_ali_accesskeyid/s'),
			'sms_ali_accesskeysecret'	=> input('sms_ali_accesskeysecret/s'),
			'sms_ali_signname'			=> input('sms_ali_signname/s'),
			'sms_ali_register'			=> input('sms_ali_register/s'),
			'sms_ali_getpassword'		=> input('sms_ali_getpassword/s'),
			'sms_ali_mobilelogin'		=> input('sms_ali_mobilelogin/s')
		);
        ConfigModel::setConfigValue($data);
		exit(json_encode(array(
			'code' 	=> 0,
			'msg'   => ""
		)));
	}
	
}
	