Initial commit

master
username 2 months ago
parent c69d9c9673
commit 5edb953a56

@ -1,5 +1,6 @@
package com.bs.web.controller.system;
import cn.hutool.core.lang.Validator;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.bs.common.constant.Constants;
import com.bs.common.core.domain.entity.SysRole;
@ -16,6 +17,7 @@ import com.bs.system.mapper.SysUserRoleMapper;
import com.bs.system.service.ISysUserService;
import io.swagger.util.Json;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@ -70,6 +72,42 @@ public class SysRegisterController extends BaseController
// return error("当前系统没有开启注册功能!");
// }
String msg = registerService.register(user);
if (Validator.isNotEmpty(msg)) {
return error(msg);
}
LambdaQueryWrapper<SysUser> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysUser::getUserName,user.getUsername());
List<SysUser> sysUsers = userMapper.selectList(wrapper);
SysUser sysUser = sysUsers.get(0);
userService.insertUserAuth(sysUser.getUserId(), new Long[]{2L});
LoginUser loginUser = createLoginUser(sysUser, null);
String token = tokenService.createToken(loginUser);
AjaxResult ajax = AjaxResult.success();
ajax.put(Constants.TOKEN, token);
return ajax;
}
@GetMapping("/ceshi")
public AjaxResult ceshi()
{
// if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser"))))
// {
// return error("当前系统没有开启注册功能!");
// }
RegisterBody user = new RegisterBody();
user.setPassword("123456");
user.setUsername("测试手机号5");
user.setPhonenumber("18396103855");
// INSERT INTO sys_user (user_id, dept_id, user_name, nick_name, email, phonenumber, sex, avatar, password, status, review_status,
// tenant_id, user_type, create_time)
// VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
// 09:56:48.703 [http-nio-8089-exec-19] DEBUG c.b.s.m.S.insertNew - [debug,137] - ==> Parameters: 1737683808874(Long), 0(Long),
// 测试手机号2(String), 测试手机号2(String), null, 18396103859(String), null, null
String msg = registerService.register(user);
if (Validator.isNotEmpty(msg)) {
return error(msg);
}
LambdaQueryWrapper<SysUser> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SysUser::getUserName,user.getUsername());
List<SysUser> sysUsers = userMapper.selectList(wrapper);

@ -8,10 +8,10 @@ spring:
master:
url: jdbc:mysql://localhost:3306/df-broker?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
username: root
password: fastrise@chain
# url: jdbc:mysql://124.71.134.146:63306/my-base?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
password: root
# url: jdbc:mysql://120.77.170.30:3306/df-broker?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&rewriteBatchedStatements=true
# username: root
# password: abcd123
# password: fastrise@chain
# 从库数据源
slave:
# 从数据源开关/默认关闭

@ -16,10 +16,10 @@ bs:
copyrightYear: 2023
# 实例演示开关
demoEnabled: true
# 文件路径 示例( Windows配置D:/bs/uploadPathLinux配置 /home/bs/uploadPath
profile: D:/bs/uploadPath
# 文件路径 示例( Windows配置C:/bs/uploadPathLinux配置 /home/bs/uploadPath
profile: C:/bs/uploadPath
# 文件存储路径 windows 路径
winLocalFilePath: D:/bs/uploadPath
winLocalFilePath: C:/bs/uploadPath
# winLocalFilePath: E:/test
# 文件存储路径 linux 路径
linuxLocalFilePath: /home/chain-mos/attachment
@ -52,7 +52,7 @@ bs:
# 开发环境配置
server:
# 服务器的HTTP端口默认为8080
port: 8080
port: 8089
servlet:
# 应用的访问路径
context-path: /
@ -86,9 +86,9 @@ user:
servlet:
multipart:
# 单个文件大小
max-file-size: 10MB
max-file-size: 30MB
# 设置总上传的文件大小
max-request-size: 20MB
max-request-size: 40MB
# 服务模块
devtools:
restart:

