mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-02 07:06:37 +08:00
feature: 关闭注册功能
This commit is contained in:
@@ -15,7 +15,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-divider />
|
<el-divider />
|
||||||
<div>
|
<div v-if="!isAllowedUser" style="color: red; text-align: center; padding: 20px;">
|
||||||
|
<p>由于审核问题,暂不开放注册</p>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
<WangEditor v-model="topContent" height="220px" />
|
<WangEditor v-model="topContent" height="220px" />
|
||||||
<el-button
|
<el-button
|
||||||
@click="addTopComment"
|
@click="addTopComment"
|
||||||
@@ -48,6 +51,7 @@
|
|||||||
size="large"
|
size="large"
|
||||||
text
|
text
|
||||||
v-hasPer="['bbs:comment:add']"
|
v-hasPer="['bbs:comment:add']"
|
||||||
|
:disabled="!isAllowedUser"
|
||||||
>回复</el-button
|
>回复</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
@@ -131,12 +135,16 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, reactive, ref } from "vue";
|
import { onMounted, reactive, ref, computed } from "vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import { useRoute, useRouter } from "vue-router";
|
||||||
import { getListByDiscussId, add, del } from "@/apis/commentApi.js";
|
import { getListByDiscussId, add, del } from "@/apis/commentApi.js";
|
||||||
import AvatarInfo from "./AvatarInfo.vue";
|
import AvatarInfo from "./AvatarInfo.vue";
|
||||||
import { getPermission } from "@/utils/auth";
|
import { getPermission } from "@/utils/auth";
|
||||||
import WangEditor from "./WangEditor.vue"
|
import WangEditor from "./WangEditor.vue"
|
||||||
|
import useUserStore from "@/stores/user";
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const isAllowedUser = computed(() => userStore.userName === 'cc');
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
isComment: {
|
isComment: {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
@click="enterEditArticle"
|
@click="enterEditArticle"
|
||||||
type="primary"
|
type="primary"
|
||||||
:class="[!isEditArticle ? 'el-button--disabled' : '']"
|
:class="[!isEditArticle || !isAllowedUser ? 'el-button--disabled' : '']"
|
||||||
>发布主题</el-button
|
>发布主题</el-button
|
||||||
>
|
>
|
||||||
<el-dropdown>
|
<el-dropdown>
|
||||||
@@ -97,6 +97,10 @@ import { Session } from "@/utils/storage";
|
|||||||
import Skeleton from "@/components/Skeleton/index.vue";
|
import Skeleton from "@/components/Skeleton/index.vue";
|
||||||
import Tabs from "./components/tabs.vue";
|
import Tabs from "./components/tabs.vue";
|
||||||
import { cloneDeep } from "lodash";
|
import { cloneDeep } from "lodash";
|
||||||
|
import useUserStore from "@/stores/user";
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const isAllowedUser = computed(() => userStore.userName === 'cc');
|
||||||
|
|
||||||
const { getToken, clearStorage } = useAuths();
|
const { getToken, clearStorage } = useAuths();
|
||||||
//数据定义
|
//数据定义
|
||||||
@@ -163,6 +167,12 @@ const { isHasPermission: isEditArticle } = getPermission(
|
|||||||
|
|
||||||
const enterEditArticle = () => {
|
const enterEditArticle = () => {
|
||||||
const hasToken = getToken();
|
const hasToken = getToken();
|
||||||
|
|
||||||
|
if (!isAllowedUser.value) {
|
||||||
|
ElMessage.warning("由于审核问题,暂不开放注册");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isEditArticle) {
|
if (isEditArticle) {
|
||||||
//跳转路由
|
//跳转路由
|
||||||
var routerPer = {
|
var routerPer = {
|
||||||
|
|||||||
@@ -191,14 +191,14 @@ const captcha = async () => {
|
|||||||
<div class="input" style="width: 55%;margin: 0">
|
<div class="input" style="width: 55%;margin: 0">
|
||||||
<p>*登录账号</p>
|
<p>*登录账号</p>
|
||||||
<el-form-item prop="userName">
|
<el-form-item prop="userName">
|
||||||
<input type="text" v-model.trim="registerForm.userName">
|
<input type="text" v-model.trim="registerForm.userName" disabled>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="input" style="width: 35%;margin: 0">
|
<div class="input" style="width: 35%;margin: 0">
|
||||||
<p>昵称</p>
|
<p>昵称</p>
|
||||||
<el-form-item prop="nick">
|
<el-form-item prop="nick">
|
||||||
<input type="text" v-model.trim="registerForm.nick">
|
<input type="text" v-model.trim="registerForm.nick" disabled>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -207,34 +207,37 @@ const captcha = async () => {
|
|||||||
<p>*邮箱</p>
|
<p>*邮箱</p>
|
||||||
<el-form-item prop="email">
|
<el-form-item prop="email">
|
||||||
<div class="phone-code">
|
<div class="phone-code">
|
||||||
<input class="phone-code-input" type="text" v-model.trim="registerForm.email">
|
<input class="phone-code-input" type="text" v-model.trim="registerForm.email" disabled>
|
||||||
<button type="button" class="phone-code-btn" @click="clickPhoneCaptcha()">{{codeInfo}}</button>
|
<button type="button" class="phone-code-btn" disabled>{{codeInfo}}</button>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<p>*邮箱验证码</p>
|
<p>*邮箱验证码</p>
|
||||||
<el-form-item prop="code" >
|
<el-form-item prop="code" >
|
||||||
<input :disabled="!isDisabledCode" type="text" v-model.trim="registerForm.code">
|
<input disabled type="text" v-model.trim="registerForm.code">
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<p>*密码</p>
|
<p>*密码</p>
|
||||||
<el-form-item prop="password">
|
<el-form-item prop="password">
|
||||||
<input :disabled="!isDisabledCode" type="password" v-model.trim="registerForm.password">
|
<input disabled type="password" v-model.trim="registerForm.password">
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<p>*确认密码</p>
|
<p>*确认密码</p>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<input :disabled="!isDisabledCode" type="password" v-model.trim="passwordConfirm">
|
<input disabled type="password" v-model.trim="passwordConfirm">
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="input" style="color: red; text-align: center; margin-top: 10px;">
|
||||||
|
<p>由于审核问题,暂不开放注册</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="left-btn">
|
<div class="left-btn">
|
||||||
<button type="button" class="btn-login" :disabled="isRegistering" @click="register(registerFormRef)">{{ isRegistering ? '注册中...' : '注册' }}</button>
|
<button type="button" class="btn-login" disabled>注册</button>
|
||||||
<button type="button" class="btn-reg" @click="handleSignInNow">前往登录</button>
|
<button type="button" class="btn-reg" @click="handleSignInNow">前往登录</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user