注册增加来源

This commit is contained in:
fan 2022-06-23 15:51:49 +08:00
parent e699ed2e9b
commit a953bcff6c

View File

@ -41,6 +41,8 @@
<script>
import { registerUser } from '@/api/management/user';
import { ProjectCode } from '@/scripts/ProjectConfig';
import { getSessionStorage } from '@/utils/auth';
import md5 from 'js-md5';
export default {
name: 'Register',
@ -129,7 +131,8 @@ export default {
submitForm() {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
const data = { email: this.form.email, nickname: this.form.nickname, password: md5(this.form.password) };
const project = getSessionStorage('project');
const data = { email: this.form.email, nickname: this.form.nickname, password: md5(this.form.password), source: ProjectCode[project] || '' };
registerUser(data).then(resp => {
this.$message.success('账号注册成功!' );
this.doClose();