@ -1,5 +1,6 @@
package com.bs.framework.web.service;
import cn.hutool.core.lang.Validator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.bs.common.constant.CacheConstants;
@ -50,12 +51,13 @@ public class SysRegisterService
SysUser sysUser = new SysUser();
sysUser.setUserName(username);
sysUser.setReviewStatus("1");
sysUser.setPhonenumber(registerBody.getPhonenumber());
// 验证码开关
boolean captchaEnabled = configService.selectCaptchaEnabled();
if (captchaEnabled)
{
validateCaptcha(username, registerBody.getCode(), registerBody.getUuid());
}
// boolean captchaEnabled = configService.selectCaptchaEnabled();
// if (captchaEnabled)
// {
// validateCaptcha(username, registerBody.getCode(), registerBody.getUuid());
// }
if (StringUtils.isEmpty(username))
{
msg = "用户名不能为空";
@ -78,15 +80,20 @@ public class SysRegisterService
{
msg = "保存用户'" + username + "'失败,注册账号已存在";
}
else if (Validator.isNotEmpty(sysUser.getPhonenumber()) && !userService.checkPhoneUnique(sysUser)) {
msg = "新增用户'" + sysUser.getUserName() + "'失败,手机号码已存在";
}
else
{
if (!StringUtils.isEmpty(registerBody.getShareUser())) {
SysUser sysUserShare = userService.selectUserById(Long.valueOf(registerBody.getShareUser()));
Long deptId = sysUserShare.getDeptId();
sysUser.setDeptId(deptId);
if (-1 == deptId) {
sysUser.setDeptId(0L);
}
} else {
sysUser.setDeptId(116L);
sysUser.setDeptId(0L);
}
sysUser.setPhonenumber(registerBody.getPhonenumber());
sysUser.setUserType("jj");

@ -187,8 +187,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert>
<insert id="insertByBroker" parameterType="com.bs.common.core.domain.entity.SysUser">
INSERT INTO df_user_broker (user_id, broker_id, create_time, tenant_id)
VALUES (#{user.userId}, #{user.brokerId}, #{user.createTime},0)
INSERT INTO df_user_broker (user_id, create_time, tenant_id)
VALUES (#{user.userId}, #{user.createTime},0)
</insert>
<update id="updateUser" parameterType="SysUser">

@ -5,10 +5,11 @@ VUE_APP_TITLE = 德富金服经纪推广系统
ENV = 'development'
# 德富金服经纪推广系统/开发环境
#VUE_APP_BASE_API = 'http://124.71.134.146:8096/prod-api'
VUE_APP_BASE_API = 'http://localhost:8080'
# VUE_APP_BASE_API = 'http://139.224.49.182:8086/prod-api'
# VUE_APP_BASE_API = 'http://localhost:8080'
# VUE_APP_BASE_API = 'http://tanjunwei.test.jiutianda.cn'
# VUE_APP_BASE_API = 'http://wangyi.test.jiutianda.cn'
VUE_APP_BASE_API = '/prod-api'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

@ -49,4 +49,4 @@ export function delDept(deptId) {
url: '/system/dept/' + deptId,
method: 'delete'
})
}
}

@ -327,11 +327,38 @@
</el-col>
<el-col :span="8">
<el-form-item label="产品名称" prop="ids">
<el-select style="width: 100%;" filterable multiple v-model="form.ids" placeholder="请选择产品名称"
:disabled="readonly"
clearable>
<el-option v-for="info in infoListAll" :key="info.id" :label="info.productName"
:value="info.id"/>
<el-select
multiple
v-model="form.ids"
@change="changeSelect"
placeholder="请选择"
filterable
reserve-keyword="true"
:remote="true"
:remote-method="filterMethod"
:loading="loading"
>
<!-- 全选 checkbox -->
<el-checkbox
v-model="checked"
@change="selectAll"
>全选</el-checkbox>
<!-- 循环 infoListAll 数据 -->
<el-option
v-for="info in filteredList"
:key="info.id"
:label="info.productName"
:value="info.id"
/>
<!-- 循环 options 数据 -->
<el-option
v-for="(item, index) in filteredOptions"
:key="index"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-form-item>
</el-col>
@ -428,6 +455,10 @@ export default {
},
data() {
return {
checked: false, //
options: [], //
filteredList: [], //
filteredOptions: [], //
openByAddAndUser: false,
readonly:false,
// isReadOnly: false,
@ -559,6 +590,36 @@ export default {
this.getAreaList();
},
methods: {
// filteredList filteredOptions
filterMethod(query) {
this.loading = true;
// query infoListAll options
this.filteredList = this.infoListAll.filter(info => info.productName.includes(query));
this.filteredOptions = this.options.filter(item => item.name.includes(query));
this.loading = false;
},
//
selectAll() {
if (this.checked) {
// form.ids
const allSelectedIds = [
...this.form.ids, //
...this.filteredList.map(info => info.id), //
];
this.form.ids = Array.from(new Set(allSelectedIds)); // 使 Set
} else {
// form.ids
this.form.ids = this.form.ids.filter(id => !this.filteredList.some(info => info.id === id));
}
this.filteredList = this.infoListAll;
},
changeSelect(val) {
if (val.length === this.infoListAll.length) {
this.checked = true
} else {
this.checked = false
}
},
tenantIdnormalizer(node, instanceId) {
if (node.children && !node.children.length) {
delete node.children
@ -599,6 +660,7 @@ export default {
}
listByBroker(params).then(response => {
this.infoListAll = response.data;
this.filteredList = this.infoListAll;
});
},
getAllInfoByUser(id) {

@ -69,13 +69,19 @@
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:pager-count="3"
@pagination="getList"
/>
<!-- <pagination-->
<!-- :total="total"-->
<!-- :page.sync="queryParams.pageNum"-->
<!-- :limit.sync="queryParams.pageSize"-->
<!-- @pagination="getList"-->
<!-- />-->
<el-dialog :title="title" :visible.sync="open" width="70%" append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="115px">
<el-row>
@ -247,11 +253,44 @@
</el-col>
<el-col :span="8">
<el-form-item label="产品名称" prop="ids">
<el-select style="width: 100%;" filterable multiple v-model="form.ids" placeholder="请选择产品名称"
:disabled="readonly"
clearable>
<el-option v-for="info in infoListAll" :key="info.id" :label="info.productName"
:value="info.id"/>
<!-- <el-select multiple v-model='form.ids' @change='changeSelect' placeholder='请选择' filterable>-->
<!-- <el-checkbox v-model="checked" @change='selectAll'>全选</el-checkbox>-->
<!-- <el-option v-for="info in infoListAll" :key="info.id" :label="info.productName"-->
<!-- :value="info.id"/>-->
<!-- <el-option v-for='(item, index) in options' :key='index' :label='item.name' :value='item.name'></el-option>-->
<!-- </el-select>-->
<el-select
multiple
v-model="form.ids"
@change="changeSelect"
placeholder="请选择"
filterable
reserve-keyword="true"
:remote="true"
:remote-method="filterMethod"
:loading="loading"
>
<!-- 全选 checkbox -->
<el-checkbox
v-model="checked"
@change="selectAll"
>全选</el-checkbox>
<!-- 循环 infoListAll 数据 -->
<el-option
v-for="info in filteredList"
:key="info.id"
:label="info.productName"
:value="info.id"
/>
<!-- 循环 options 数据 -->
<el-option
v-for="(item, index) in filteredOptions"
:key="index"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-form-item>
</el-col>
@ -348,6 +387,10 @@ export default {
},
data() {
return {
checked: false, //
options: [], //
filteredList: [], //
filteredOptions: [], //
openByAddAndUser: false,
readonly:false,
// isReadOnly: false,
@ -471,13 +514,57 @@ export default {
filteredCities() {
//
return this.cityList.filter(city => city.name.includes(this.searchText));
}
},
},
created() {
this.getList();
this.getAreaList();
},
methods: {
// filteredList filteredOptions
filterMethod(query) {
this.loading = true;
// query infoListAll options
this.filteredList = this.infoListAll.filter(info => info.productName.includes(query));
this.filteredOptions = this.options.filter(item => item.name.includes(query));
this.loading = false;
},
//
selectAll() {
if (this.checked) {
// form.ids
const allSelectedIds = [
...this.form.ids, //
...this.filteredList.map(info => info.id), //
];
this.form.ids = Array.from(new Set(allSelectedIds)); // 使 Set
} else {
// form.ids
this.form.ids = this.form.ids.filter(id => !this.filteredList.some(info => info.id === id));
}
this.filteredList = this.infoListAll;
},
// selectAll() {
// if (this.checked) {
// // form.ids
// const allSelectedIds = [
// ...this.form.ids, //
// ...this.filteredList.map(info => info.id), //
// ];
// this.form.ids = Array.from(new Set(allSelectedIds)); // 使 Set
// } else {
// // form.ids
// this.form.ids = this.form.ids.filter(id => !this.filteredList.some(info => info.id === id));
// }
// this.filteredList = this.infoListAll;
// },
changeSelect(val) {
if (val.length === this.infoListAll.length) {
this.checked = true
} else {
this.checked = false
}
},
tenantIdnormalizer(node, instanceId) {
if (node.children && !node.children.length) {
delete node.children
@ -529,6 +616,7 @@ export default {
}
listByUserId(params).then(response => {
this.infoListAll = response.data;
this.filteredList = this.infoListAll;
});
},
getAllIds(data) {

@ -61,13 +61,19 @@
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
:pager-count="3"
@pagination="getList"
/>
<!-- <pagination-->
<!-- :total="total"-->
<!-- :page.sync="queryParams.pageNum"-->
<!-- :limit.sync="queryParams.pageSize"-->
<!-- @pagination="getList"-->
<!-- />-->
<el-dialog :title="title" :visible.sync="open" width="70%" append-to-body :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="115px">
<el-row>
@ -239,11 +245,38 @@
</el-col>
<el-col :span="8">
<el-form-item label="产品名称" prop="ids">
<el-select style="width: 100%;" filterable multiple v-model="form.ids" placeholder="请选择产品名称"
:disabled="readonly"
clearable>
<el-option v-for="info in infoListAll" :key="info.id" :label="info.productName"
:value="info.id"/>
<el-select
multiple
v-model="form.ids"
@change="changeSelect"
placeholder="请选择"
filterable
reserve-keyword="true"
:remote="true"
:remote-method="filterMethod"
:loading="loading"
>
<!-- 全选 checkbox -->
<el-checkbox
v-model="checked"
@change="selectAll"
>全选</el-checkbox>
<!-- 循环 infoListAll 数据 -->
<el-option
v-for="info in filteredList"
:key="info.id"
:label="info.productName"
:value="info.id"
/>
<!-- 循环 options 数据 -->
<el-option
v-for="(item, index) in filteredOptions"
:key="index"
:label="item.name"
:value="item.name"
/>
</el-select>
</el-form-item>
</el-col>
@ -342,6 +375,10 @@ export default {
},
data() {
return {
checked: false, //
options: [], //
filteredList: [], //
filteredOptions: [], //
openByAddAndUser: false,
readonly:false,
// isReadOnly: false,
@ -462,6 +499,36 @@ export default {
this.getAreaList();
},
methods: {
// filteredList filteredOptions
filterMethod(query) {
this.loading = true;
// query infoListAll options
this.filteredList = this.infoListAll.filter(info => info.productName.includes(query));
this.filteredOptions = this.options.filter(item => item.name.includes(query));
this.loading = false;
},
//
selectAll() {
if (this.checked) {
// form.ids
const allSelectedIds = [
...this.form.ids, //
...this.filteredList.map(info => info.id), //
];
this.form.ids = Array.from(new Set(allSelectedIds)); // 使 Set
} else {
// form.ids
this.form.ids = this.form.ids.filter(id => !this.filteredList.some(info => info.id === id));
}
this.filteredList = this.infoListAll;
},
changeSelect(val) {
if (val.length === this.infoListAll.length) {
this.checked = true
} else {
this.checked = false
}
},
tenantIdnormalizer(node, instanceId) {
if (node.children && !node.children.length) {
delete node.children

@ -349,6 +349,23 @@ export default {
this.getList();
},
methods: {
selectAll() {
this.form.ids = []
if (this.checked) {
this.infoListAll.map((item) => {
this.form.ids.push(item.id)
})
} else {
this.form.ids = []
}
},
changeSelect(val) {
if (val.length === this.infoListAll.length) {
this.checked = true
} else {
this.checked = false
}
},
clearSelection() {
this.resetQuery();
},

@ -318,18 +318,39 @@
</el-col>
<el-col :span="8">
<el-form-item label="产品名称" prop="ids">
<el-select multiple v-model='form.ids' @change='changeSelect' placeholder='请选择'>
<el-checkbox v-model="checked" @change='selectAll'>全选</el-checkbox>
<el-option v-for="info in infoListAll" :key="info.id" :label="info.productName"
:value="info.id"/>
<el-option v-for='(item, index) in options' :key='index' :label='item.name' :value='item.name'></el-option>
<el-select
multiple
v-model="form.ids"
@change="changeSelect"
placeholder="请选择"
filterable
reserve-keyword="true"
:remote="true"
:remote-method="filterMethod"
:loading="loading"
>
<!-- 全选 checkbox -->
<el-checkbox
v-model="checked"
@change="selectAll"
>全选</el-checkbox>
<!-- 循环 infoListAll 数据 -->
<el-option
v-for="info in filteredList"
:key="info.id"
:label="info.productName"
:value="info.id"
/>
<!-- 循环 options 数据 -->
<el-option
v-for="(item, index) in filteredOptions"
:key="index"
:label="item.name"
:value="item.name"
/>
</el-select>
<!-- <el-select style="width: 100%;" filterable multiple v-model="form.ids" placeholder="请选择产品名称"-->
<!-- :disabled="readonly"-->
<!-- clearable>-->
<!-- <el-option v-for="info in infoListAll" :key="info.id" :label="info.productName"-->
<!-- :value="info.id"/>-->
<!-- </el-select>-->
</el-form-item>
</el-col>
</el-row>
@ -425,6 +446,9 @@ export default {
},
data() {
return {
options: [], //
filteredList: [], //
filteredOptions: [], //
openByAddAndUser: false,
readonly:false,
// isReadOnly: false,
@ -557,15 +581,28 @@ export default {
this.getAreaList();
},
methods: {
// filteredList filteredOptions
filterMethod(query) {
this.loading = true;
// query infoListAll options
this.filteredList = this.infoListAll.filter(info => info.productName.includes(query));
this.filteredOptions = this.options.filter(item => item.name.includes(query));
this.loading = false;
},
//
selectAll() {
this.form.ids = []
if (this.checked) {
this.infoListAll.map((item) => {
this.form.ids.push(item.id)
})
// form.ids
const allSelectedIds = [
...this.form.ids, //
...this.filteredList.map(info => info.id), //
];
this.form.ids = Array.from(new Set(allSelectedIds)); // 使 Set
} else {
this.form.ids = []
// form.ids
this.form.ids = this.form.ids.filter(id => !this.filteredList.some(info => info.id === id));
}
this.filteredList = this.infoListAll;
},
changeSelect(val) {
if (val.length === this.infoListAll.length) {
@ -625,6 +662,7 @@ export default {
}
listByRecommend(params).then(response => {
this.infoListAll = response.data;
this.filteredList = this.infoListAll;
});
},
getAllIds(data) {

@ -30,12 +30,12 @@ module.exports = {
// webpack-dev-server 相关配置
devServer: {
host: '0.0.0.0',
port: port,
port: 8086,
open: true,
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`,
target: `http://localhost:8089`,
changeOrigin: true,
pathRewrite: {
['^' + process.env.VUE_APP_BASE_API]: ''

Loading…
Cancel
Save