增加自主注册判断与前端显示

This commit is contained in:
nilm
2021-11-19 16:48:33 +08:00
parent 91ad85aec1
commit 4f0cd8f54a
4 changed files with 32 additions and 6 deletions

View File

@ -56,4 +56,15 @@ export function getCodeImg() {
method: 'get',
timeout: 20000
})
}
// 获取是否自助注册
export function getRegisterSwitch() {
return request({
url: '/registerSwitch',
headers: {
isToken: false
},
method: 'get',
})
}

View File

@ -57,7 +57,7 @@
</template>
<script>
import { getCodeImg } from "@/api/login";
import { getCodeImg, getRegisterSwitch } from "@/api/login";
import Cookies from "js-cookie";
import { encrypt, decrypt } from '@/utils/jsencrypt'
@ -101,6 +101,7 @@ export default {
},
created() {
this.getCode();
this.getRegisterUser();
this.getCookie();
},
methods: {
@ -113,6 +114,11 @@ export default {
}
});
},
getRegisterUser() {
getRegisterSwitch().then(res =>{
this.register = res.registerUser === undefined ? false : res.registerUser;
})
},
getCookie() {
const username = Cookies.get("username");
const password = Cookies.get("password");