diff --git a/.env.development b/.env.development index 302ecd1..8218484 100644 --- a/.env.development +++ b/.env.development @@ -1,10 +1,10 @@ # 页面标题 -VUE_APP_TITLE = 若依管理系统 +VUE_APP_TITLE = bitcopay # 开发环境配置 ENV = 'development' -# 若依管理系统/开发环境 +# bitcopay/开发环境 VUE_APP_BASE_API = '/dev-api' # 路由懒加载 diff --git a/.env.production b/.env.production index b4893b0..9b189aa 100644 --- a/.env.production +++ b/.env.production @@ -1,8 +1,8 @@ # 页面标题 -VUE_APP_TITLE = 若依管理系统 +VUE_APP_TITLE = bitcopay # 生产环境配置 ENV = 'production' -# 若依管理系统/生产环境 +# bitcopay/生产环境 VUE_APP_BASE_API = '/prod-api' diff --git a/.env.staging b/.env.staging index 3f732ea..5a9eccf 100644 --- a/.env.staging +++ b/.env.staging @@ -1,8 +1,8 @@ # 页面标题 -VUE_APP_TITLE = 若依管理系统 +VUE_APP_TITLE = bitcopay # 测试环境配置 ENV = 'staging' -# 若依管理系统/测试环境 +# bitcopay/测试环境 VUE_APP_BASE_API = '/stage-api' diff --git a/bitcopay后台-开发环境.zip b/bitcopay后台-开发环境.zip index 2531364..a59ca73 100644 Binary files a/bitcopay后台-开发环境.zip and b/bitcopay后台-开发环境.zip differ diff --git a/bitcopay后台-正式环境.zip b/bitcopay后台-正式环境.zip index 510b404..38bc421 100644 Binary files a/bitcopay后台-正式环境.zip and b/bitcopay后台-正式环境.zip differ diff --git a/public/favicon.ico b/public/favicon.ico index e263760..65fb999 100644 Binary files a/public/favicon.ico and b/public/favicon.ico differ diff --git a/src/api/form.js b/src/api/form.js index 3603350..2c64480 100644 --- a/src/api/form.js +++ b/src/api/form.js @@ -298,3 +298,33 @@ export const payGetMerchantTotalInfo = { }) }, } + + +/** + * 用户模块 + */ + export const payAgentUser = { + // 更新密钥 + upGoogleCaptcha: (data) => { + return request({ + url: '/system/user/upGoogleCaptcha?userId=' + data.userId, + method: 'PUT', + headers: { + Authorization: "Bearer " + getToken(), + }, + }) + }, + // 获取用户谷歌密钥 + getGoogleCaptcha: (query) => { + return request({ + url: '/system/user/getGoogleCaptcha', + method: 'get', + params: query, + headers: { + Authorization: "Bearer " + getToken(), + }, + }) + }, + + +} diff --git a/src/views/index.vue b/src/views/index.vue index 20f99f3..e0c4447 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -41,7 +41,7 @@

若依后台管理框架

- 一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适自己的。于是利用空闲休息时间开始自己写一套后台系统。如此有了若依管理系统,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。 + 一直想做一款后台管理系统,看了很多优秀的开源项目但是发现没有合适自己的。于是利用空闲休息时间开始自己写一套后台系统。如此有了bitcopay,她可以用于所有的Web应用程序,如网站管理后台,网站会员中心,CMS,CRM,OA等等,当然,您也可以对她进行深度定制,以做出更强系统。所有前端后台代码封装过后十分精简易上手,出错概率低。同时支持移动客户端访问。系统会陆续更新一些实用功能。

当前版本: v{{ version }} diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index ee6215d..6bc0554 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -2,7 +2,7 @@

