ccjgmwz 4 年之前
父節點
當前提交
a5216121fb

+ 1 - 0
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/user/UserService.java

@@ -88,6 +88,7 @@ public interface UserService {
             @HttpParam(name = "birthday", type = HttpParamType.COMMON, description = "用户生日") Long birthday,
             @HttpParam(name = Const.USER_ACCESS_TOKEN, type = HttpParamType.HEADER, description = "访问令牌") String accessToken,
             @HttpParam(name = "unionId", type = HttpParamType.COMMON, description = "unionId") String unionId,
+            @HttpParam(name = "cid", type = HttpParamType.COMMON, description = "cid") String cid,
             @NotNull @HttpParam(name = "userId", type = HttpParamType.USER_ID, description = "用户ID") Long userId
             ) throws ServiceException;
 

+ 4 - 1
unimall-app-api/src/main/java/com/iotechn/unimall/app/api/user/UserServiceImpl.java

@@ -765,7 +765,7 @@ public class UserServiceImpl implements UserService {
     }
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public String syncUserInfo(String phone,String nickname, String avatarUrl, Integer gender, Long birthday, String accessToken,String unionId, Long userId) throws ServiceException {
+    public String syncUserInfo(String phone,String nickname, String avatarUrl, Integer gender, Long birthday, String accessToken,String unionId,String cid, Long userId) throws ServiceException {
         UserDO updateUserDO = new UserDO();
         if(phone != null){
             DBConnection();
@@ -811,6 +811,9 @@ public class UserServiceImpl implements UserService {
         if(unionId != null){
             updateUserDO.setUnionId(unionId);
         }
+        if(cid != null&& !cid.isEmpty() && !cid.equals("undefined")){
+            updateUserDO.setCid(cid);
+        }
         if (birthday != null)
             updateUserDO.setBirthday(new Date(birthday));
         if (userMapper.updateById(updateUserDO) > 0) {

+ 2 - 2
unimall-app/pages.json

@@ -25,8 +25,8 @@
 				},
 				{
 					"pagePath": "pages/home/home",
-					"iconPath":"static/img/wode.png",
-					"selectedIconPath":"static/img/wode_check.png",
+					"iconPath":"static/img/liangxin.png",
+					"selectedIconPath":"static/img/liangxin.png",
 					"text": "粮信",
 					"midButton":true
 				},

+ 7 - 0
unimall-app/pages/public/login.vue

@@ -219,6 +219,7 @@
 			             uni.setStorageSync('userInfo', res.data)
 			             that.$store.commit('login', res.data)
 			             e.userInfo.nickname = e.userInfo.nickName
+						 e.userInfo.cid = uni.getStorageSync("clientId")
 			             that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
 			              //同步过后
 			              res.data.nickname = e.userInfo.nickName
@@ -341,6 +342,7 @@
 							uni.setStorageSync('userInfo', res.data)
 							that.$store.commit('login', res.data)
 							e.userInfo.nickname = e.userInfo.nickName
+							e.userInfo.cid = uni.getStorageSync("clientId")
 							console.log(e.userInfo)
 							that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
 								//同步过后
@@ -423,6 +425,8 @@
 					 if(res.data.unionId){
 						 that.userInfo.unionId = res.data.unionId
 					 }
+					 
+					 that.userInfo.cid = uni.getStorageSync("clientId")
 					 console.log(that.userInfo)
 					 that.$api.request('user', 'syncUserInfo', that.userInfo).then(syncRes => {
 					 	uni.setStorageSync('userInfo', that.userInfo)
@@ -547,6 +551,7 @@
 					 					if(e.userInfo.phone == undefined){
 					 						e.userInfo.phone = ''
 					 					}
+										e.userInfo.cid = uni.getStorageSync("clientId")
 					 					console.log(e.userInfo)
 					 					that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
 					 						//同步过后
@@ -630,6 +635,7 @@
 										if(proRes.userInfo.phone == undefined){
 											proRes.userInfo.phone = ''
 										}
+										res.data.cid = uni.getStorageSync("clientId")
 										that.$api.request('user', 'syncUserInfo', res.data).then(syncRes => {
 											//同步过后
 											res.data.nickname = proRes.userInfo.nickName
@@ -746,6 +752,7 @@
 									uni.setStorageSync('userInfo', res.data)
 									that.$store.commit('login', res.data)
 									e.userInfo.nickname = e.userInfo.nickName
+									e.userInfo.cid = uni.getStorageSync("clientId")
 									console.log(e.userInfo)
 									that.$api.request('user', 'syncUserInfo', e.userInfo).then(syncRes => {
 										//同步过后

二進制
unimall-app/static/img/liangxin.png