From 541139912b7583007bfd2120e6a12a337af48d07 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 25 七月 2024 17:56:13 +0800
Subject: [PATCH] 提交

---
 admin/src/components/business/OperaShopWindow.vue                                   |   75 ++++++++++++++++++++++---------------
 wechat_staff/pages/userinfo/index.js                                                |    1 
 server/service/src/main/java/com/doumee/service/business/impl/UsersServiceImpl.java |    6 +--
 admin/package-lock.json                                                             |    5 ++
 admin/public/index.html                                                             |    2 
 server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java                  |   17 +++++---
 admin/.env.development                                                              |    2 
 admin/package.json                                                                  |    1 
 8 files changed, 66 insertions(+), 43 deletions(-)

diff --git a/admin/.env.development b/admin/.env.development
index aa3a833..4cc5086 100644
--- a/admin/.env.development
+++ b/admin/.env.development
@@ -1,3 +1,3 @@
 # 寮�鍙戠幆澧冮厤缃�
 NODE_ENV = 'development'
-VUE_APP_BASE_API = 'http://localhost:10028'
+VUE_APP_BASE_API = 'http://192.168.0.135:10028'
diff --git a/admin/package-lock.json b/admin/package-lock.json
index c33f739..eb7ae85 100644
--- a/admin/package-lock.json
+++ b/admin/package-lock.json
@@ -13900,6 +13900,11 @@
         "clipboard": "^2.0.4"
       }
     },
+    "vue-jsonp": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmmirror.com/vue-jsonp/-/vue-jsonp-2.0.0.tgz",
+      "integrity": "sha512-Mzd9GNeuKP5hHFDWZNMWOsCuMILSkA6jo2l4A02wheFz3qqBzH7aSEFTey1BRCZCLizlaf1EqJ5YUtF392KspA=="
+    },
     "vue-loader": {
       "version": "15.9.7",
       "resolved": "https://registry.nlark.com/vue-loader/download/vue-loader-15.9.7.tgz",
diff --git a/admin/package.json b/admin/package.json
index 40ef6c2..a6d5a0e 100644
--- a/admin/package.json
+++ b/admin/package.json
@@ -25,6 +25,7 @@
     "vue": "^2.6.11",
     "vue-clipboard2": "^0.3.1",
     "vue-json-viewer": "^2.2.22",
+    "vue-jsonp": "^2.0.0",
     "vue-router": "^3.5.1",
     "vuescroll": "^4.17.3",
     "vuex": "^3.4.0",
diff --git a/admin/public/index.html b/admin/public/index.html
index 9cba38a..f73bed3 100644
--- a/admin/public/index.html
+++ b/admin/public/index.html
@@ -5,7 +5,7 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
     <link rel="icon" href="<%= BASE_URL %>faviconzb.ico">
-      <script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=HIDBZ-2QXL4-TAWUD-XET6Q-EKTJE-CCBSQ"></script>
+      <script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&libraries=service&key=HIDBZ-2QXL4-TAWUD-XET6Q-EKTJE-CCBSQ"></script>
 <!--      <script type="text/javascript" src="https://mapapi.qq.com/web/mapComponents/geoLocation/v/geolocation.min.js"></script>
       <script type="text/javascript" src="https://map.qq.com/api/gljs?v=1.exp&libraries=service&key=HIDBZ-2QXL4-TAWUD-XET6Q-EKTJE-CCBSQ"></script>
       <script type="text/javascript" src="https://map.qq.com/api/gljs?v=1.exp&key=HIDBZ-2QXL4-TAWUD-XET6Q-EKTJE-CCBSQ"></script>-->
diff --git a/admin/src/components/business/OperaShopWindow.vue b/admin/src/components/business/OperaShopWindow.vue
index 547c708..b382539 100644
--- a/admin/src/components/business/OperaShopWindow.vue
+++ b/admin/src/components/business/OperaShopWindow.vue
@@ -63,6 +63,8 @@
 <script>
 import BaseOpera from '@/components/base/BaseOpera'
 import GlobalWindow from '@/components/common/GlobalWindow'
+import { jsonp } from 'vue-jsonp'
+
 export default {
   name: 'OperaShopWindow',
   extends: BaseOpera,
@@ -71,8 +73,8 @@
     return {
       geocoder: null,
       map: [],
-      searchValue:'',
-      marker:null,
+      searchValue: '',
+      marker: null,
       // 琛ㄥ崟鏁版嵁
       provinces: [],
       cities: [],
@@ -108,9 +110,22 @@
     })
   },
   methods: {
-    searchAddress( ){
-      if(this.geocoder && this.searchValue){
-        this.geocoder.getLocation(this.searchValue)
+    searchAddress () {
+      if (  this.searchValue) {
+       var that = this
+        jsonp('https://apis.map.qq.com/ws/geocoder/v1/', {
+          address: this.searchValue,
+          key: 'HIDBZ-2QXL4-TAWUD-XET6Q-EKTJE-CCBSQ',
+          output: 'jsonp'
+        }).then(result => {
+          console.log(result)
+          if(result.result.location){
+            that.changePostion(result.result.location.lng, result.result.location.lat)
+          }
+        }).catch(error => {
+          // 璇锋眰澶辫触澶勭悊
+          console.log(error)
+        })
       }
     },
     initMap (lat, long) {
@@ -120,20 +135,20 @@
         center: center,
         zoom: 17
       })
-      this.changePostion(long,lat)
+      this.changePostion(long, lat)
       qq.maps.event.addListener(this.map, 'click',
         function (event) {
           that.changePostion(event.latLng.lng, event.latLng.lat)
         }
       )
-      this.geocoder = new qq.maps.Geocoder()
+     /* this.geocoder = new qq.maps.Geocoder()
       this.geocoder.setComplete(function (result) {
-        that.changePostion(result.detail.location.lng,result.detail.location.lat)
+        that.changePostion(result.detail.location.lng, result.detail.location.lat)
       })
       // 鑻ユ湇鍔¤姹傚け璐ワ紝鍒欒繍琛屼互涓嬪嚱鏁�
-      this.geocoder.setError(function () {
-        console.log('閫嗚В鏋愬け璐�')
-      })
+      this.geocoder.setError(function (e) {
+        console.log(that.searchValue + '=====閫嗚В鏋愬け璐�')
+      })*/
     },
     open (title, target) {
       this.title = title
@@ -157,7 +172,7 @@
         const mapContainer = this.$refs.mapContainer // 鑾峰彇鍦板浘瀹瑰櫒
         if (mapContainer) {
           // 鍒濆鍖栧湴鍥句箣鍓嶆鏌ュ鍣ㄦ槸鍚﹀瓨鍦�
-          this.initMap(this.form.latitude,this.form.longitude)
+          this.initMap(this.form.latitude, this.form.longitude)
           // 鍒濆鍖栬吘璁湴鍥�
         }
       })
