This commit is contained in:
2022-09-08 16:43:38 +08:00
parent 2db27956f8
commit 3444b93c1c
10 changed files with 25 additions and 25 deletions

2
.env
View File

@@ -1 +1 @@
APP_DEBUG=true
APP_DEBUG=true

View File

@@ -161,9 +161,9 @@ use OSS\OssClient;
if (!function_exists('aliyun')) {
function aliyun($savePath, $category = '', $isunlink = false, $bucket = "hphb-storage")
{
$accessKeyId = env('aliyunsms.accessKeyId');//去阿里云后台获取秘钥
$accessKeySecret = env('aliyunsms.accesskey');//去阿里云后台获取秘钥
$endpoint = env('aliyunsms.oss_endpoint');//你的阿里云OSS地址
$accessKeyId = env('ALIYUNSMS.accessKeyId');//去阿里云后台获取秘钥
$accessKeySecret = env('ALIYUNSMS.accesskey');//去阿里云后台获取秘钥
$endpoint = env('ALIYUNSMS.oss_endpoint');//你的阿里云OSS地址
$ossClient = new OssClient($accessKeyId, $accessKeySecret, $endpoint);
// 判断bucketname是否存在不存在就去创建
if (!$ossClient->doesBucketExist($bucket)) {
@@ -172,7 +172,7 @@ if (!function_exists('aliyun')) {
$category = empty($category) ? $bucket : $category;
$savePath = str_replace("\\", "/", $savePath);
$object = '/' . $savePath;//想要保存文件的名称
$file = env("upload_directory").'\\' . $savePath;//文件路径,必须是本地的。
$file = env("UPLOAD_DIRECTORY").'\\' . $savePath;//文件路径,必须是本地的。
try {
echo 'bc';
@@ -185,7 +185,7 @@ if (!function_exists('aliyun')) {
} catch (OssException $e) {
echo $e->getErrorMessage();
}
$web = "https://hphb-storage.".env('aliyunsms.oss_endpoint').'/'.$object;//这里是你阿里云oss外网访问的Bucket域名
$web = "https://hphb-storage.".env('ALIYUNSMS.oss_endpoint').'/'.$object;//这里是你阿里云oss外网访问的Bucket域名
return $web;
}
}
@@ -194,13 +194,13 @@ if (!function_exists('aliyun')) {
function aliyun($localfile = '', $path = '')
{
$config = [
'access' => env('aliyunsms.accessKeyId'),
'access_key' => env('aliyunsms.accesskey'),
'access' => env('ALIYUNSMS.ACCESSKEYID'),
'access_key' => env('ALIYUNSMS.ACCESSKEY'),
'bucket' => 'hphb-storage',
'url' => 'https://oss-cn-beijing.aliyuncs.com'
];
$path = "r/".$localfile;
$localfile = env("upload_directory").'/' . $localfile;//文件路径,必须是本地的。
$localfile = env("UPLOAD_DIRECTORY").'/' . $localfile;//文件路径,必须是本地的。
if (!file_exists($localfile)) {
return ('Not found file');
}
@@ -255,7 +255,7 @@ function StudentToArray($list = []) : array {
"age"=>$vo['age'],
];
}
if(count($list)<env("page_count")){
if(count($list)<env("PAGE_COUNT")){
$result["lastIndex"] = 0;
}
return $result;

View File

@@ -66,7 +66,7 @@ class Article
$result['lastIndex'] = $vo['id'];
$result["list"][] = $vo;
}
if(count($list)<env("page_count")){
if(count($list)<env("PAGE_COUNT")){
$result["lastIndex"] = 0;
}
return show(SUCCESS_MESSAGE,SUCCESS_CODE,$result);
@@ -108,7 +108,7 @@ class Article
$result['lastIndex'] = $vo['id'];
$result["list"][] = $vo;
}
if(count($list)<env("page_count")){
if(count($list)<env("PAGE_COUNT")){
$result["lastIndex"] = 0;
}
return show(SUCCESS_MESSAGE,SUCCESS_CODE,$result);

View File

@@ -73,7 +73,7 @@ class Help
}
$result = [];
$list = Db::name("appHelp")->where("student_id",$student_id)->limit(env("page_count"))->order('count desc')->paginate([
"list_rows"=>env("page_count"),
"list_rows"=>env("PAGE_COUNT"),
"page"=>$lastIndex
]);

View File

@@ -30,7 +30,7 @@ class Ranking
}
$result = [];
$list = Db::name("student")->where($where)->limit(env("page_count"))->order('hot desc')->paginate([
"list_rows"=>env("page_count"),
"list_rows"=>env("PAGE_COUNT"),
"page"=>$lastIndex
]);

View File

@@ -32,7 +32,7 @@ class Sign
"identifier"=>$info['identifier'],
"nickname"=>$info['nickname'],
"mobile"=>$info['mobile'],
"avatar"=> env("admin_pannel_address") . $info['avatar'],
"avatar"=> env("ADMIN_PANNEL_ADDRESS") . $info['avatar'],
"gender"=>$info['gender'],
"birthday"=>$info['birthday'],
"age"=>$info['age'],
@@ -59,7 +59,7 @@ class Sign
"identifier"=>$info['identifier'],
"nickname"=>$info['nickname'],
"mobile"=>$info['mobile'],
"avatar"=> env("admin_pannel_address") . $info['avatar'],
"avatar"=> env("ADMIN_PANNEL_ADDRESS") . $info['avatar'],
"gender"=>$info['gender'],
"birthday"=>$info['birthday'],
"age"=>$info['age'],

View File

@@ -28,7 +28,7 @@ class Student
}
$result = [];
$list = Db::name("student")->where($where)->limit(env("page_count"))->order('hot desc')->paginate([
"list_rows"=>env("page_count"),
"list_rows"=>env("PAGE_COUNT"),
"page"=>$lastIndex
]);

View File

@@ -14,7 +14,7 @@ class Upload
return show("请选择图片!");
}
$file = $GLOBALS['data']['file'];
$dir = env('upload_directory');
$dir = env('UPLOAD_DIRECTORY');
if(!is_dir($dir)){
mkdir($dir, 0777, true);
}

View File

@@ -21,14 +21,14 @@ class Sms
*/
public static function sendmsg($number, $code, $signName='', $template='')
{
if(empty($signName)) $signName = env('aliyunsms.signName');
if(empty($template)) $template = env('aliyunsms.TemplateCode');
if(empty($signName)) $signName = env('ALIYUNSMS.SIGNNAME');
if(empty($template)) $template = env('ALIYUNSMS.TEMPLATECODE');
if (intval($number) == 0 || $code == "" || $signName == "" || $template == "") {
return ['code' => 0, 'message' => '参数不全'];
}
AlibabaCloud::accessKeyClient(env('aliyunsms.accessKeyId'), env('aliyunsms.accesskey'))
->regionId(env('aliyunsms.regionid'))
AlibabaCloud::accessKeyClient(env('ALIYUNSMS.ACCESSKEYID'), env('aliyunsms.accesskey'))
->regionId(env('ALIYUNSMS.REGIONID'))
->asDefaultClient();
try {
$result = AlibabaCloud::rpc()
@@ -39,7 +39,7 @@ class Sms
->host('dysmsapi.aliyuncs.com')
->options([
'query' => [
'RegionId' => env('aliyunsms.regionid'),
'RegionId' => env('ALIYUNSMS.REGIONID'),
'PhoneNumbers' => $number,
'SignName' => $signName,
'TemplateCode' => $template,
@@ -99,7 +99,7 @@ class Sms
if ($token == '') {
return ['code' => 0, 'message' => '参数不全'];
}
AlibabaCloud::accessKeyClient(env('aliyunsms.accessKeyId'), env('aliyunsms.accesskey'))
AlibabaCloud::accessKeyClient(env('ALIYUNSMS.ACCESSKEYID'), env('ALIYUNSMS.ACCESSKEY'))
->regionId('cn-hangzhou')
->asDefaultClient();
try {

View File

@@ -5,7 +5,7 @@
return [
// 默认语言
'default_lang' => env('lang.default_lang', 'zh-cn'),
'default_lang' => env('lang.DEFAULT_LANG', 'zh-cn'),
// 允许的语言列表
'allow_lang_list' => [],
// 多语言自动侦测变量名