| | |
| | | @click="exportExcel">导åº</el-button></li> |
| | | </ul> |
| | | <el-table row-key="id" :tree-props="{ children: 'childCategoryList' }" v-loading="isWorking.search" |
| | | :data="dataList" stripe @selection-change="handleSelectionChange"> |
| | | :data="tableData.list" stripe @selection-change="handleSelectionChange"> |
| | | <el-table-column prop="name" label="设å¤åç±»" min-width="100px"></el-table-column> |
| | | <!-- <el-table-column prop="parentName" label="æå±åç±»" min-width="100px"></el-table-column> --> |
| | | <el-table-column prop="sortnum" label="æåºç " min-width="100px"></el-table-column> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination @size-change="handleSizeChange" @current-change="getList" :pagination="tableData.pagination"> |
| | | <pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="tableData.pagination"> |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | |
| | | data() { |
| | | return { |
| | | // æç´¢ |
| | | filters: { |
| | | /* filters: { |
| | | parentId: '' |
| | | }, |
| | | },*/ |
| | | searchForm:{ type: 5 ,parentId: ''}, |
| | | isShowEdit: false, |
| | | loading: false, |
| | | pagination: { |
| | |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | this.getList() |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | handleEdit(row) { |
| | |
| | | type: 'warning' |
| | | }).then(() => { |
| | | deleteById(row.id).then(res => { |
| | | this.getList() |
| | | this.search() |
| | | }) |
| | | }) |
| | | |
| | | }, |
| | | getList() { |
| | | const { pagination, filters } = this |
| | | const { pagination } = this |
| | | this.loading = true |
| | | fetchList({ |
| | | model: { ...filters, type: 5 }, |
| | | model: this.searchForm, |
| | | capacity: pagination.pageSize, |
| | | page: pagination.page, |
| | | }).then(res => { |
| | |
| | | "https" : false |
| | | }, |
| | | "sdkConfigs" : { |
| | | "maps" : { |
| | | "amap" : { |
| | | "key" : "d9a554b1808ce10a12a932ed9b0db1d0", |
| | | "securityJsCode" : "", |
| | | "serviceHost" : "" |
| | | } |
| | | } |
| | | "maps" : {} |
| | | }, |
| | | "unipush" : { |
| | | "enable" : false |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "name": "å¾çè£åª åè§æå¨ å¾ç缩æ¾ç§»å¨", |
| | | "version": "1.0.0", |
| | | "lockfileVersion": 2, |
| | | "requires": true, |
| | | "packages": { |
| | | "": { |
| | | "name": "å¾çè£åª åè§æå¨ å¾ç缩æ¾ç§»å¨", |
| | | "version": "1.0.0", |
| | | "dependencies": { |
| | | "dayjs": "^1.11.13", |
| | | "dingtalk-jsapi": "^3.2.0", |
| | | "html5-qrcode": "^2.3.8", |
| | | "uniapp-qrcode": "^1.0.2", |
| | | "uview-ui": "^2.0.37", |
| | | "vconsole": "^3.15.1" |
| | | } |
| | | }, |
| | | "node_modules/@babel/runtime": { |
| | | "version": "7.29.7", |
| | | "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.29.7.tgz", |
| | | "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", |
| | | "engines": { |
| | | "node": ">=6.9.0" |
| | | } |
| | | }, |
| | | "node_modules/copy-text-to-clipboard": { |
| | | "version": "3.2.2", |
| | | "resolved": "https://registry.npmmirror.com/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.2.tgz", |
| | | "integrity": "sha512-T6SqyLd1iLuqPA90J5N4cTalrtovCySh58iiZDGJ6FGznbclKh4UI+FGacQSgFzwKG77W7XT5gwbVEbd9cIH1A==", |
| | | "engines": { |
| | | "node": ">=12" |
| | | }, |
| | | "funding": { |
| | | "url": "https://github.com/sponsors/sindresorhus" |
| | | } |
| | | }, |
| | | "node_modules/core-js": { |
| | | "version": "3.49.0", |
| | | "resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.49.0.tgz", |
| | | "integrity": "sha512-es1U2+YTtzpwkxVLwAFdSpaIMyQaq0PBgm3YD1W3Qpsn1NAmO3KSgZfu+oGSWVu6NvLHoHCV/aYcsE5wiB7ALg==", |
| | | "hasInstallScript": true, |
| | | "funding": { |
| | | "type": "opencollective", |
| | | "url": "https://opencollective.com/core-js" |
| | | } |
| | | }, |
| | | "node_modules/dayjs": { |
| | | "version": "1.11.21", |
| | | "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.21.tgz", |
| | | "integrity": "sha512-98IT+HOahAisibz/yjKbzuOBwYcjJ7BCLPzARyHiyEBmRz4fatF+KPJszEHXsGYjUG234aH/cOjW1wwTbKUZlA==" |
| | | }, |
| | | "node_modules/dingtalk-jsapi": { |
| | | "version": "3.2.9", |
| | | "resolved": "https://registry.npmmirror.com/dingtalk-jsapi/-/dingtalk-jsapi-3.2.9.tgz", |
| | | "integrity": "sha512-VLt8co92z29bdguxUvJLnhpQn7WFjb5rJTODDczieS7I0yyWj5+KwF04sWfMvyIKX0MQPVL++Fyo6z2JucFpgQ==", |
| | | "dependencies": { |
| | | "promise-polyfill": "^7.1.0" |
| | | } |
| | | }, |
| | | "node_modules/html5-qrcode": { |
| | | "version": "2.3.8", |
| | | "resolved": "https://registry.npmmirror.com/html5-qrcode/-/html5-qrcode-2.3.8.tgz", |
| | | "integrity": "sha512-jsr4vafJhwoLVEDW3n1KvPnCCXWaQfRng0/EEYk1vNcQGcG/htAdhJX0be8YyqMoSz7+hZvOZSTAepsabiuhiQ==" |
| | | }, |
| | | "node_modules/mutation-observer": { |
| | | "version": "1.0.3", |
| | | "resolved": "https://registry.npmmirror.com/mutation-observer/-/mutation-observer-1.0.3.tgz", |
| | | "integrity": "sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA==" |
| | | }, |
| | | "node_modules/promise-polyfill": { |
| | | "version": "7.1.2", |
| | | "resolved": "https://registry.npmmirror.com/promise-polyfill/-/promise-polyfill-7.1.2.tgz", |
| | | "integrity": "sha512-FuEc12/eKqqoRYIGBrUptCBRhobL19PS2U31vMNTfyck1FxPyMfgsXyW4Mav85y/ZN1hop3hOwRlUDok23oYfQ==" |
| | | }, |
| | | "node_modules/uniapp-qrcode": { |
| | | "version": "1.0.2", |
| | | "resolved": "https://registry.npmmirror.com/uniapp-qrcode/-/uniapp-qrcode-1.0.2.tgz", |
| | | "integrity": "sha512-jcWwWz4yXsO7if/+78MMXj5VUdZTLu2D6L/IKb4mJkIw87oF11pO3WS/jS27SUcPCrX/BKcir5a2R1uvkaoR9g==" |
| | | }, |
| | | "node_modules/uview-ui": { |
| | | "version": "2.0.38", |
| | | "resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.38.tgz", |
| | | "integrity": "sha512-6egHDf9lXHKpG3hEjRE0vMx4+VWwKk/ReTf5x18KrIKqdvdPRqO3+B8Unh7vYYwrIxzAWIlmhZ9RJpKI/4UqPQ==", |
| | | "engines": { |
| | | "HBuilderX": "^3.1.0" |
| | | } |
| | | }, |
| | | "node_modules/vconsole": { |
| | | "version": "3.15.1", |
| | | "resolved": "https://registry.npmmirror.com/vconsole/-/vconsole-3.15.1.tgz", |
| | | "integrity": "sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g==", |
| | | "dependencies": { |
| | | "@babel/runtime": "^7.17.2", |
| | | "copy-text-to-clipboard": "^3.0.1", |
| | | "core-js": "^3.11.0", |
| | | "mutation-observer": "^1.0.3" |
| | | } |
| | | } |
| | | }, |
| | | "dependencies": { |
| | | "@babel/runtime": { |
| | | "version": "7.29.7", |
| | | "resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.29.7.tgz", |
| | | "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==" |
| | | }, |
| | | "copy-text-to-clipboard": { |
| | | "version": "3.2.2", |
| | | "resolved": "https://registry.npmmirror.com/copy-text-to-clipboard/-/copy-text-to-clipboard-3.2.2.tgz", |
| | | "integrity": "sha512-T6SqyLd1iLuqPA90J5N4cTalrtovCySh58iiZDGJ6FGznbclKh4UI+FGacQSgFzwKG77W7XT5gwbVEbd9cIH1A==" |
| | | }, |
| | | "core-js": { |
| | | "version": "3.49.0", |
| | | "resolved": "https://registry.npmmirror.com/core-js/-/core-js-3.49.0.tgz", |
| | | "integrity": "sha512-es1U2+YTtzpwkxVLwAFdSpaIMyQaq0PBgm3YD1W3Qpsn1NAmO3KSgZfu+oGSWVu6NvLHoHCV/aYcsE5wiB7ALg==" |
| | | }, |
| | | "dayjs": { |
| | | "version": "1.11.21", |
| | | "resolved": "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.21.tgz", |
| | | "integrity": "sha512-98IT+HOahAisibz/yjKbzuOBwYcjJ7BCLPzARyHiyEBmRz4fatF+KPJszEHXsGYjUG234aH/cOjW1wwTbKUZlA==" |
| | | }, |
| | | "dingtalk-jsapi": { |
| | | "version": "3.2.9", |
| | | "resolved": "https://registry.npmmirror.com/dingtalk-jsapi/-/dingtalk-jsapi-3.2.9.tgz", |
| | | "integrity": "sha512-VLt8co92z29bdguxUvJLnhpQn7WFjb5rJTODDczieS7I0yyWj5+KwF04sWfMvyIKX0MQPVL++Fyo6z2JucFpgQ==", |
| | | "requires": { |
| | | "promise-polyfill": "^7.1.0" |
| | | } |
| | | }, |
| | | "html5-qrcode": { |
| | | "version": "2.3.8", |
| | | "resolved": "https://registry.npmmirror.com/html5-qrcode/-/html5-qrcode-2.3.8.tgz", |
| | | "integrity": "sha512-jsr4vafJhwoLVEDW3n1KvPnCCXWaQfRng0/EEYk1vNcQGcG/htAdhJX0be8YyqMoSz7+hZvOZSTAepsabiuhiQ==" |
| | | }, |
| | | "mutation-observer": { |
| | | "version": "1.0.3", |
| | | "resolved": "https://registry.npmmirror.com/mutation-observer/-/mutation-observer-1.0.3.tgz", |
| | | "integrity": "sha512-M/O/4rF2h776hV7qGMZUH3utZLO/jK7p8rnNgGkjKUw8zCGjRQPxB8z6+5l8+VjRUQ3dNYu4vjqXYLr+U8ZVNA==" |
| | | }, |
| | | "promise-polyfill": { |
| | | "version": "7.1.2", |
| | | "resolved": "https://registry.npmmirror.com/promise-polyfill/-/promise-polyfill-7.1.2.tgz", |
| | | "integrity": "sha512-FuEc12/eKqqoRYIGBrUptCBRhobL19PS2U31vMNTfyck1FxPyMfgsXyW4Mav85y/ZN1hop3hOwRlUDok23oYfQ==" |
| | | }, |
| | | "uniapp-qrcode": { |
| | | "version": "1.0.2", |
| | | "resolved": "https://registry.npmmirror.com/uniapp-qrcode/-/uniapp-qrcode-1.0.2.tgz", |
| | | "integrity": "sha512-jcWwWz4yXsO7if/+78MMXj5VUdZTLu2D6L/IKb4mJkIw87oF11pO3WS/jS27SUcPCrX/BKcir5a2R1uvkaoR9g==" |
| | | }, |
| | | "uview-ui": { |
| | | "version": "2.0.38", |
| | | "resolved": "https://registry.npmmirror.com/uview-ui/-/uview-ui-2.0.38.tgz", |
| | | "integrity": "sha512-6egHDf9lXHKpG3hEjRE0vMx4+VWwKk/ReTf5x18KrIKqdvdPRqO3+B8Unh7vYYwrIxzAWIlmhZ9RJpKI/4UqPQ==" |
| | | }, |
| | | "vconsole": { |
| | | "version": "3.15.1", |
| | | "resolved": "https://registry.npmmirror.com/vconsole/-/vconsole-3.15.1.tgz", |
| | | "integrity": "sha512-KH8XLdrq9T5YHJO/ixrjivHfmF2PC2CdVoK6RWZB4yftMykYIaXY1mxZYAic70vADM54kpMQF+dYmvl5NRNy1g==", |
| | | "requires": { |
| | | "@babel/runtime": "^7.17.2", |
| | | "copy-text-to-clipboard": "^3.0.1", |
| | | "core-js": "^3.11.0", |
| | | "mutation-observer": "^1.0.3" |
| | | } |
| | | } |
| | | } |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | { |
| | | "id": "tly-picture-cut", |
| | | "name": "å¾çè£åª åè§æå¨ å¾ç缩æ¾ç§»å¨", |
| | | "version": "1.0.0", |
| | | "description": "å¾çè£åªç»ä»¶ æ¯ææå¨åè§ å·²ä½¿ç¨å¾®ä¿¡å°ç¨åºãH5 å¹³å°", |
| | | "keywords": [ |
| | | "å¾çè£åª" |
| | | ], |
| | | "dcloudext": { |
| | | "category": [ |
| | | "å端ç»ä»¶", |
| | | "éç¨ç»ä»¶" |
| | | ] |
| | | }, |
| | | "dependencies": { |
| | | "dayjs": "^1.11.13", |
| | | "dingtalk-jsapi": "^3.2.0", |
| | | "html5-qrcode": "^2.3.8", |
| | | "uniapp-qrcode": "^1.0.2", |
| | | "uview-ui": "^2.0.37", |
| | | "vconsole": "^3.15.1" |
| | | } |
| | | } |
| | |
| | | // export const baseUrl = 'gateway_interface/' |
| | | // export const baseUrl = 'http://192.168.0.173/gateway_interface/' |
| | | export const baseUrl = 'http://localhost:10010/gateway_interface/' |
| | | // export const baseUrl = 'https://zhcg.fnwtzx.com/gateway_interface/' |
| | | export const baseUrl = 'https://dmtest.ahapp.net/gateway_interface/' |
| | | //export const baseUrl = 'https://dmtest.ahapp.net/gateway_interface/' |
| | | |
| | | export const uploadAvatar = `${baseUrl}visitsAdmin/cloudService/web/public/uploadFtp.do` |
| | | export const uploadUrl = `${baseUrl}visitsAdmin/cloudService/public/uploadBatch` |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | -- åæ· H5 微信 openid |
| | | SET @db := DATABASE(); |
| | | |
| | | SET @sql := IF( |
| | | (SELECT COUNT(*) FROM information_schema.COLUMNS |
| | | WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'yw_customer' AND COLUMN_NAME = 'openid') = 0, |
| | | 'ALTER TABLE `yw_customer` ADD COLUMN `openid` varchar(64) DEFAULT NULL COMMENT ''微信openid'' AFTER `phone`', |
| | | 'SELECT 1' |
| | | ); |
| | | PREPARE stmt FROM @sql; |
| | | EXECUTE stmt; |
| | | DEALLOCATE PREPARE stmt; |
| | | |
| | | SET @sql := IF( |
| | | (SELECT COUNT(*) FROM information_schema.STATISTICS |
| | | WHERE TABLE_SCHEMA = @db AND TABLE_NAME = 'yw_customer' AND INDEX_NAME = 'idx_openid') = 0, |
| | | 'ALTER TABLE `yw_customer` ADD INDEX `idx_openid` (`openid`)', |
| | | 'SELECT 1' |
| | | ); |
| | | PREPARE stmt FROM @sql; |
| | | EXECUTE stmt; |
| | | DEALLOCATE PREPARE stmt; |
| | |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | private List<Integer> companyIdList; |
| | | private Company company; |
| | | |
| | | @ApiModelProperty("H5ç¨æ·ç±»å 0è¿ç»´äººå 1åæ·") |
| | | private Integer h5UserType; |
| | | |
| | | @ApiModelProperty("åæ·IDï¼h5UserType=1æ¶æå¼ï¼") |
| | | private Integer customerId; |
| | | |
| | | public static final int H5_USER_OPS = 0; |
| | | public static final int H5_USER_CUSTOMER = 1; |
| | | public static final int SOURCE_H5_CUSTOMER = 10; |
| | | |
| | | //jwtç»å½è®¾ç½® |
| | | public static LoginUserInfo from(SystemUser user, List<SystemRole> roles, List<SystemPermission> permissions,Company company,String sessionId) { |
| | | if (user == null) { |
| | |
| | | @NotBlank(message = "éªè¯ç ä¸è½ä¸ºç©º") |
| | | @ApiModelProperty(value = "éªè¯ç ") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "0è¿ç»´äººå 1åæ·") |
| | | private Integer userType; |
| | | } |
| | |
| | | user.setCompanyIdList(systemDataPermissionService.selectHighRole(new SystemDataPermission(),rt,user)); |
| | | |
| | | LoginUserInfo userInfo = LoginUserInfo.from(user, roles, permissions,company,null); |
| | | userInfo.setH5UserType(LoginUserInfo.H5_USER_OPS); |
| | | return userInfo; |
| | | } |
| | | |
| | |
| | | user.setCompanyIdList(systemDataPermissionService.selectHighRole(new SystemDataPermission(),rt,user)); |
| | | |
| | | LoginUserInfo userInfo = LoginUserInfo.from(user, roles, permissions,company,null); |
| | | userInfo.setH5UserType(LoginUserInfo.H5_USER_OPS); |
| | | String token = jwtTokenUtil.generateToken(userInfo); |
| | | |
| | | return token; |
| | |
| | | compression: |
| | | enabled: true |
| | | mime-types: application/json |
| | | port: 10037 |
| | | port: 10010 |
| | | tomcat: |
| | | max-swallow-size: -1 |
| | | servlet: |
| | |
| | | spring: |
| | | profiles: |
| | | active: pro |
| | | active: dev |
| | | application: |
| | | name: visitsTimer |
| | | # å®å
¨é
ç½® |
| | |
| | | @GetMapping("/ywWxAuthorize") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "ææç ", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "source", value = "æ¥æº:0=叿ºï¼1=访客ï¼2=å
é¨åå·¥", required = true) |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "userType", value = "ç¨æ·ç±»å:0=è¿ç»´äººåï¼1=åæ·", required = false) |
| | | }) |
| | | public ApiResponse<WxAuthorizeVO> ywWxAuthorize(@RequestParam String code) { |
| | | WxAuthorizeVO wxAuthorizeVO = memberService.ywWxAuthorize(code); |
| | | public ApiResponse<WxAuthorizeVO> ywWxAuthorize(@RequestParam String code, |
| | | @RequestParam(required = false, defaultValue = "0") Integer userType) { |
| | | WxAuthorizeVO wxAuthorizeVO = memberService.ywWxAuthorize(code, userType); |
| | | return ApiResponse.success("æ¥è¯¢æå",wxAuthorizeVO); |
| | | } |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.cloud.web; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.config.annotation.LoginNoRequired; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.system.dto.LoginPhoneDTO; |
| | | import com.doumee.service.business.YwCustomerH5AuthService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Api(tags = "ãå
¬ä¼å·ãåæ·ç»å½") |
| | | @RestController |
| | | @LoginNoRequired |
| | | @RequestMapping(Constants.CLOUD_SERVICE_URL_INDEX + "/web/customer") |
| | | public class YwCustomerWebController extends BaseController { |
| | | |
| | | @Autowired |
| | | private YwCustomerH5AuthService ywCustomerH5AuthService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("åæ·çä¿¡éªè¯ç ç»å½") |
| | | @PostMapping("/loginByPhone") |
| | | public ApiResponse<String> loginByPhone(@Validated @RequestBody LoginPhoneDTO dto) { |
| | | try { |
| | | return ApiResponse.success(ywCustomerH5AuthService.loginByPhone(dto)); |
| | | } catch (BusinessException e) { |
| | | return ApiResponse.failed(e.getCode(), e.getMessage()); |
| | | } catch (Exception e) { |
| | | return ApiResponse.failed(ResponseStatus.SERVER_ERROR); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("è·åå½ååæ·ç»å½ä¿¡æ¯") |
| | | @GetMapping("/getUserInfo") |
| | | public ApiResponse<LoginUserInfo> getUserInfo(@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo user = this.getLoginUser(token); |
| | | if (user == null || !Constants.equalsInteger(user.getH5UserType(), LoginUserInfo.H5_USER_CUSTOMER)) { |
| | | return ApiResponse.failed("ç»å½å·²å¤±æ"); |
| | | } |
| | | return ApiResponse.success(ywCustomerH5AuthService.buildLoginUserInfo(user.getCustomerId())); |
| | | } |
| | | } |
| | |
| | | spring: |
| | | profiles: |
| | | active: pro |
| | | active: dev |
| | | application: |
| | | name: visitsAdmin |
| | | # å®å
¨é
ç½® |
| | |
| | | @ExcelColumn(name="ææºå·") |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "微信openid") |
| | | private String openid; |
| | | |
| | | @ApiModelProperty(value = "身份è¯å·ï¼å å¯ï¼") |
| | | @ExcelColumn(name="身份è¯å·ï¼å å¯ï¼") |
| | | private String idcardNo; |
| | |
| | | |
| | | WxAuthorizeVO ywWxAuthorize(String code); |
| | | |
| | | WxAuthorizeVO ywWxAuthorize(String code, Integer userType); |
| | | |
| | | |
| | | List<MemberVO> getVisitedMember(CheckVisitedDTO checkVisitedDTO); |
| | | |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.dao.system.dto.LoginPhoneDTO; |
| | | |
| | | public interface YwCustomerH5AuthService { |
| | | |
| | | String loginByPhone(LoginPhoneDTO dto); |
| | | |
| | | String loginByCustomerId(Integer customerId); |
| | | |
| | | String loginByOpenId(String openId); |
| | | |
| | | LoginUserInfo buildLoginUserInfo(Integer customerId); |
| | | } |
| | |
| | | import com.doumee.dao.web.response.WxAuthorizeVO; |
| | | import com.doumee.service.business.MemberService; |
| | | import com.doumee.service.business.SmsEmailService; |
| | | import com.doumee.service.business.YwCustomerH5AuthService; |
| | | import com.doumee.service.business.impl.hksync.HkSyncEmpowerServiceImpl; |
| | | import com.doumee.service.business.impl.hksync.ferp.HkSyncOrgUserToHKServiceImpl; |
| | | import com.doumee.service.system.SystemLoginService; |
| | |
| | | |
| | | @Autowired |
| | | private SystemLoginService systemLoginService; |
| | | |
| | | @Autowired |
| | | private YwCustomerH5AuthService ywCustomerH5AuthService; |
| | | |
| | | @Value("${debug_model}") |
| | | private Boolean isDebug; |
| | |
| | | */ |
| | | @Override |
| | | public WxAuthorizeVO ywWxAuthorize(String code){ |
| | | return ywWxAuthorize(code, LoginUserInfo.H5_USER_OPS); |
| | | } |
| | | |
| | | @Override |
| | | public WxAuthorizeVO ywWxAuthorize(String code, Integer userType){ |
| | | if(StringUtils.isBlank(code)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | |
| | | } |
| | | } |
| | | wxAuthorizeVO.setOpenid(openId); |
| | | //æ ¹æ®openId æ¥è¯¢ç¨æ·ä¿¡æ¯ |
| | | if(Constants.equalsInteger(userType, LoginUserInfo.H5_USER_CUSTOMER)){ |
| | | String token = ywCustomerH5AuthService.loginByOpenId(openId); |
| | | if(StringUtils.isNotBlank(token)){ |
| | | wxAuthorizeVO.setToken(token); |
| | | } |
| | | return wxAuthorizeVO; |
| | | } |
| | | //æ ¹æ®openId æ¥è¯¢è¿ç»´ç¨æ·ä¿¡æ¯ |
| | | SystemUser user = systemUserMapper.selectOne(new QueryWrapper<SystemUser>().lambda() |
| | | .eq(SystemUser::getOpenid,openId) |
| | | .eq(SystemUser::getDeleted,Boolean.FALSE) |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.doumee.config.jwt.JwtTokenUtil; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.YwCustomerMapper; |
| | | import com.doumee.dao.business.model.YwCustomer; |
| | | import com.doumee.dao.system.dto.LoginPhoneDTO; |
| | | import com.doumee.service.business.YwCustomerH5AuthService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | |
| | | @Service |
| | | public class YwCustomerH5AuthServiceImpl implements YwCustomerH5AuthService { |
| | | |
| | | @Autowired |
| | | private YwCustomerMapper ywCustomerMapper; |
| | | @Autowired |
| | | private JwtTokenUtil jwtTokenUtil; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String loginByPhone(LoginPhoneDTO dto) { |
| | | YwCustomer customer = findActiveByPhone(dto.getPhone()); |
| | | bindOpenId(customer, dto.getOpenid()); |
| | | touchLogin(customer); |
| | | return jwtTokenUtil.generateToken(toLoginUserInfo(customer)); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String loginByCustomerId(Integer customerId) { |
| | | YwCustomer customer = requireActiveCustomer(customerId); |
| | | touchLogin(customer); |
| | | return jwtTokenUtil.generateToken(toLoginUserInfo(customer)); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String loginByOpenId(String openId) { |
| | | if (StringUtils.isBlank(openId)) { |
| | | return null; |
| | | } |
| | | YwCustomer customer = ywCustomerMapper.selectOne(new QueryWrapper<YwCustomer>().lambda() |
| | | .eq(YwCustomer::getIsdeleted, Constants.ZERO) |
| | | .eq(YwCustomer::getOpenid, openId.trim()) |
| | | .last(" limit 1 ")); |
| | | if (customer == null) { |
| | | return null; |
| | | } |
| | | assertCustomerEnabled(customer); |
| | | touchLogin(customer); |
| | | return jwtTokenUtil.generateToken(toLoginUserInfo(customer)); |
| | | } |
| | | |
| | | @Override |
| | | public LoginUserInfo buildLoginUserInfo(Integer customerId) { |
| | | return toLoginUserInfo(requireActiveCustomer(customerId)); |
| | | } |
| | | |
| | | private YwCustomer findActiveByPhone(String phone) { |
| | | if (StringUtils.isBlank(phone)) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "ææºå·ä¸è½ä¸ºç©º"); |
| | | } |
| | | YwCustomer customer = ywCustomerMapper.selectOne(new QueryWrapper<YwCustomer>().lambda() |
| | | .eq(YwCustomer::getIsdeleted, Constants.ZERO) |
| | | .eq(YwCustomer::getPhone, phone.trim()) |
| | | .last(" limit 1 ")); |
| | | if (customer == null) { |
| | | throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT.getCode(), "åæ·ä¸åå¨ææªæ³¨å"); |
| | | } |
| | | assertCustomerEnabled(customer); |
| | | return customer; |
| | | } |
| | | |
| | | private YwCustomer requireActiveCustomer(Integer customerId) { |
| | | if (customerId == null) { |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | YwCustomer customer = ywCustomerMapper.selectById(customerId); |
| | | if (customer == null || Constants.equalsInteger(customer.getIsdeleted(), Constants.ONE)) { |
| | | throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT.getCode(), "åæ·ä¸åå¨ææªæ³¨å"); |
| | | } |
| | | assertCustomerEnabled(customer); |
| | | return customer; |
| | | } |
| | | |
| | | private void assertCustomerEnabled(YwCustomer customer) { |
| | | if (customer.getStatus() != null && Constants.equalsInteger(customer.getStatus(), Constants.ONE)) { |
| | | throw new BusinessException(ResponseStatus.NO_ALLOW_LOGIN.getCode(), "åæ·è´¦å·å·²ç¦ç¨"); |
| | | } |
| | | } |
| | | |
| | | private void bindOpenId(YwCustomer customer, String openid) { |
| | | if (StringUtils.isBlank(openid)) { |
| | | return; |
| | | } |
| | | ywCustomerMapper.update(null, new UpdateWrapper<YwCustomer>().lambda() |
| | | .set(YwCustomer::getOpenid, null) |
| | | .eq(YwCustomer::getOpenid, openid.trim()) |
| | | .ne(YwCustomer::getId, customer.getId())); |
| | | customer.setOpenid(openid.trim()); |
| | | } |
| | | |
| | | private void touchLogin(YwCustomer customer) { |
| | | Date now = new Date(); |
| | | customer.setLastLoginDate(now); |
| | | customer.setEditDate(now); |
| | | customer.setLoginNum((customer.getLoginNum() == null ? 0 : customer.getLoginNum()) + 1); |
| | | ywCustomerMapper.updateById(customer); |
| | | } |
| | | |
| | | private LoginUserInfo toLoginUserInfo(YwCustomer customer) { |
| | | LoginUserInfo loginUserInfo = new LoginUserInfo(); |
| | | loginUserInfo.setCustomerId(customer.getId()); |
| | | loginUserInfo.setId(customer.getId()); |
| | | loginUserInfo.setH5UserType(LoginUserInfo.H5_USER_CUSTOMER); |
| | | loginUserInfo.setRealname(customer.getName()); |
| | | loginUserInfo.setMobile(customer.getPhone()); |
| | | loginUserInfo.setUsername("customer_" + customer.getId()); |
| | | loginUserInfo.setSource(LoginUserInfo.SOURCE_H5_CUSTOMER); |
| | | loginUserInfo.setRoles(Collections.singletonList("h5_customer")); |
| | | loginUserInfo.setPermissions(Collections.emptyList()); |
| | | return loginUserInfo; |
| | | } |
| | | } |