login msg
This commit is contained in:
parent
2f39a1882b
commit
592dcfcbe8
|
@ -1,28 +1,33 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<el-row :gutter="6">
|
||||
<el-col :xs="24" :md="16">
|
||||
<el-input
|
||||
v-model="listQuery.search"
|
||||
placeholder="项目/标准/编号/中心"
|
||||
style="width: 600px;"
|
||||
style="width: 100%"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="handleFilter"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :xs="24" :md="8" >
|
||||
<el-button
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
@click="handleFilter"
|
||||
>搜索</el-button>
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button
|
||||
class="filter-item"
|
||||
style="margin-left: 10px;"
|
||||
type="primary"
|
||||
icon="el-icon-refresh-left"
|
||||
@click="resetFilter"
|
||||
>刷新重置</el-button>
|
||||
</div>
|
||||
<div style="margin-top:10px">
|
||||
>刷新重置</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin-top: 10px">
|
||||
<!-- <el-button type="primary" icon="el-icon-plus" @click="handleAdd" v-if="checkPermission(['cma_create'])">新增</el-button> -->
|
||||
<el-popover
|
||||
placement="top"
|
||||
|
@ -31,51 +36,62 @@
|
|||
v-model="popovervisible"
|
||||
>
|
||||
<p>导入能力列表压缩包.</p>
|
||||
<div style="text-align: left; margin: 0;">
|
||||
<div style="text-align: left; margin: 0">
|
||||
<el-upload
|
||||
:action="upUrl"
|
||||
:on-success="handleUploadSuccess"
|
||||
accept=".rar,.zip"
|
||||
:headers="upHeaders"
|
||||
:show-file-list ="false"
|
||||
:show-file-list="false"
|
||||
>
|
||||
<el-button size="small" type="primary" @click="popovervisible = false">上传导入</el-button>
|
||||
</el-upload>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="popovervisible = false"
|
||||
>上传导入</el-button
|
||||
>
|
||||
</el-upload>
|
||||
</div>
|
||||
|
||||
<el-button slot="reference">导入CMA能力</el-button>
|
||||
</el-popover>
|
||||
<el-popover
|
||||
</el-popover>
|
||||
<el-popover
|
||||
placement="top"
|
||||
width="160"
|
||||
v-if="checkPermission(['ability_import'])"
|
||||
v-model="popovervisible2"
|
||||
>
|
||||
<p>导入能力列表压缩包.</p>
|
||||
<div style="text-align: left; margin: 0;">
|
||||
<div style="text-align: left; margin: 0">
|
||||
<el-upload
|
||||
:action="upUrl"
|
||||
:on-success="handleUploadSuccess2"
|
||||
accept=".rar"
|
||||
:headers="upHeaders"
|
||||
:show-file-list ="false"
|
||||
:show-file-list="false"
|
||||
>
|
||||
<el-button size="small" type="primary" @click="popovervisible2 = false">上传导入</el-button>
|
||||
</el-upload>
|
||||
<el-button
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="popovervisible2 = false"
|
||||
>上传导入</el-button
|
||||
>
|
||||
</el-upload>
|
||||
</div>
|
||||
|
||||
<el-button slot="reference">导入CNAS能力</el-button>
|
||||
</el-popover>
|
||||
</el-popover>
|
||||
</div>
|
||||
<el-card style="margin-top: 6px">
|
||||
<el-table
|
||||
v-loading="listLoading"
|
||||
:data="cmaList.results"
|
||||
style="width: 100%;margin-top:10px;"
|
||||
style="width: 100%; "
|
||||
border
|
||||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
max-height="300"
|
||||
max-height="320"
|
||||
ref="filterTable"
|
||||
@filter-change="filterChange"
|
||||
>
|
||||
|
@ -98,7 +114,9 @@
|
|||
<el-table-column align="header-center" label="标准编号">
|
||||
<template slot-scope="scope">{{ scope.row.bzbh }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="header-center" label="所属中心"
|
||||
<el-table-column
|
||||
align="header-center"
|
||||
label="所属中心"
|
||||
prop="sszx"
|
||||
column-key="sszx"
|
||||
:filters="groupBy.sszx"
|
||||
|
@ -127,23 +145,23 @@
|
|||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="cmaList.count>0"
|
||||
v-show="cmaList.count > 0"
|
||||
:total="cmaList.count"
|
||||
:page.sync="listQuery.page"
|
||||
:limit.sync="listQuery.page_size"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
</el-card>
|
||||
<el-card style="margin-top:6px">
|
||||
<el-table
|
||||
v-loading="listLoading2"
|
||||
:data="cnasList.results"
|
||||
style="width: 100%;margin-top:10px;"
|
||||
style="width: 100%;"
|
||||
border
|
||||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
max-height="300"
|
||||
|
||||
max-height="320"
|
||||
>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column align="header-center" label="类别名称">
|
||||
|
@ -161,8 +179,7 @@
|
|||
<el-table-column align="header-center" label="标准条款">
|
||||
<template slot-scope="scope">{{ scope.row.bztk }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="header-center" label="所属中心"
|
||||
>
|
||||
<el-table-column align="header-center" label="所属中心">
|
||||
<template slot-scope="scope">{{ scope.row.sszx }}</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column align="center" label="操作">
|
||||
|
@ -186,15 +203,23 @@
|
|||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="cnasList.count>0"
|
||||
v-show="cnasList.count > 0"
|
||||
:total="cnasList.count"
|
||||
:page.sync="listQuery2.page"
|
||||
:limit.sync="listQuery2.page_size"
|
||||
@pagination="getList2"
|
||||
/>
|
||||
|
||||
<el-dialog :visible.sync="dialogVisible" :title="dialogType==='edit'?'编辑':'新增'">
|
||||
<el-form ref="Form" :model="cma" label-width="80px" label-position="right" >
|
||||
</el-card>
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisible"
|
||||
:title="dialogType === 'edit' ? '编辑' : '新增'"
|
||||
>
|
||||
<el-form
|
||||
ref="Form"
|
||||
:model="cma"
|
||||
label-width="80px"
|
||||
label-position="right"
|
||||
>
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="cma.name" placeholder="姓名" />
|
||||
</el-form-item>
|
||||
|
@ -202,36 +227,44 @@
|
|||
<el-input v-model="cma.username" placeholder="账户" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="text-align:right;">
|
||||
<el-button type="danger" @click="dialogVisible=false">取消</el-button>
|
||||
<div style="text-align: right">
|
||||
<el-button type="danger" @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="confirm('Form')">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<style >
|
||||
.el-table-filter{
|
||||
width:300px;
|
||||
.el-table-filter {
|
||||
width: 300px;
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import { getCMAList, createCMA, deleteCMA, updateCMA, importCMA, getCNASList, importCNAS, getCMAGroup } from "@/api/cma";
|
||||
import checkPermission from "@/utils/permission"
|
||||
import { upUrl, upHeaders } from "@/api/file"
|
||||
import Pagination from "@/components/Pagination" // secondary package based on el-pagination
|
||||
import {
|
||||
getCMAList,
|
||||
createCMA,
|
||||
deleteCMA,
|
||||
updateCMA,
|
||||
importCMA,
|
||||
getCNASList,
|
||||
importCNAS,
|
||||
getCMAGroup,
|
||||
} from "@/api/cma";
|
||||
import checkPermission from "@/utils/permission";
|
||||
import { upUrl, upHeaders } from "@/api/file";
|
||||
import Pagination from "@/components/Pagination"; // secondary package based on el-pagination
|
||||
const defaultCMA = {
|
||||
id: "",
|
||||
dlxh:null,
|
||||
dlmc:null,
|
||||
|
||||
dlxh: null,
|
||||
dlmc: null,
|
||||
};
|
||||
const dflistQuery = {
|
||||
page: 1,
|
||||
page_size: 20,
|
||||
type:'center'
|
||||
}
|
||||
type: "center",
|
||||
};
|
||||
export default {
|
||||
components: { Pagination },
|
||||
data() {
|
||||
|
@ -239,19 +272,19 @@ export default {
|
|||
cma: defaultCMA,
|
||||
upHeaders: upHeaders(),
|
||||
upUrl: upUrl(),
|
||||
groupBy:{sszx:[]},
|
||||
cmaList: {count:0},
|
||||
cnasList: {count:0},
|
||||
groupBy: { sszx: [] },
|
||||
cmaList: { count: 0 },
|
||||
cnasList: { count: 0 },
|
||||
listLoading: true,
|
||||
listLoading2:false,
|
||||
listLoading2: false,
|
||||
listQuery: Object.assign({}, dflistQuery),
|
||||
listQuery2: {
|
||||
page: 1,
|
||||
page_size: 20
|
||||
page_size: 20,
|
||||
},
|
||||
enabledOptions: [
|
||||
{ key: "true", display_name: "激活" },
|
||||
{ key: "false", display_name: "禁用" }
|
||||
{ key: "false", display_name: "禁用" },
|
||||
],
|
||||
dialogVisible: false,
|
||||
dialogType: "new",
|
||||
|
@ -260,131 +293,138 @@ export default {
|
|||
};
|
||||
},
|
||||
computed: {},
|
||||
watch: {
|
||||
},
|
||||
watch: {},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getGroup()
|
||||
this.getList2()
|
||||
this.getList();
|
||||
this.getGroup();
|
||||
this.getList2();
|
||||
},
|
||||
methods: {
|
||||
checkPermission,
|
||||
handleUploadSuccess(res, file) {
|
||||
const loading = this.openLoading()
|
||||
let data = {path:res.data.path}
|
||||
importCMA(data).then(res=>{
|
||||
const loading = this.openLoading();
|
||||
let data = { path: res.data.path };
|
||||
importCMA(data)
|
||||
.then((res) => {
|
||||
this.$message({
|
||||
message: '导入成功',
|
||||
type: 'success'
|
||||
message: "导入成功",
|
||||
type: "success",
|
||||
});
|
||||
loading.close();
|
||||
this.resetFilter();
|
||||
})
|
||||
loading.close()
|
||||
this.resetFilter()
|
||||
}).catch(error=>{loading.close()})
|
||||
.catch((error) => {
|
||||
loading.close();
|
||||
});
|
||||
},
|
||||
handleUploadSuccess2(res, file) {
|
||||
const loading = this.openLoading()
|
||||
let data = {path:res.data.path}
|
||||
importCNAS(data).then(res=>{
|
||||
const loading = this.openLoading();
|
||||
let data = { path: res.data.path };
|
||||
importCNAS(data)
|
||||
.then((res) => {
|
||||
this.$message({
|
||||
message: '导入成功',
|
||||
type: 'success'
|
||||
message: "导入成功",
|
||||
type: "success",
|
||||
});
|
||||
loading.close();
|
||||
this.resetFilter();
|
||||
})
|
||||
loading.close()
|
||||
this.resetFilter()
|
||||
}).catch(error=>{loading.close()})
|
||||
.catch((error) => {
|
||||
loading.close();
|
||||
});
|
||||
},
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
getCMAList(this.listQuery).then(response => {
|
||||
getCMAList(this.listQuery).then((response) => {
|
||||
if (response.data) {
|
||||
this.cmaList = response.data
|
||||
this.cmaList = response.data;
|
||||
}
|
||||
this.listLoading = false
|
||||
})
|
||||
this.listLoading = false;
|
||||
});
|
||||
},
|
||||
getGroup() {
|
||||
for(let key in this.groupBy){
|
||||
let data = Object.assign({}, this.listQuery)
|
||||
data.group_by = key
|
||||
getCMAGroup(data).then(response => {
|
||||
this.groupBy[key] = response.data
|
||||
})
|
||||
for (let key in this.groupBy) {
|
||||
let data = Object.assign({}, this.listQuery);
|
||||
data.group_by = key;
|
||||
getCMAGroup(data).then((response) => {
|
||||
this.groupBy[key] = response.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
getList2() {
|
||||
this.listLoading2 = true;
|
||||
getCNASList(this.listQuery2).then(response => {
|
||||
getCNASList(this.listQuery2).then((response) => {
|
||||
if (response.data) {
|
||||
this.cnasList = response.data
|
||||
this.cnasList = response.data;
|
||||
}
|
||||
this.listLoading2 = false
|
||||
})
|
||||
this.listLoading2 = false;
|
||||
});
|
||||
},
|
||||
resetFilter() {
|
||||
this.listQuery = Object.assign({}, dflistQuery),
|
||||
this.listQuery2 = {
|
||||
(this.listQuery = Object.assign({}, dflistQuery)),
|
||||
(this.listQuery2 = {
|
||||
page: 1,
|
||||
page_size: 20
|
||||
}
|
||||
this.getList()
|
||||
this.getList2()
|
||||
this.getGroup()
|
||||
page_size: 20,
|
||||
});
|
||||
this.getList();
|
||||
this.getList2();
|
||||
this.getGroup();
|
||||
},
|
||||
handleFilter() {
|
||||
this.listQuery.page = 1
|
||||
this.getList()
|
||||
this.listQuery2.page = 1
|
||||
this.listQuery2.search = this.listQuery.search
|
||||
this.getList2()
|
||||
this.getGroup()
|
||||
this.listQuery.page = 1;
|
||||
this.getList();
|
||||
this.listQuery2.page = 1;
|
||||
this.listQuery2.search = this.listQuery.search;
|
||||
this.getList2();
|
||||
this.getGroup();
|
||||
},
|
||||
handleAdd() {
|
||||
this.cma = Object.assign({}, defaultCMA)
|
||||
this.dialogType = "new"
|
||||
this.dialogVisible = true
|
||||
this.cma = Object.assign({}, defaultCMA);
|
||||
this.dialogType = "new";
|
||||
this.dialogVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["Form"].clearValidate()
|
||||
})
|
||||
this.$refs["Form"].clearValidate();
|
||||
});
|
||||
},
|
||||
handleEdit(scope) {
|
||||
this.cma = Object.assign({}, scope.row) // copy obj
|
||||
this.dialogType = "edit"
|
||||
this.dialogVisible = true
|
||||
this.cma = Object.assign({}, scope.row); // copy obj
|
||||
this.dialogType = "edit";
|
||||
this.dialogVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs["Form"].clearValidate()
|
||||
})
|
||||
this.$refs["Form"].clearValidate();
|
||||
});
|
||||
},
|
||||
handleDelete(scope) {
|
||||
this.$confirm("确认删除?", "警告", {
|
||||
confirmButtonText: "确认",
|
||||
cancelButtonText: "取消",
|
||||
type: "error"
|
||||
type: "error",
|
||||
})
|
||||
.then(async () => {
|
||||
await deleteCMA(scope.row.id);
|
||||
this.cmaList.splice(scope.row.index, 1);
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "成功删除!"
|
||||
message: "成功删除!",
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
.catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
},
|
||||
filterChange (obj) {
|
||||
for(let key in obj){
|
||||
this.listQuery[key] = obj[key][0]
|
||||
}
|
||||
this.listQuery.page=1
|
||||
this.getList()
|
||||
},
|
||||
filterChange(obj) {
|
||||
for (let key in obj) {
|
||||
this.listQuery[key] = obj[key][0];
|
||||
}
|
||||
this.listQuery.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
async confirm(form) {
|
||||
this.$refs[form].validate(valid => {
|
||||
this.$refs[form].validate((valid) => {
|
||||
if (valid) {
|
||||
const isEdit = this.dialogType === "edit";
|
||||
if (isEdit) {
|
||||
updateCMA(this.cma.id, this.cma).then(res => {
|
||||
updateCMA(this.cma.id, this.cma).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
|
@ -392,12 +432,12 @@ this.getList()
|
|||
title: "成功",
|
||||
message: "编辑成功",
|
||||
type: "success",
|
||||
duration: 2000
|
||||
duration: 2000,
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
createCMA(this.cma).then(res => {
|
||||
createCMA(this.cma).then((res) => {
|
||||
if (res.code >= 200) {
|
||||
this.getList();
|
||||
this.dialogVisible = false;
|
||||
|
@ -405,7 +445,7 @@ this.getList()
|
|||
title: "成功",
|
||||
message: "新增成功",
|
||||
type: "success",
|
||||
duration: 2000
|
||||
duration: 2000,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -414,7 +454,7 @@ this.getList()
|
|||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<el-select v-model="listQuery.sszx" placeholder="所属中心" @change="handleFilter2" clearable>
|
||||
<el-row :gutter="6">
|
||||
<el-col :xs="24" :md="4">
|
||||
<el-select v-model="listQuery.sszx" placeholder="所属中心" @change="handleFilter2" clearable style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in groupBy.sszx"
|
||||
:key="item.value"
|
||||
|
@ -9,13 +10,18 @@
|
|||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
||||
<el-col :xs="24" :md="8">
|
||||
<el-input
|
||||
v-model="listQuery.search"
|
||||
placeholder="项目/标准/编号/中心"
|
||||
style="width: 600px;"
|
||||
style="width: 100%;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="handleFilter"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :xs="24" :md="6">
|
||||
<el-button
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
|
@ -24,12 +30,12 @@
|
|||
>搜索</el-button>
|
||||
<el-button
|
||||
class="filter-item"
|
||||
style="margin-left: 10px;"
|
||||
type="primary"
|
||||
icon="el-icon-refresh-left"
|
||||
@click="resetFilter"
|
||||
>刷新重置</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin-top:10px">
|
||||
<!-- <el-button type="primary" icon="el-icon-plus" @click="handleAdd" v-if="checkPermission(['cma_create'])">新增</el-button> -->
|
||||
<el-popover
|
||||
|
@ -62,7 +68,7 @@
|
|||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
max-height="600"
|
||||
max-height="700"
|
||||
ref="filterTable"
|
||||
@filter-change="filterChange"
|
||||
>
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<div>
|
||||
<el-select v-model="listQuery.sszx" placeholder="所属单位" @change="handleFilter2" clearable>
|
||||
<el-row :gutter="6">
|
||||
<el-col :xs="24" :md="4">
|
||||
<el-select v-model="listQuery.sszx" placeholder="所属单位" @change="handleFilter2" clearable style="width: 100%;">
|
||||
<el-option
|
||||
v-for="item in groupBy.sszx"
|
||||
:key="item.value"
|
||||
|
@ -9,13 +10,17 @@
|
|||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :xs="24" :md="8">
|
||||
<el-input
|
||||
v-model="listQuery.search"
|
||||
placeholder="资质/服务"
|
||||
style="width: 40%;"
|
||||
style="width: 100%;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="handleFilter"
|
||||
/>
|
||||
</el-col>
|
||||
<el-col :xs="24" :md="6">
|
||||
<el-button
|
||||
class="filter-item"
|
||||
type="primary"
|
||||
|
@ -24,12 +29,12 @@
|
|||
>搜索</el-button>
|
||||
<el-button
|
||||
class="filter-item"
|
||||
style="margin-left: 10px;"
|
||||
type="primary"
|
||||
icon="el-icon-refresh-left"
|
||||
@click="resetFilter"
|
||||
>刷新</el-button>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin-top:10px">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd" v-if="checkPermission(['qualification_create'])">新增</el-button>
|
||||
<!-- <el-popover
|
||||
|
@ -62,7 +67,7 @@
|
|||
fit
|
||||
stripe
|
||||
highlight-current-row
|
||||
max-height="600"
|
||||
max-height="700"
|
||||
ref="filterTable"
|
||||
@filter-change="filterChange"
|
||||
>
|
||||
|
|
|
@ -140,7 +140,7 @@ export default {
|
|||
disabled:false,
|
||||
buttonmsg:'发送验证码',
|
||||
count:20,
|
||||
activeName: "pwd",
|
||||
activeName: "msg",
|
||||
loginForm: {
|
||||
username: "",
|
||||
password: "",
|
||||
|
|
|
@ -65,7 +65,7 @@ class Login2View(APIView):
|
|||
msg = request.data['msg']
|
||||
if not User.objects.filter(username=mail).exists():
|
||||
return Response('账户不存在', status=status.HTTP_400_BAD_REQUEST)
|
||||
if Message.objects.filter(mail=mail).last().msg == msg:
|
||||
if Message.objects.filter(mail=mail).exists() and Message.objects.filter(mail=mail).last().msg == msg:
|
||||
user = User.objects.get(username=mail)
|
||||
return Response(get_tokens_for_user(user), status=status.HTTP_200_OK)
|
||||
return Response('验证码错误', status=status.HTTP_400_BAD_REQUEST)
|
||||
|
@ -75,7 +75,7 @@ class sendMsg(APIView):
|
|||
permission_classes = []
|
||||
|
||||
def post(self, request):
|
||||
code = random.randint(1000,9999)
|
||||
code = random.randint(10000,99999)
|
||||
my_sender = 'caoqianming@ctc.ac.cn'
|
||||
my_user = request.data['mail']
|
||||
my_pass = '9093QQww'
|
||||
|
@ -101,6 +101,7 @@ class sendMsg(APIView):
|
|||
server.sendmail(my_sender,[my_user,],msg.as_string())
|
||||
# 关闭连接
|
||||
server.quit()
|
||||
Message.objects.filter(mail=my_user).delete()
|
||||
Message.objects.create(mail=my_user, msg=code)
|
||||
except:
|
||||
return Response('验证码发送失败', status=status.HTTP_400_BAD_REQUEST)
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue