🔥 个人信息:移除 username 修改的弹窗,因为现在 app 一般不用这块了,都是基于手机
This commit is contained in:
@@ -1,72 +0,0 @@
|
||||
<!-- 修改用户名 changeUsername -->
|
||||
<template>
|
||||
<view>
|
||||
<!-- 标题栏 -->
|
||||
<view class="head-box ss-m-b-60">
|
||||
<view class="head-title ss-m-b-20">修改用户名</view>
|
||||
<view class="head-subtitle">用户名仅限修改一次</view>
|
||||
</view>
|
||||
|
||||
<!-- 表单项 -->
|
||||
<uni-forms
|
||||
ref="formRef"
|
||||
v-model="state.model"
|
||||
:rules="state.rules"
|
||||
validateTrigger="bind"
|
||||
labelWidth="140"
|
||||
labelAlign="center"
|
||||
>
|
||||
<uni-forms-item name="username" label="用户名">
|
||||
<uni-easyinput
|
||||
placeholder="请输入用户名"
|
||||
v-model="state.model.username"
|
||||
:inputBorder="false"
|
||||
></uni-easyinput>
|
||||
</uni-forms-item>
|
||||
|
||||
<view class="editPwd-btn-box ss-m-t-80">
|
||||
<button class="ss-reset-button save-btn ui-Shadow-Main" @tap="changeUsernameSubmit">
|
||||
保存
|
||||
</button>
|
||||
</view>
|
||||
</uni-forms>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, watch, ref, reactive, unref } from 'vue';
|
||||
import sheep from '@/sheep';
|
||||
import { username } from '@/sheep/validate/form';
|
||||
import { showAuthModal, closeAuthModal } from '@/sheep/hooks/useModal';
|
||||
const formRef = ref(null);
|
||||
|
||||
// 数据
|
||||
const state = reactive({
|
||||
model: {
|
||||
username: '',
|
||||
},
|
||||
rules: {
|
||||
username,
|
||||
},
|
||||
});
|
||||
|
||||
// 7.修改用户名
|
||||
async function changeUsernameSubmit() {
|
||||
const validate = await unref(formRef)
|
||||
.validate()
|
||||
.catch((error) => {
|
||||
console.log('error: ', error);
|
||||
});
|
||||
if (!validate) return;
|
||||
sheep.$api.user.changeUsername(state.model).then((res) => {
|
||||
if (res.error === 0) {
|
||||
sheep.$store('user').getInfo();
|
||||
closeAuthModal();
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '../index.scss';
|
||||
</style>
|
||||
@@ -28,9 +28,6 @@
|
||||
<!-- 6.修改密码 changePassword-->
|
||||
<change-passwrod v-if="authType === 'changePassword'" />
|
||||
|
||||
<!-- 7.修改用户名 changeUsername-->
|
||||
<change-username v-if="authType === 'changeUsername'" />
|
||||
|
||||
<!-- 8.微信小程序授权 changeUsername-->
|
||||
<mp-authorization v-if="authType === 'mpAuthorization'" />
|
||||
|
||||
@@ -130,7 +127,6 @@
|
||||
import resetPassword from './components/reset-password.vue';
|
||||
import changeMobile from './components/change-mobile.vue';
|
||||
import changePasswrod from './components/change-password.vue';
|
||||
import changeUsername from './components/change-username.vue';
|
||||
import mpAuthorization from './components/mp-authorization.vue';
|
||||
import { closeAuthModal, showAuthModal } from '@/sheep/hooks/useModal';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user