maguohua 7 жил өмнө
parent
commit
13f3afc29f

+ 2 - 0
controller/admin/admin.js

@@ -257,6 +257,7 @@ class Admin extends AddressComponent {
 				status: 1,
 				status: 1,
 				image_path,
 				image_path,
 			})
 			})
+			return
 		}catch(err){
 		}catch(err){
 			console.log('上传图片失败', err);
 			console.log('上传图片失败', err);
 			res.send({
 			res.send({
@@ -264,6 +265,7 @@ class Admin extends AddressComponent {
 				type: 'ERROR_UPLOAD_IMG',
 				type: 'ERROR_UPLOAD_IMG',
 				message: '上传图片失败'
 				message: '上传图片失败'
 			})
 			})
+			return
 		}
 		}
 	}
 	}
 }
 }

+ 1 - 1
package.json

@@ -8,7 +8,7 @@
   "private": true,
   "private": true,
   "scripts": {
   "scripts": {
     "dev": "cross-env NODE_ENV=development supervisor --harmony index.js",
     "dev": "cross-env NODE_ENV=development supervisor --harmony index.js",
-    "local": "cross-env NODE_ENV=local supervisor --harmony index.js",
+    "local": "cross-env NODE_ENV=local supervisor  --harmony index.js",
     "test": "echo \"Error: no test specified\" && exit 1",
     "test": "echo \"Error: no test specified\" && exit 1",
     "start": "cross-env NODE_ENV=production pm2 start index.js --node-args='--harmony' --name 'node-elm'",
     "start": "cross-env NODE_ENV=production pm2 start index.js --node-args='--harmony' --name 'node-elm'",
     "stop": "cross-env NODE_ENV=production pm2 stop index.js --name 'node-elm'",
     "stop": "cross-env NODE_ENV=production pm2 stop index.js --name 'node-elm'",

+ 5 - 5
prototype/baseComponent.js

@@ -116,11 +116,11 @@ export default class BaseComponent {
 					gm(repath)
 					gm(repath)
 					.resize(200, 200, "!")
 					.resize(200, 200, "!")
 					.write(repath, async (err) => {
 					.write(repath, async (err) => {
-						if(err){
-							console.log('裁切图片失败');
-							reject('裁切图片失败');
-							return
-						}
+						// if(err){
+						// 	console.log('裁切图片失败');
+						// 	reject('裁切图片失败');
+						// 	return
+						// }
 						resolve(fullName)
 						resolve(fullName)
 					})
 					})
 				}catch(err){
 				}catch(err){