Commit 722c0977 authored by Kittisak Maneewong's avatar Kittisak Maneewong

fix picture not show

parent eebd9060
...@@ -47,14 +47,14 @@ class CompanyController extends Controller ...@@ -47,14 +47,14 @@ class CompanyController extends Controller
if ($request->get('imageCompany') !== 'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png') { if ($request->get('imageCompany') !== 'https://asianinteriorservices.com/wp-content/uploads/2018/04/noImg.png') {
$image = $request->get('imageCompany'); $image = $request->get('imageCompany');
$name = 'Company'.time().'.'.explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1]; $name = 'Company'.time().'.'.explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];
\Image::make($request->get('imageCompany'))->save(storage_path('uploads/').$name); \Image::make($request->get('imageCompany'))->save(public_path('uploads/').$name);
$imageCompany = $name; $imageCompany = '/uploads/'.$name;
} }
if ($request->get('imageMap')) { if ($request->get('imageMap')) {
$image = $request->get('imageMap'); $image = $request->get('imageMap');
$name = 'Map'.time().'.'.explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1]; $name = 'Map'.time().'.'.explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];
\Image::make($request->get('imageMap'))->save(storage_path('uploads/').$name); \Image::make($request->get('imageMap'))->save(public_path('uploads/').$name);
$imageMap = $name; $imageMap = '/uploads/'.$name;
} }
$company = new Company(); $company = new Company();
$company->imageCompany = $imageCompany; $company->imageCompany = $imageCompany;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -434,27 +434,27 @@ export default { ...@@ -434,27 +434,27 @@ export default {
} }
}, },
createJob () { createJob () {
this.loading = true // this.loading = true
if (this.amphoes.findIndex(x => x.amphoe_code === this.amphoe.amphoe_code) === -1) {this.amphoe = ''} // if (this.amphoes.findIndex(x => x.amphoe_code === this.amphoe.amphoe_code) === -1) {this.amphoe = ''}
if (this.tumbons.findIndex(x => x.tumbon_code === this.tumbon.tumbon_code) === -1) {this.tumbon = ''} // if (this.tumbons.findIndex(x => x.tumbon_code === this.tumbon.tumbon_code) === -1) {this.tumbon = ''}
if (this.company_data.zip_code === ' ') {this.company_data.zip_code = ''} // if (this.company_data.zip_code === ' ') {this.company_data.zip_code = ''}
if (this.$refs.create.validate()) { // if (this.$refs.create.validate()) {
this.company_data.province = this.province.province // this.company_data.province = this.province.province
this.company_data.amphoe = this.amphoe.amphoe // this.company_data.amphoe = this.amphoe.amphoe
this.company_data.tumbon = this.tumbon.tumbon // this.company_data.tumbon = this.tumbon.tumbon
axios.post('/api/companys', this.company_data) // axios.post('/api/companys', this.company_data)
.then(res => { // .then(res => {
this.loading = false // this.loading = false
this.$router.push('/employer') // this.$router.push('/employer')
}) // })
.catch(err => { // .catch(err => {
console.log(err.response) // console.log(err.response)
this.loading = false // this.loading = false
}) // })
} else { // } else {
this.loading = false // this.loading = false
this.$Loading.error() // this.$Loading.error()
} // }
}, },
showProvinces () { showProvinces () {
axios.get('/api/province') axios.get('/api/province')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment