| @@ -20,16 +20,16 @@ public class PasswordHelper { | |||||
| } | } | ||||
| /* | |||||
| public static void main(String[] args) { | public static void main(String[] args) { | ||||
| MallUserInfo user = new MallUserInfo(); | MallUserInfo user = new MallUserInfo(); | ||||
| user.setUsername("admin"); | |||||
| user.setPassword("admin123"); | |||||
| user.setUsername("sadmin"); | |||||
| user.setPassword("fm2020admin"); | |||||
| PasswordHelper passwordHelper = new PasswordHelper(); | PasswordHelper passwordHelper = new PasswordHelper(); | ||||
| passwordHelper.encryptPassword(user); | passwordHelper.encryptPassword(user); | ||||
| System.out.println(user); | System.out.println(user); | ||||
| System.out.println(user.getPassword()); | System.out.println(user.getPassword()); | ||||
| } | } | ||||
| */ | |||||
| } | } | ||||
| @@ -48,7 +48,13 @@ spring: | |||||
| regionId: cn-hangzhou | regionId: cn-hangzhou | ||||
| dateFormat: yyyyMMdd | dateFormat: yyyyMMdd | ||||
| endpointName: cn-hangzhou | endpointName: cn-hangzhou | ||||
| oss: | |||||
| endpoint: oss-cn-beijing.aliyuncs.com | |||||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||||
| bucketname: formall | |||||
| filehost: malinkadmin | |||||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| @@ -79,7 +85,7 @@ spring: | |||||
| groupId: "GID_P_1" | groupId: "GID_P_1" | ||||
| namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" | namesrvAddr: "http://MQ_INST_1796289517488555_Bcqaq2is.cn-beijing.mq-internal.aliyuncs.com:8080" | ||||
| flyway: | flyway: | ||||
| enabled: true | |||||
| enabled: false | |||||
| aws: | aws: | ||||
| clientRegion: cn-northwest-1 | clientRegion: cn-northwest-1 | ||||
| @@ -7,6 +7,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; | |||||
| import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; | import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; | ||||
| import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
| import com.iformall.annotation.AuthIgnore; | import com.iformall.annotation.AuthIgnore; | ||||
| import com.iformall.annotation.TenantIgnore; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| @@ -75,6 +76,7 @@ public class WxInfoController extends BaseController { | |||||
| WxMerchantBUserService merchantBUserService; | WxMerchantBUserService merchantBUserService; | ||||
| @AuthIgnore | @AuthIgnore | ||||
| @TenantIgnore | |||||
| @ApiOperation("获取OPENID") | @ApiOperation("获取OPENID") | ||||
| @PostMapping("getOpenId") | @PostMapping("getOpenId") | ||||
| public ResultData getOpenId(@RequestBody Map<String,String> param) { | public ResultData getOpenId(@RequestBody Map<String,String> param) { | ||||
| @@ -223,6 +225,7 @@ public class WxInfoController extends BaseController { | |||||
| } | } | ||||
| @AuthIgnore | @AuthIgnore | ||||
| @TenantIgnore | |||||
| @ApiOperation("获取超管OPENID") | @ApiOperation("获取超管OPENID") | ||||
| @PostMapping("getSuperOpenId") | @PostMapping("getSuperOpenId") | ||||
| public ResultData getSuperOpenId(@RequestBody Map<String,String> param) { | public ResultData getSuperOpenId(@RequestBody Map<String,String> param) { | ||||
| @@ -330,6 +333,7 @@ public class WxInfoController extends BaseController { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| @AuthIgnore | @AuthIgnore | ||||
| @TenantIgnore | |||||
| @PostMapping("/getUserPhone") | @PostMapping("/getUserPhone") | ||||
| @ApiOperation(value = "授权后获取用户的手机号", notes="{\"appId\":\"string\",\"encryptedData\":\"string\",\"iv\":\"string\",\"openId\":\"string\",\"session_key\":\"string\"}") | @ApiOperation(value = "授权后获取用户的手机号", notes="{\"appId\":\"string\",\"encryptedData\":\"string\",\"iv\":\"string\",\"openId\":\"string\",\"session_key\":\"string\"}") | ||||
| public ResultData getUserPhone(@RequestBody Map<String, String> map) { | public ResultData getUserPhone(@RequestBody Map<String, String> map) { | ||||
| @@ -46,7 +46,14 @@ spring: | |||||
| domain: dysmsapi.aliyuncs.com | domain: dysmsapi.aliyuncs.com | ||||
| regionId: cn-hangzhou | regionId: cn-hangzhou | ||||
| dateFormat: yyyyMMdd | dateFormat: yyyyMMdd | ||||
| endpointName: cn-hangzhou | |||||
| endpointName: cn-hangzhou | |||||
| oss: | |||||
| endpoint: oss-cn-beijing.aliyuncs.com | |||||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||||
| bucketname: formall | |||||
| filehost: malinkadmin | |||||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| @@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSON; | |||||
| import com.alibaba.fastjson.JSONObject; | import com.alibaba.fastjson.JSONObject; | ||||
| import com.iformall.annotation.AuthIgnore; | import com.iformall.annotation.AuthIgnore; | ||||
| import com.iformall.annotation.RedisCache; | import com.iformall.annotation.RedisCache; | ||||
| import com.iformall.annotation.TenantIgnore; | |||||
| import com.iformall.common.ErrorCode; | import com.iformall.common.ErrorCode; | ||||
| import com.iformall.common.Result; | import com.iformall.common.Result; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| @@ -132,6 +133,7 @@ public class WxUserGrantController extends BaseController { | |||||
| * @return | * @return | ||||
| */ | */ | ||||
| @AuthIgnore | @AuthIgnore | ||||
| @TenantIgnore | |||||
| @PostMapping("/login") | @PostMapping("/login") | ||||
| @ApiOperation(value = "用户登录", notes = "{\"appId\":\"string\",\"code\":\"string\",\"scene\":\"string\",\"sceneAddress\":\"string\",\"latitude\":\"string\",\"longitude\":\"string\",\"systemInfo\":\"string\"}") | @ApiOperation(value = "用户登录", notes = "{\"appId\":\"string\",\"code\":\"string\",\"scene\":\"string\",\"sceneAddress\":\"string\",\"latitude\":\"string\",\"longitude\":\"string\",\"systemInfo\":\"string\"}") | ||||
| public ResultData userLogin(@RequestBody Map<String, String> map) { | public ResultData userLogin(@RequestBody Map<String, String> map) { | ||||
| @@ -45,7 +45,15 @@ spring: | |||||
| domain: dysmsapi.aliyuncs.com | domain: dysmsapi.aliyuncs.com | ||||
| regionId: cn-hangzhou | regionId: cn-hangzhou | ||||
| dateFormat: yyyyMMdd | dateFormat: yyyyMMdd | ||||
| endpointName: cn-hangzhou | |||||
| endpointName: cn-hangzhou | |||||
| oss: | |||||
| endpoint: oss-cn-beijing.aliyuncs.com | |||||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||||
| bucketname: formall | |||||
| filehost: malinkadmin | |||||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| @@ -46,7 +46,14 @@ spring: | |||||
| domain: dysmsapi.aliyuncs.com | domain: dysmsapi.aliyuncs.com | ||||
| regionId: cn-hangzhou | regionId: cn-hangzhou | ||||
| dateFormat: yyyyMMdd | dateFormat: yyyyMMdd | ||||
| endpointName: cn-hangzhou | |||||
| endpointName: cn-hangzhou | |||||
| oss: | |||||
| endpoint: oss-cn-beijing.aliyuncs.com | |||||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||||
| bucketname: formall | |||||
| filehost: malinkadmin | |||||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||||
| mail: | mail: | ||||
| @@ -46,7 +46,14 @@ spring: | |||||
| domain: dysmsapi.aliyuncs.com | domain: dysmsapi.aliyuncs.com | ||||
| regionId: cn-hangzhou | regionId: cn-hangzhou | ||||
| dateFormat: yyyyMMdd | dateFormat: yyyyMMdd | ||||
| endpointName: cn-hangzhou | |||||
| endpointName: cn-hangzhou | |||||
| oss: | |||||
| endpoint: oss-cn-beijing.aliyuncs.com | |||||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||||
| bucketname: formall | |||||
| filehost: malinkadmin | |||||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| @@ -45,7 +45,14 @@ spring: | |||||
| domain: dysmsapi.aliyuncs.com | domain: dysmsapi.aliyuncs.com | ||||
| regionId: cn-hangzhou | regionId: cn-hangzhou | ||||
| dateFormat: yyyyMMdd | dateFormat: yyyyMMdd | ||||
| endpointName: cn-hangzhou | |||||
| endpointName: cn-hangzhou | |||||
| oss: | |||||
| endpoint: oss-cn-beijing.aliyuncs.com | |||||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||||
| bucketname: formall | |||||
| filehost: malinkadmin | |||||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| @@ -46,7 +46,14 @@ spring: | |||||
| domain: dysmsapi.aliyuncs.com | domain: dysmsapi.aliyuncs.com | ||||
| regionId: cn-hangzhou | regionId: cn-hangzhou | ||||
| dateFormat: yyyyMMdd | dateFormat: yyyyMMdd | ||||
| endpointName: cn-hangzhou | |||||
| endpointName: cn-hangzhou | |||||
| oss: | |||||
| endpoint: oss-cn-beijing.aliyuncs.com | |||||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||||
| bucketname: formall | |||||
| filehost: malinkadmin | |||||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| @@ -1,26 +1,35 @@ | |||||
| package com.iformall.common; | package com.iformall.common; | ||||
| import org.springframework.web.context.request.RequestAttributes; | |||||
| import org.springframework.web.context.request.RequestContextHolder; | |||||
| public class TenantThreadLocal { | public class TenantThreadLocal { | ||||
| private static ThreadLocal<String> local = new ThreadLocal<String>(); | |||||
| private static ThreadLocal<String> parentLocal = new ThreadLocal<String>(); | |||||
| //private static ThreadLocal<String> local = new ThreadLocal<String>(); | |||||
| //private static ThreadLocal<String> parentLocal = new ThreadLocal<String>(); | |||||
| public static void setCurrentThreadTenant(String tenantId,String parentId) { | public static void setCurrentThreadTenant(String tenantId,String parentId) { | ||||
| local.set(tenantId); | |||||
| parentLocal.set(parentId); | |||||
| RequestContextHolder.currentRequestAttributes().setAttribute("tenaneId", tenantId, RequestAttributes.SCOPE_REQUEST); | |||||
| RequestContextHolder.currentRequestAttributes().setAttribute("parentTenaneId", parentId, RequestAttributes.SCOPE_REQUEST); | |||||
| //local.set(tenantId); | |||||
| //parentLocal.set(parentId); | |||||
| } | } | ||||
| public static String getTenantId() { | public static String getTenantId() { | ||||
| return local.get(); | |||||
| return (String)RequestContextHolder.currentRequestAttributes().getAttribute("tenaneId", RequestAttributes.SCOPE_REQUEST); | |||||
| //return local.get(); | |||||
| } | } | ||||
| public static String getParentTenantId() { | public static String getParentTenantId() { | ||||
| return parentLocal.get(); | |||||
| return (String)RequestContextHolder.currentRequestAttributes().getAttribute("parentTenaneId", RequestAttributes.SCOPE_REQUEST); | |||||
| //return parentLocal.get(); | |||||
| } | } | ||||
| public static void remove() { | public static void remove() { | ||||
| local.remove(); | |||||
| parentLocal.remove(); | |||||
| RequestContextHolder.currentRequestAttributes().removeAttribute("tenaneId", RequestAttributes.SCOPE_REQUEST); | |||||
| RequestContextHolder.currentRequestAttributes().removeAttribute("parentTenaneId", RequestAttributes.SCOPE_REQUEST); | |||||
| //local.remove(); | |||||
| //parentLocal.remove(); | |||||
| } | } | ||||
| } | } | ||||
| @@ -46,7 +46,14 @@ spring: | |||||
| domain: dysmsapi.aliyuncs.com | domain: dysmsapi.aliyuncs.com | ||||
| regionId: cn-hangzhou | regionId: cn-hangzhou | ||||
| dateFormat: yyyyMMdd | dateFormat: yyyyMMdd | ||||
| endpointName: cn-hangzhou | |||||
| endpointName: cn-hangzhou | |||||
| oss: | |||||
| endpoint: oss-cn-beijing.aliyuncs.com | |||||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||||
| bucketname: formall | |||||
| filehost: malinkadmin | |||||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||
| @@ -46,7 +46,14 @@ spring: | |||||
| domain: dysmsapi.aliyuncs.com | domain: dysmsapi.aliyuncs.com | ||||
| regionId: cn-hangzhou | regionId: cn-hangzhou | ||||
| dateFormat: yyyyMMdd | dateFormat: yyyyMMdd | ||||
| endpointName: cn-hangzhou | |||||
| endpointName: cn-hangzhou | |||||
| oss: | |||||
| endpoint: oss-cn-beijing.aliyuncs.com | |||||
| keyid: LTAI4G7ixY4AhvM35F8o3W3V | |||||
| keysecret: VfWqGb83qIQrS9us45utskl8itd7ry | |||||
| bucketname: formall | |||||
| filehost: malinkadmin | |||||
| filedomain: http://formall.oss-accelerate.aliyuncs.com | |||||
| mail: | mail: | ||||
| host: smtp.exmail.qq.com | host: smtp.exmail.qq.com | ||||