fix:appCode
This commit is contained in:
+9
-5
@@ -353,8 +353,8 @@ public class SysUserController {
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/users-anon/miniApp")
|
||||
public MiniAppConfig findAppByAppId(@RequestParam String appId) {
|
||||
return miniAppConfigService.getByAppid(appId);
|
||||
public MiniAppConfig findAppByAppId(@RequestParam String appCode) {
|
||||
return miniAppConfigService.getByAppCode(appCode);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -436,9 +436,13 @@ public class SysUserController {
|
||||
/**
|
||||
* 新增或修改小程序配置
|
||||
*/
|
||||
@PostMapping("/miniapp/saveOrUpdate")
|
||||
@PostMapping("/miniApp/saveOrUpdate")
|
||||
@Operation(summary = "新增或修改小程序配置")
|
||||
public Result<Boolean> saveOrUpdateMiniAppConfig(@RequestBody MiniAppConfig config) {
|
||||
if (ObjectUtil.isNull(config.getAppCode())) {
|
||||
String codeId = UUID.randomUUID().toString();
|
||||
config.setAppCode(codeId);
|
||||
}
|
||||
boolean success = miniAppConfigService.saveOrUpdate(config);
|
||||
return success ? Result.succeed(true, "操作成功") : Result.failed("操作失败");
|
||||
}
|
||||
@@ -448,7 +452,7 @@ public class SysUserController {
|
||||
@Parameter(name = "page", description = "分页起始位置", required = true, in = ParameterIn.QUERY),
|
||||
@Parameter(name = "limit", description = "分页结束位置", required = true, in = ParameterIn.QUERY)
|
||||
})
|
||||
@GetMapping("/miniapp/list")
|
||||
@GetMapping("/miniApp/list")
|
||||
public PageResult<MiniAppConfig> findMiniAppConfigs(@RequestParam Map<String, Object> params) {
|
||||
return miniAppConfigService.findMiniAppConfigs(params);
|
||||
}
|
||||
@@ -456,7 +460,7 @@ public class SysUserController {
|
||||
/**
|
||||
* 根据ID查询小程序配置
|
||||
*/
|
||||
@GetMapping("/miniapp/{id}")
|
||||
@GetMapping("/miniApp/{id}")
|
||||
@Operation(summary = "根据ID查询小程序配置")
|
||||
public Result<MiniAppConfig> getMiniAppConfigById(@PathVariable Long id) {
|
||||
MiniAppConfig config = miniAppConfigService.getById(id);
|
||||
|
||||
+2
-2
@@ -7,6 +7,6 @@ import org.apache.ibatis.annotations.Select;
|
||||
|
||||
@Mapper
|
||||
public interface MiniAppConfigMapper extends SuperMapper<MiniAppConfig> {
|
||||
@Select("SELECT * FROM mini_app_config WHERE appid = #{appid} AND status = 1 LIMIT 1")
|
||||
MiniAppConfig selectByAppid(String appid);
|
||||
@Select("SELECT * FROM mini_app_config WHERE appCode = #{appCode} AND status = 1 LIMIT 1")
|
||||
MiniAppConfig selectByAppCode(String appCode);
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import com.central.common.service.ISuperService;
|
||||
import java.util.Map;
|
||||
|
||||
public interface MiniAppConfigService extends ISuperService<MiniAppConfig> {
|
||||
MiniAppConfig getByAppid(String appid);
|
||||
MiniAppConfig getByAppCode(String appCode);
|
||||
|
||||
PageResult<MiniAppConfig> findMiniAppConfigs(Map<String, Object> params);
|
||||
}
|
||||
|
||||
+2
-2
@@ -20,8 +20,8 @@ public class MiniAppConfigServiceImpl extends SuperServiceImpl<MiniAppConfigMapp
|
||||
private MiniAppConfigMapper miniAppConfigMapper;
|
||||
|
||||
@Override
|
||||
public MiniAppConfig getByAppid(String appid) {
|
||||
return miniAppConfigMapper.selectByAppid(appid);
|
||||
public MiniAppConfig getByAppCode(String appCode) {
|
||||
return miniAppConfigMapper.selectByAppCode(appCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,7 +39,7 @@ zlt:
|
||||
- sys_user
|
||||
- sys_role_user
|
||||
- sys_role_menu
|
||||
- sys_tenant
|
||||
- mini_app_config
|
||||
ignoreSqls:
|
||||
# 用户关联角色时,显示所有角色
|
||||
- com.central.user.mapper.SysRoleMapper.findAll
|
||||
|
||||
@@ -80,5 +80,5 @@ public interface UserService {
|
||||
|
||||
|
||||
@GetMapping("/users-anon/miniApp")
|
||||
MiniAppConfig getByAppid(@RequestParam("appId") String appid);
|
||||
MiniAppConfig getByAppid(@RequestParam("appCode") String appCode);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.central.common.model;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -15,10 +17,13 @@ import java.util.Date;
|
||||
@TableName("mini_app_config")
|
||||
public class MiniAppConfig {
|
||||
private Long id;
|
||||
private String appCode;
|
||||
private String appid;
|
||||
private String secret;
|
||||
private String name;
|
||||
private Integer status;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
########################## bootstrap级别通用配置 ##########################
|
||||
# 默认开发环境
|
||||
spring.profiles.active=prod
|
||||
spring.profiles.active=dev
|
||||
|
||||
##### nacos(注册中心和配置中心)地址
|
||||
spring.cloud.nacos.server-addr=81.70.164.178:8848
|
||||
#spring.cloud.nacos.server-addr=127.0.0.1:8848
|
||||
#spring.cloud.nacos.server-addr=81.70.164.178:8848
|
||||
spring.cloud.nacos.server-addr=127.0.0.1:8848
|
||||
spring.cloud.nacos.username=nacos
|
||||
#spring.cloud.nacos.password=nacos
|
||||
spring.cloud.nacos.password=nacosGFLY
|
||||
spring.cloud.nacos.password=nacos
|
||||
#spring.cloud.nacos.password=nacosGFLY
|
||||
spring.cloud.nacos.config.file-extension=yml
|
||||
spring.cloud.nacos.config.shared-configs[0].data-id=common.yml
|
||||
spring.cloud.nacos.config.shared-configs[0].refresh=true
|
||||
|
||||
@@ -9,43 +9,43 @@
|
||||
export default {
|
||||
dev: {
|
||||
'/api-uaa/': {
|
||||
target: 'http://119.45.169.13:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://119.45.169.13:9900',
|
||||
target: 'http://127.0.0.1:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-user/': {
|
||||
target: 'http://119.45.169.13:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://119.45.169.13:9900',
|
||||
target: 'http://127.0.0.1:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-log/': {
|
||||
target: 'http://119.45.169.13:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://119.45.169.13:9900',
|
||||
target: 'http://127.0.0.1:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-search/': {
|
||||
target: 'http://119.45.169.13:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://119.45.169.13:9900',
|
||||
target: 'http://127.0.0.1:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-generator/': {
|
||||
target: 'http://119.45.169.13:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://119.45.169.13:9900',
|
||||
target: 'http://127.0.0.1:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-file/': {
|
||||
target: 'http://119.45.169.13:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://119.45.169.13:9900',
|
||||
target: 'http://127.0.0.1:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-order/': {
|
||||
target: 'http://119.45.169.13:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://119.45.169.13:9900',
|
||||
target: 'http://127.0.0.1:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/api-device/': {
|
||||
target: 'http://119.45.169.13:9900',
|
||||
// target: 'http://127.0.0.1:9900',
|
||||
// target: 'http://119.45.169.13:9900',
|
||||
target: 'http://127.0.0.1:9900',
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -36,6 +36,10 @@
|
||||
path: '/system/myInfo.html',
|
||||
component: './system/UserInfo',
|
||||
},
|
||||
{
|
||||
path: '/system/miniApp.html',
|
||||
component: './system/MiniApp',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -66,6 +66,11 @@ const TableList: React.FC = () => {
|
||||
dataIndex: 'name',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: 'AppCode',
|
||||
dataIndex: 'appid',
|
||||
copyable: true,
|
||||
},
|
||||
{
|
||||
title: 'AppID',
|
||||
dataIndex: 'appid',
|
||||
|
||||
@@ -261,7 +261,7 @@ export async function getMiniAppList(params: {
|
||||
}
|
||||
|
||||
export async function saveOrUpdateMiniApp(data: SYSTEM.MiniApp) {
|
||||
return request<API.OptionalResult<any>>('/api-user/miniApp/save', {
|
||||
return request<API.OptionalResult<any>>('/api-user/miniApp/saveOrUpdate', {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user