正在显示
5 个修改的文件
包含
11 行增加
和
6 行删除
@@ -9,6 +9,7 @@ use think\Cache; | @@ -9,6 +9,7 @@ use think\Cache; | ||
9 | use think\Config; | 9 | use think\Config; |
10 | use think\Db; | 10 | use think\Db; |
11 | use think\Lang; | 11 | use think\Lang; |
12 | +use app\admin\model\User; | ||
12 | 13 | ||
13 | /** | 14 | /** |
14 | * Ajax异步请求接口 | 15 | * Ajax异步请求接口 |
@@ -105,7 +106,7 @@ class Ajax extends Backend | @@ -105,7 +106,7 @@ class Ajax extends Backend | ||
105 | $imagewidth = isset($imgInfo[0]) ? $imgInfo[0] : $imagewidth; | 106 | $imagewidth = isset($imgInfo[0]) ? $imgInfo[0] : $imagewidth; |
106 | $imageheight = isset($imgInfo[1]) ? $imgInfo[1] : $imageheight; | 107 | $imageheight = isset($imgInfo[1]) ? $imgInfo[1] : $imageheight; |
107 | } | 108 | } |
108 | - $url = 'http://feipin.w.brotop.cn'.$uploadDir . $splInfo->getSaveName(); | 109 | + $url = User::DOMAIN.$uploadDir . $splInfo->getSaveName(); |
109 | $params = array( | 110 | $params = array( |
110 | 'admin_id' => (int)$this->auth->id, | 111 | 'admin_id' => (int)$this->auth->id, |
111 | 'user_id' => 0, | 112 | 'user_id' => 0, |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | 2 | ||
3 | namespace app\admin\library\traits; | 3 | namespace app\admin\library\traits; |
4 | 4 | ||
5 | +use app\admin\model\User; | ||
5 | trait Backend | 6 | trait Backend |
6 | { | 7 | { |
7 | 8 | ||
@@ -73,7 +74,7 @@ trait Backend | @@ -73,7 +74,7 @@ trait Backend | ||
73 | { | 74 | { |
74 | if ($this->request->isPost()) { | 75 | if ($this->request->isPost()) { |
75 | $params = $this->request->post("row/a"); | 76 | $params = $this->request->post("row/a"); |
76 | - $host = 'http://feipin.w.brotop.cn'; | 77 | + $host = User::DOMAIN; |
77 | if(isset($params['image']) && !empty($params['image'])){ | 78 | if(isset($params['image']) && !empty($params['image'])){ |
78 | $params['image'] = $host.$params['image']; | 79 | $params['image'] = $host.$params['image']; |
79 | } | 80 | } |
@@ -130,7 +131,7 @@ trait Backend | @@ -130,7 +131,7 @@ trait Backend | ||
130 | if ($this->request->isPost()) { | 131 | if ($this->request->isPost()) { |
131 | $params = $this->request->post("row/a"); | 132 | $params = $this->request->post("row/a"); |
132 | if ($params) { | 133 | if ($params) { |
133 | - $host = 'http://feipin.w.brotop.cn'; | 134 | + $host = User::DOMAIN; |
134 | if(isset($params['image']) && !empty($params['image'])){ | 135 | if(isset($params['image']) && !empty($params['image'])){ |
135 | if(strpos($params['image'],$host) !== false){ | 136 | if(strpos($params['image'],$host) !== false){ |
136 | //true | 137 | //true |
@@ -15,6 +15,9 @@ class User extends Model | @@ -15,6 +15,9 @@ class User extends Model | ||
15 | // 定义时间戳字段名 | 15 | // 定义时间戳字段名 |
16 | protected $createTime = 'createtime'; | 16 | protected $createTime = 'createtime'; |
17 | protected $updateTime = 'updatetime'; | 17 | protected $updateTime = 'updatetime'; |
18 | + | ||
19 | + //设置域名 | ||
20 | + CONST DOMAIN = 'http://feipin.w.brotop.cn'; | ||
18 | // 追加属性 | 21 | // 追加属性 |
19 | protected $append = [ | 22 | protected $append = [ |
20 | 'prevtime_text', | 23 | 'prevtime_text', |
@@ -148,7 +148,7 @@ class Person extends Api | @@ -148,7 +148,7 @@ class Person extends Api | ||
148 | $this->error('最多上传9张图片'); | 148 | $this->error('最多上传9张图片'); |
149 | } | 149 | } |
150 | $date = date('Ymd',time()); | 150 | $date = date('Ymd',time()); |
151 | - $host = config('site.hostUrl'); | 151 | + $host = \app\admin\model\User::DOMAIN; |
152 | $images = ''; | 152 | $images = ''; |
153 | foreach($files as $file){ | 153 | foreach($files as $file){ |
154 | //移动到框架应用根目录/public/uploads/ 目录下 | 154 | //移动到框架应用根目录/public/uploads/ 目录下 |
@@ -62,8 +62,8 @@ return array ( | @@ -62,8 +62,8 @@ return array ( | ||
62 | //设置积分规则(分享购买,分享卖废品) | 62 | //设置积分规则(分享购买,分享卖废品) |
63 | //'share_purchase' => 150, | 63 | //'share_purchase' => 150, |
64 | //'share_sell' => 50, | 64 | //'share_sell' => 50, |
65 | - //域名 | ||
66 | - 'hostUrl' => 'http://feipin.w.brotop.cn', | 65 | +// //域名 |
66 | +// 'hostUrl' => 'http://feipin.w.brotop.cn', | ||
67 | //验证规则 | 67 | //验证规则 |
68 | 'user_id' => [ | 68 | 'user_id' => [ |
69 | 'rule' => [ | 69 | 'rule' => [ |
-
请 注册 或 登录 后发表评论