- + -
- - - - - - - - - - - - - - - - - - 搜索 - 重置 - - +
+ + + + + + + + + + + + + + + + + + 搜索 + 重置 + +
- - - 新增 - - - 修改 - - - 删除 - - + + + 新增 + + + 修改 + + + 删除 + + + + + + + + + + + + + + + + + + + + @@ -340,6 +297,7 @@ import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUs import { getToken } from "@/utils/auth"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; +import { payAgentUser } from "@/api/form"; export default { name: "User", @@ -347,6 +305,8 @@ export default { components: { Treeselect }, data() { return { + // 是否显示弹出层 + openCode: false, // 遮罩层 loading: true, // 选中数组 @@ -419,6 +379,9 @@ export default { ], // 表单校验 rules: { + // ipWhiteList: [ + // { required: true, message: "登录白名单不能为空", trigger: "blur" }, + // ], userName: [ { required: true, message: "用户名称不能为空", trigger: "blur" }, { min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' } @@ -461,14 +424,93 @@ export default { }); }, methods: { + /** 身份验证操作 */ + handleCode(title, val) { + this.reset(); + // 添加userid + if (val) { + this.form.userId = val.userId + } + this.title = title; + this.openCode = true; + }, + + + /** 提交按钮 */ + submitFormCode() { + if (!this.form.code) { + this.$message.error('请输入谷歌验证码') + return + } + this.$refs["form"].validate((valid) => { + if (valid) { + const loading = this.$loading({ + lock: true, + // text: `正在${this.form.userId ? "获取" : "添加"}${this.title}`, + spinner: "el-icon-loading", + background: "rgba(0, 0, 0, 0.7)", + }); + if (this.form.userId && !this.form.password) { + payAgentUser + .getGoogleCaptcha(this.form) + .then((response) => { + loading.close(); + this.form.googleCaptcha = response.data.googleCaptcha + this.$forceUpdate() + }) + .catch(() => { + loading.close(); + }); + } + if (this.form.googleCaptcha) { + /** 重置密码按钮操作 */ + resetUserPwd(this.form.userId, this.form.password).then(response => { + this.openCode = false; + this.msgSuccess("修改成功,新密码是:" + this.form.password); + this.getList(); + loading.close(); + }).finally(() => { + loading.close(); + }) + } + if (!this.form.userId) { + payAgentUser + .addInfo(this.form) + .then((response) => { + loading.close(); + this.open = false; + this.msgSuccess("新增成功"); + this.getList(); + }) + .catch((err) => { + loading.close(); + }); + } + + } + }); + }, + + // 更新密钥 + updateKey() { + payAgentUser + .upGoogleCaptcha({ + userId: this.form.userId + }) + .then((response) => { + this.form.googleCaptcha = response.data.googleCaptcha + this.$forceUpdate() + }); + }, + /** 查询用户列表 */ getList() { this.loading = true; listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => { - this.userList = response.rows; - this.total = Number(response.total); - this.loading = false; - } + this.userList = response.rows; + this.total = Number(response.total); + this.loading = false; + } ); }, /** 查询部门下拉树结构 */ @@ -490,34 +532,24 @@ export default { // 用户状态修改 handleStatusChange(row) { let text = row.status === "0" ? "启用" : "停用"; - this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function() { + this.$modal.confirm('确认要"' + text + '""' + row.userName + '"用户吗?').then(function () { return changeUserStatus(row.userId, row.status); }).then(() => { this.$modal.msgSuccess(text + "成功"); - }).catch(function() { + }).catch(function () { row.status = row.status === "0" ? "1" : "0"; }); }, // 取消按钮 cancel() { this.open = false; - this.reset(); + this.openCode = false, + this.reset(); }, // 表单重置 reset() { this.form = { - userId: undefined, - deptId: undefined, - userName: undefined, - nickName: undefined, - password: undefined, - phonenumber: undefined, - email: undefined, - sex: undefined, - status: "0", - remark: undefined, - postIds: [], - roleIds: [] + }; this.resetForm("form"); }, @@ -588,18 +620,18 @@ export default { inputPattern: /^.{5,20}$/, inputErrorMessage: "用户密码长度必须介于 5 和 20 之间" }).then(({ value }) => { - resetUserPwd(row.userId, value).then(response => { - this.$modal.msgSuccess("修改成功,新密码是:" + value); - }); - }).catch(() => {}); + resetUserPwd(row.userId, value).then(response => { + this.$modal.msgSuccess("修改成功,新密码是:" + value); + }); + }).catch(() => { }); }, /** 分配角色操作 */ - handleAuthRole: function(row) { + handleAuthRole: function (row) { const userId = row.userId; this.$router.push("/system/user-auth/role/" + userId); }, /** 提交按钮 */ - submitForm: function() { + submitForm: function () { this.$refs["form"].validate(valid => { if (valid) { if (this.form.userId != undefined) { @@ -621,12 +653,12 @@ export default { /** 删除按钮操作 */ handleDelete(row) { const userIds = row.userId || this.ids; - this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function() { + this.$modal.confirm('是否确认删除用户编号为"' + userIds + '"的数据项?').then(function () { return delUser(userIds); }).then(() => { this.getList(); this.$modal.msgSuccess("删除成功"); - }).catch(() => {}); + }).catch(() => { }); }, /** 导出按钮操作 */ handleExport() { @@ -663,3 +695,15 @@ export default { } }; +