@@ -167,12 +182,12 @@
         .then(res => {
           this.provinces = res
         })
-      if(this.form.provinceCode){
-        this.selectProvince(this.form.provinceCode,true)
+      if (this.form.provinceCode) {
+        this.selectProvince(this.form.provinceCode, true)
       }
     },
     // 閫夋嫨鐪佷唤
-    selectProvince (val,isInit) {
+    selectProvince (val, isInit) {
       this.provinces.forEach(item => {
         if (item.id == val) {
           this.form.provinceName = item.name
@@ -180,36 +195,36 @@
       })
       this.cities = []
       this.areas = []
-      if(!isInit){
+      if (!isInit) {
         this.form.cityName = ''
         this.form.areaCode = ''
         this.form.cityCode = ''
         this.form.areaName = ''
       }
-      if(!val || val ==''){
+      if (!val || val == '') {
         return
       }
       this.api.areaList({ pid: val })
         .then(res => {
           this.cities = res
-          if(isInit){
-            this.selectCity(this.form.cityCode,isInit)
+          if (isInit) {
+            this.selectCity(this.form.cityCode, isInit)
           }
         })
     },
     // 閫夋嫨鍩庡競
-    selectCity (val,isInit) {
+    selectCity (val, isInit) {
       this.cities.forEach(item => {
         if (item.id == val) {
           this.form.cityName = item.name
         }
       })
       this.areas = []
-      if(!isInit){
+      if (!isInit) {
         this.form.areaCode = ''
         this.form.areaName = ''
       }
-      if(!val || val ==''){
+      if (!val || val == '') {
         return
       }
       this.api.areaList({ pid: val })
@@ -224,24 +239,24 @@
         }
       })
     },
-    changeMapCenter(){
-       this.searchValue = (this.form.provinceName||'')+(this.form.cityName||'')+(this.form.areaName||'')+(this.form.address||'')
+    changeMapCenter () {
+      this.searchValue = (this.form.provinceName || '') + (this.form.cityName || '') + (this.form.areaName || '') + (this.form.address || '')
       this.searchAddress()
     },
     changePostion (lng, lat) {
       if (lng || lat) {
         this.form.longitude = lng
         this.form.latitude = lat
-        if(this.map){
-          if(this.marker){
+        if (this.map) {
+          if (this.marker) {
             this.marker.setMap(null)
           }
-          var pos =new qq.maps.LatLng(lat,lng);
+          var pos = new qq.maps.LatLng(lat, lng)
           this.map.setCenter(pos)
-          this.marker= new qq.maps.Marker({
+          this.marker = new qq.maps.Marker({
             position: pos,
-            animation:qq.maps.MarkerAnimation.DROP,
-            map:this.map
+            animation: qq.maps.MarkerAnimation.DROP,
+            map: this.map
           })
         }
       }
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/UsersServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/UsersServiceImpl.java
index 40bc7c6..c66f933 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/UsersServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/UsersServiceImpl.java
@@ -697,10 +697,9 @@
         if(img1 ==null){
             return param.getImgurl();
         }
-      /*  if(img1.getWidth() <200 && img1.getHeight()<100){
+       /* if(img1.getWidth() <200 && img1.getHeight()<100){
             return  param.getImgurl();
-        }
-*/
+        }*/
         String defualtHeader = systemDictDataBiz.queryByCode(Constants.WEIXIN_DEFAULT_IMGS, Constants.USER_CARD_HEADER_IMG).getCode();
         String imgurl =StringUtils.isNotBlank(users.getImgurl())?path+(systemDictDataBiz.queryByCode(Constants.OBJCET_STORAGE, Constants.USERS_FILE).getCode())+users.getImgurl():defualtHeader;
         String url =null;
@@ -724,7 +723,6 @@
             url =  path+fileName;
         }
         return  url;
-
     }
 
     private String dealShareImgNoUser(ContentShareImgDto param, Users users, String shareFolder, String path) {
diff --git a/server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java b/server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java
index 6c9a1b8..a45ebd0 100644
--- a/server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java
+++ b/server/web/src/main/java/com/doumee/api/web/CustomerManageApi.java
@@ -2,7 +2,6 @@
 
 import cn.hutool.http.HttpRequest;
 import com.amazonaws.util.Md5Utils;
-import com.amazonaws.util.StringUtils;
 import com.doumee.biz.system.SystemDataPermissionBiz;
 import com.doumee.biz.system.SystemDictDataBiz;
 import com.doumee.biz.zbom.ZbomCRMService;
@@ -31,6 +30,7 @@
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.codec.digest.Md5Crypt;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.apache.tomcat.util.security.MD5Encoder;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -130,15 +130,18 @@
     @ApiOperation(value = "鐢熸垚灏忕▼搴忕爜", notes = "PAD绔�")
     @PostMapping("/getQrCode")
     @ApiImplicitParams({
-            @ApiImplicitParam(paramType = "header", dataType = "String", name = "interfaceToken", value = "token", required = true),
-            @ApiImplicitParam(paramType = "header", dataType = "String", name = "timestamp", value = "鏃堕棿鎴�", required = true),
+            @ApiImplicitParam(paramType = "header", dataType = "String", name = "sign", value = "绛惧悕锛堜娇鐢╰imestamp+appkey杩涜md5鍔犲瘑锛�", required = true),
+            @ApiImplicitParam(paramType = "header", dataType = "String", name = "timestamp", value = "鏃堕棿鎴筹紙褰撳墠鏃堕棿姣锛�2灏忔椂鍐呮湁鏁堬級", required = true),
     })
-    public void getQrCode(@RequestBody GenerateQRCodeRequest generateQRCodeRequest, HttpServletRequest httpServletRequest, HttpServletResponse response) {
-        String interfaceToken = httpServletRequest.getHeader("interfaceToken");
-        String timestamp = httpServletRequest.getHeader("timestamp");
+    public void getQrCode(@RequestParam(value = "sign")String sign,
+                          @RequestParam(value = "timestamp")Long timestamp,
+                          @RequestBody GenerateQRCodeRequest generateQRCodeRequest,HttpServletResponse response) {
+        if(StringUtils.isBlank(sign) || timestamp == null){
+            throw  new BusinessException(ResponseStatus.BAD_REQUEST);
+        }
         String interfaceKey = systemDictDataBiz.queryByCode(Constants.ZBOM,Constants.ZBOM_PAD_INTERFACE_KEY).getCode();
         String token = DigestUtils.md5Hex(timestamp+interfaceKey);
-        if(!token.equals(interfaceToken)){
+        if(!token.equals(sign)){
             throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"token宸插け鏁�!");
         }
         try{
diff --git a/wechat_staff/pages/userinfo/index.js b/wechat_staff/pages/userinfo/index.js
index a208323..5156bf3 100644
--- a/wechat_staff/pages/userinfo/index.js
+++ b/wechat_staff/pages/userinfo/index.js
@@ -97,6 +97,7 @@
     var that = this
     const { userInfo } = this.data
     if (e.detail.avatarUrl) {
+      console.log(e)
       wx.uploadFile({
         url: uploadUrl,
         filePath: e.detail.avatarUrl,

--
Gitblit v1.9.3