add email white list check in register handler

This commit is contained in:
RockYang
2024-09-20 14:10:40 +08:00
parent 246d96ee63
commit c522248d39
4 changed files with 123 additions and 7 deletions

View File

@@ -400,6 +400,18 @@
</el-form>
</div>
</el-tab-pane>
<el-tab-pane label="修复数据" name="fixData">
<div class="container">
<p class="text">有些版本升级的时候更新了数据库的结构比如字段名字改了需要把之前的字段的值转移到其他字段这些无法通过简单的 SQL 语句可以实现的需要手动写程序修正数据</p>
<p class="text">当前版本 v4.1.4 需要修正用户数据增加了 mobile email 字段需要把之前用手机号或者邮箱注册的用户的 username 字段数据初始化到 mobile 或者 email 字段另外需要把订单的支付渠道从名字称修正为 key</p>
<el-text type="danger">请注意在修复数据前请先备份好数据库以免数据丢失</el-text>
<p><el-button type="primary" @click="fixData">立即修复</el-button></p>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
@@ -408,7 +420,7 @@
import {onMounted, reactive, ref} from "vue";
import {httpGet, httpPost} from "@/utils/http";
import Compressor from "compressorjs";
import {ElMessage} from "element-plus";
import {ElMessage, ElMessageBox} from "element-plus";
import {InfoFilled, UploadFilled,Select,CloseBold} from "@element-plus/icons-vue";
import MdEditor from "md-editor-v3";
import 'md-editor-v3/lib/style.css';
@@ -463,7 +475,7 @@ onMounted(() => {
})
const fetchLicense = () => {
httpGet("/api/admin/config/get/license").then(res => {
httpGet("/api/admin/config/license").then(res => {
license.value = res.data
}).catch(e => {
ElMessage.error("获取 License 失败:" + e.message)
@@ -502,7 +514,7 @@ const active = () => {
if (licenseKey.value === "") {
return ElMessage.error("请输入授权码")
}
httpPost("/api/admin/active", {license: licenseKey.value}).then(res => {
httpPost("/api/admin/config/active", {license: licenseKey.value}).then(res => {
ElMessage.success("授权成功,机器编码为:" + res.data)
fetchLicense()
}).catch(e => {
@@ -556,6 +568,25 @@ const onUploadImg = (files, callback) => {
})
};
const fixData = () => {
ElMessageBox.confirm(
'在修复数据前,请先备份好数据库,以免数据丢失!是否继续操作?',
'警告',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
httpGet("/api/admin/config/fixData").then(() => {
ElMessage.success("数据修复成功")
}).catch(e => {
ElMessage.error("数据修复失败:" + e.message)
})
})
}
</script>
@@ -606,6 +637,10 @@ const onUploadImg = (files, callback) => {
}
.text {
font-size 14px
}
.active-info {
line-height 1.5
padding 10px 0 30px 0