/**
* 密码加密算法
* @param string $password 加密前密码
* @return string 加密后密码
* @author panjie@yunzhiclub.com http://www.mengyunzhi.com
* @DateTime 2016-10-21T09:26:18+0800
*/
static public function encryptPassword($password)
{
if (!is_string($password)) {
throw new \RuntimeException("传入变量类型非字符串,错误码2", 2);
}
// 实际的过程中,我还还可以借助其它字符串算法,来实现不同的加密。
return sha1(md5($password) . 'mengyunzhi');
}里面的这个运行时异常类是项目用户自定义的异常类吗?还是TP5自带的异常类 throw new \RuntimeException("传入变量类型非字符串,错误码2", 2); 最佳答案