Commit 42834c54 authored by Menethil's avatar Menethil
Browse files

根据系统设置决定是否自动生成分享图(商品创建或者更新的时候自动创建对应分享图)

parent d1061b12
...@@ -32,6 +32,9 @@ public class QCodeService { ...@@ -32,6 +32,9 @@ public class QCodeService {
* @param goodName * @param goodName
*/ */
public void createGoodShareImage(String goodId, String goodPicUrl, String goodName) { public void createGoodShareImage(String goodId, String goodPicUrl, String goodName) {
if (!SystemConfig.isAutoCreateShareImage())
return;
try { try {
//创建该商品的二维码 //创建该商品的二维码
File file = wxMaService.getQrcodeService().createWxaCodeUnlimit(goodId, "pages/index/index"); File file = wxMaService.getQrcodeService().createWxaCodeUnlimit(goodId, "pages/index/index");
......
...@@ -60,6 +60,11 @@ public class SystemConfig extends BaseConfig { ...@@ -60,6 +60,11 @@ public class SystemConfig extends BaseConfig {
return getConfig(PRE_FIX + "mallname"); return getConfig(PRE_FIX + "mallname");
} }
public static boolean isAutoCreateShareImage() {
int autoCreate = getConfigInt("shareimage.autocreate");
return autoCreate == 0 ? false : true;
}
@Override @Override
public String getPrefix() { public String getPrefix() {
return PRE_FIX; return PRE_FIX;
......
Supports Markdown
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