Procházet zdrojové kódy

Merge branch 'master' of http://git.dgtis.com/zhangningning/ali_ai_learn_web

zhangningning před 3 týdny
rodič
revize
c4874134ff

+ 6 - 0
src/api/auth.js

@@ -45,3 +45,9 @@ export function resetPassword(data = {}) {
 export function getPasswordresetCode(data = {}) {
   return request.get('/auth/user/password/reset/request',data)
 }
+
+
+// 发送绑定验证码
+export function sendBindCode(data = {}) {
+  return request.get('/auth/user/bind/code',data)
+}

+ 1 - 1
src/components/course-card.vue

@@ -28,7 +28,7 @@
         </div>
       </div>
       <div class="gap10 mt16 button-container">
-        <el-button type="primary" class="flex_1" size="large" plain @click.stop.prevent="goWorkflowDetail">
+        <el-button type="primary" class="flex_1" size="large" style="background: #EAF1FF;border-color: #EAF1FF;color: #2D71FF;" @click.stop.prevent="goWorkflowDetail">
           <el-icon class="mr10"><Document /></el-icon>
           {{$t('common.viewDetails')}}
         </el-button>

+ 8 - 1
src/locales/en.js

@@ -299,6 +299,7 @@ export default {
     tianjiabumen:'Add Department',
     bianjibumen:'Edit Department',
     qsrbmmc:'Please Enter The Department Name',
+    qxebm:'Please Select The Department',
     mbsl:'Allocate MiBi Quantity',
     fenpeimibi:'Assign MiBi',
     qsryfpdmbsl:'Please Enter The Employee\'s MiBi Quantity',
@@ -332,7 +333,7 @@ export default {
     openVip:'Become a member to enjoy exclusive privileges',
     zxqy:'Premium Benefits',
     wx:'Infinite',
-    activate:'Activate',
+    activate:'Activate ',
     gfmc:`Buyer's Name`,
     downloadInvoice:'Download invoice',
     rejectReason:'Reason for rejection',
@@ -375,6 +376,12 @@ export default {
     qsrxm:'Please enter the name',
     txxy:'Withdrawal Agreement',
     qydbtytxxy:'Please read and agree to the withdrawal agreement',
+    hyxy:'Membership Agreement',
+    qydbtyhyxy:'Please read and agree to the membership agreement',
+    bdyxjcjzh:'By binding an email, an account will be automatically created',
+    psrjnbq:'Please enter skill tags',
+    zdtjwg:'You can add up to 5',
+    txsqytj:'The withdrawal application has been submitted, please wait for review',
   },
   orderConfirm:{
     personalPay:'Personal Payment',

+ 7 - 0
src/locales/zh-CN.js

@@ -302,6 +302,7 @@ export default {
     tianjiabumen:'添加部门',
     bianjibumen:'编辑部门',
     qsrbmmc:'请输入部门名称',
+    qxebm:'请选择部门',
     mbsl:'分配米币数量',
     fenpeimibi:'分配米币',
     kfpmb:'可分配米币',
@@ -378,6 +379,12 @@ export default {
     qsrxm:'请输入姓名',
     txxy:'提现协议',
     qydbtytxxy:'请阅读并同意《提现协议》',
+    hyxy:'会员协议',
+    qydbtyhyxy:'请阅读并同意《会员协议》',
+    bdyxjcjzh:'绑定邮箱即自动创建账号',
+    psrjnbq:'请输入技能标签',
+    zdtjwg:'最多添加5个',
+    txsqytj:'提现申请已提交,请等待审核',
   },
   orderConfirm:{
     personalPay:'个人支付',

+ 143 - 30
src/pages/Member.vue

@@ -6,8 +6,8 @@
         <li v-for="(item, index) in 4" :key="index">小标题优惠文案</li>
       </ul> -->
     </div>
-    <ul class="member-list">
-      <li v-for="(item, index) in list" :key="index">
+    <div class="member-list">
+      <div v-for="(item, index) in list" :key="index" class="li">
         <div class="name">{{ item.typeName }}</div>
         <div class="desc">{{ item.description }}</div>
         <div class="flex-align-center price">
@@ -18,31 +18,55 @@
           </div>
           <!-- <div class="price-right">¥79.00/月</div> -->
         </div>
-        <div class="btn" :class="{btns:item.memberType == 2}" @click="confirmBuy({
-          callback: getList,
-          appStore,
-          router,
-          type: 'baoMiBalance',
-          price: item.price,
-          t,
-          productId: item.typeId,
-          orderType: 'member_recharge',
-          payMethod: 'BMI'
-        })">{{ $t('personalCenter.activate') }}{{ item.typeName }}</div>
+        <div class="btn" :class="{ btns: item.memberType == 2 }" @click="pay(item)">{{ $t('personalCenter.activate')
+        }}{{
+            item.typeName }}</div>
         <div class="line">
           <div class=""></div>
           <div class="">{{ $t('personalCenter.zxqy') }}</div>
           <div class=""></div>
         </div>
-        <div class="ul">
-          <div v-for="(em, ind) in privilegeRes[item.memberType]" :key="ind" class="li flex-center-between">
+        <div class="uls">
+          <div v-for="(em, ind) in privilegeRes[item.memberType]" :key="ind" class="lis flex-center-between">
             <div class="">{{ em.privilegeName }}</div>
             <div class="">{{ em.privilegeValue == -1 ? $t('personalCenter.wx') : `${em.privilegeValue}${em.unit ?
               em.unit : ''}` }}</div>
           </div>
         </div>
-      </li>
-    </ul>
+      </div>
+    </div>
+
+    <el-dialog v-model="dialogVisible" title="Tips" width="600" align-center>
+      <span>{{ $t('common.payNow') }} {{ itemData.price }} {{ $t('common.baomibi') }}?</span>
+      <template #footer>
+        <div class="flex-center-between">
+          <div class="">
+            <el-checkbox v-model="checked" label="Option 1" size="large">
+              <template #default>
+                <div class="">{{ $t('personalCenter.qydbty') }} <span @click="changeShow"
+                    style="color: #2D71FF;font-weight: bold;">《{{ $t('personalCenter.hyxy') }}》</span> </div>
+              </template>
+            </el-checkbox>
+          </div>
+          <div class="dialog-footer">
+            <el-button @click.stop.prevent="dialogVisible = false">{{ $t('common.cancel') }}</el-button>
+            <el-button class="gradient" type="primary" @click.stop.prevent="closeDialog">
+              {{
+                $t('common.confirm') }}
+            </el-button>
+          </div>
+        </div>
+      </template>
+    </el-dialog>
+    <el-dialog v-model="showWithdraw" :title="$t('personalCenter.hyxy')" width="50%" align-center>
+      <div class="" style="height: 500px;overflow-y: scroll;" v-html="agreementContent"></div>
+      <template #footer>
+        <div class="dialog-footer flex-center">
+          <el-button class="gradient" type="primary" @click="confirmAgreement">{{
+            $t('common.confirm') }}</el-button>
+        </div>
+      </template>
+    </el-dialog>
   </div>
 </template>
 <script setup lang="ts">
@@ -62,6 +86,15 @@ import { confirmBuy } from '@/utils/util.js'
 
 import { useI18n } from 'vue-i18n'
 
+import { getAgreementType } from '@/api/common.js'
+
+import { createOrder } from '@/api/order.js'
+
+import DGTMessage from '@/utils/message'
+
+
+import { ElMessage, ElMessageBox } from 'element-plus'
+
 const { t } = useI18n()
 
 const appStore = useAppStore()
@@ -71,6 +104,88 @@ const router = useRouter()
 const list = ref([]);
 const privilegeRes = ref({ 1: [], 2: [] })
 
+const dialogVisible = ref(false);
+const itemData = ref({});
+const checked = ref(false);
+const showWithdraw = ref(false);
+const agreementContent = ref('');
+
+const confirmAgreement = async () => {
+  checked.value = true;
+  showWithdraw.value = false;
+}
+
+const changeShow = async () => {
+  let res = await getAgreementType({
+    agreementType: 'membership_agreement'
+  });
+  if (res.code === 200) {
+    agreementContent.value = res.data.content || '';
+    showWithdraw.value = true;
+  }
+}
+
+const closeDialog = async () => {
+
+  if (!checked.value) {
+    return DGTMessage.warning(t('personalCenter.qydbtyhyxy'));
+  }
+  dialogVisible.value = false;
+  if (appStore.userInfo.baoMiBalance < itemData.value.price) {
+    ElMessageBox.confirm(t('common.balanceNotEnough'), t('common.tip'), {
+      confirmButtonText: t('common.confirm'),
+      cancelButtonText: t('common.cancel'),
+      type: 'warning'
+    }).then(() => {
+      // 确认购买
+      router.push({
+        path: `/order-confirm`,
+      })
+    }).catch(() => {
+      // 取消购买
+    });
+    return
+  }
+  const res = await createOrder({
+    payMethod:'BMI',
+    orderType:'member_recharge',
+    orderAmt: itemData.value.price,
+    productId: itemData.value.typeId,
+    orderNum: 1
+  })
+  if (res.code === 200) {
+    DGTMessage.success(t('common.paySuccess'))
+    appStore.USERINFO();
+    router.push({ path: '/personal-center/wallet' });
+  }
+}
+
+const pay = async (item) => {
+  console.log('item', item)
+  itemData.value = item;
+  dialogVisible.value = true;
+  // let res = await confirmBuy({
+  //   memberType: item.memberType,
+  //   price: item.price
+  // });
+  // if (res) {
+  //   appStore.getUserInfo();
+  //   router.push({ path: '/personal-center' });
+  // }
+
+  // confirmBuy({
+  //         callback: getList,
+  //         appStore,
+  //         router,
+  //         type: 'baoMiBalance',
+  //         price: item.price,
+  //         t,
+  //         productId: item.typeId,
+  //         orderType: 'member_recharge',
+  //         payMethod: 'BMI'
+  //       })
+}
+
 const getprivilegeRes = async (memberType) => {
   let privilegeRes = await privilege(memberType);
   return privilegeRes.data;
@@ -97,12 +212,6 @@ onMounted(() => {
 
 </script>
 <style lang="scss">
-ul,
-li {
-  margin: 0;
-  padding: 0;
-}
-
 .member {
   max-width: 1246px;
   margin: 0 auto;
@@ -128,7 +237,7 @@ li {
 
     margin-top: 24px;
 
-    li {
+    .li {
       font-size: 18px;
       margin-right: 66px;
 
@@ -144,7 +253,7 @@ li {
   gap: 48px;
   flex-wrap: wrap;
 
-  li {
+  .li {
     width: 383px;
     padding: 24px 32px;
     background: #FFFFFF;
@@ -195,6 +304,7 @@ li {
       background: linear-gradient(270deg, #FBE8CF 0%, #F8C79D 52.05%, #FADCB9 100%);
       border-radius: 10px;
     }
+
     .btns {
       color: #FAD8B4;
       background: #3B3843;
@@ -204,6 +314,7 @@ li {
       // width: 164px;
       display: flex;
       align-items: center;
+
       // background: url('/src/assets/imgs/line@2x.png') no-repeat;
       // background-size: 164px 3px;
       // background-position: center center;
@@ -220,24 +331,26 @@ li {
         &:last-child {
           width: 46px;
           height: 3px;
-         
-         
+
+
         }
+
         &:first-child {
-           background: linear-gradient(270deg, #8B3D22 0%, rgba(139, 61, 34, 0) 100%);
+          background: linear-gradient(270deg, #8B3D22 0%, rgba(139, 61, 34, 0) 100%);
         }
+
         &:last-child {
           background: linear-gradient(90deg, #8B3D22 0%, rgba(139, 61, 34, 0) 100%);
         }
       }
     }
 
-    .ul {
+    .uls {
       width: 100%;
       color: #8B3D22;
       font-size: 14px;
 
-      .li {
+      .lis {
         margin-top: 16px;
       }
     }

+ 2 - 2
src/pages/Personal/BusinessManagement.vue

@@ -77,7 +77,7 @@
             <el-col :span="24">
               <el-form-item :label="$t('personalCenter.bumen')" prop="deptId">
                 <el-tree-select v-model="formInline.deptId" :data="dataSource" :props="defaultProps"
-                  :placeholder="$t('common.qingxuanze')" />
+                  :placeholder="$t('personalCenter.qxebm')" />
               </el-form-item>
             </el-col>
           </el-row>
@@ -150,7 +150,7 @@
         <el-row :gutter="0" v-else>
           <el-col :span="24">
             <el-form-item :label="$t('personalCenter.bumen')" prop="deptName">
-              <el-input v-model="formInline.deptName" :placeholder="$t('common.placeholderInput')" />
+              <el-input v-model="formInline.deptName" :placeholder="$t('personalCenter.qsrbmmc')" />
             </el-form-item>
           </el-col>
         </el-row>

+ 7 - 10
src/pages/Personal/Collection.vue

@@ -4,8 +4,8 @@
       <div class="line_vertical"></div>
       <div class="">{{ $t('personalCenter.myCollection') }}</div>
     </div>
-    <ul class="collection-list">
-      <li @click="toDetail(item)" class="flex-center-between" v-for="(item, index) in list" :key="index">
+    <div class="collection-list">
+      <div @click.prevent="toDetail(item)" class="flex-center-between li" v-for="(item, index) in list" :key="index">
         <img class="image" :src="item.coverImageUrl" alt="">
         <div class="collection-list-main">
           <div class="collection-list-main-left">
@@ -15,13 +15,13 @@
             </div>
             <div class="">{{ item.courseIntro }}</div>
           </div>
-          <div @click.stop="cancelCollect(item, index)" class="btn flex-center active">
+          <div @click.stop.prevent="cancelCollect(item, index)" class="btn flex-center active">
             <img src="/src/assets/imgs/my/star@2x.png" alt="">
             <div class="">{{ $t('common.cancelCollect') }}</div>
           </div>
         </div>
-      </li>
-    </ul>
+      </div>
+    </div>
     <template v-if="list.length">
       <Pagination :total="form.total" :page-size="form.pageSize" :current-page="form.pageNum"
         @page-change="handlePageChange" />
@@ -89,10 +89,7 @@ onMounted(() => {
 })
 </script>
 <style scoped lang="scss">
-  ul,li {
-    margin: 0;
-    padding: 0;
-  }
+
 .collection {
   padding-bottom: 20px;
 
@@ -104,7 +101,7 @@ onMounted(() => {
   }
 
   .collection-list {
-    li {
+    .li {
       padding: 16px;
       margin-bottom: 16px;
       background: #F5F7FA;

+ 45 - 6
src/pages/Personal/Wallet.vue

@@ -92,7 +92,7 @@
                 <el-input-number v-model="walletForm.orderAmt" :min="1" :max="appStore?.userInfo?.baoMiBalance"
                   controls-position="right" size="large" @change="handleChange" style="width: 100%;"
                   :placeholder="$t('common.placeholderInput')" align="left" :input-style="{ fontSize: '28px' }"
-                  class="inputStyle" />
+                  class="inputStyle" step-strictly />
               </el-form-item>
 
               <el-form-item :label="$t('common.use') + $t('common.mibi')" v-else prop="orderAmt">
@@ -100,7 +100,7 @@
                   :max="appStore?.userInfo?.pointsBalance" :step="Number(configTxt.configValue)"
                   controls-position="right" size="large" @change="handleChange" style="width: 100%;"
                   :placeholder="$t('common.placeholderInput')" align="left" :input-style="{ fontSize: '28px' }"
-                  class="inputStyle" />
+                  class="inputStyle" step-strictly />
               </el-form-item>
             </div>
           </el-col>
@@ -129,7 +129,7 @@
         <el-form-item prop="checked">
           <el-checkbox v-model="walletForm.checked">
             <template #default>
-              <div class="">{{ $t('personalCenter.qydbty') }} <span style="color: #2D71FF;font-weight: bold;">《{{  $t('personalCenter.zhxy') }}》</span> </div>
+              <div class="">{{ $t('personalCenter.qydbty') }} <span @click.stop.prevent="changeShow('currency_conversion_protoco')" style="color: #2D71FF;font-weight: bold;">《{{  $t('personalCenter.zhxy') }}》</span> </div>
             </template>
           </el-checkbox>
         </el-form-item>
@@ -181,7 +181,7 @@
         <el-form-item prop="checked1">
           <el-checkbox v-model="ruleForm.checked1">
             <template #default>
-              <div class="">{{ $t('personalCenter.qydbty') }} <span style="color: #2D71FF;font-weight: bold;">《{{  $t('personalCenter.txxy') }}》</span> </div>
+              <div class="">{{ $t('personalCenter.qydbty') }} <span @click.stop.prevent="changeShow('withdrawal_agreement')" style="color: #2D71FF;font-weight: bold;">《{{  $t('personalCenter.txxy') }}》</span> </div>
             </template>
           </el-checkbox>
         </el-form-item>
@@ -194,6 +194,18 @@
         </div>
       </template>
     </el-dialog>
+
+    <el-dialog v-model="showWithdraw" :title="agreementTitle" width="50%">
+      <div class="" style="height: 500px;overflow-y: scroll;" v-html="agreementContent"></div>
+      <template #footer> 
+        <div class="dialog-footer flex-center">
+           <el-button class="gradient" type="primary" @click="confirmAgreement">{{
+            $t('common.confirm') }}</el-button>
+        </div>
+      </template>
+    </el-dialog>
+
+
   </div>
 </template>
 <script lang="ts" setup>
@@ -209,6 +221,8 @@ import { payConfigDearch, calRate } from '@/api/order'
 
 import { recordList, applyWithdraw, withdrawList } from '@/api/my'
 
+import { getAgreementType } from '@/api/common.js'
+
 import { createOrder } from '@/api/order.js'
 
 import { useAppStore } from '@/pinia/appStore'
@@ -271,6 +285,31 @@ const ruleForm = ref({
 
 const ruleFormRefs = ref()
 
+const showWithdraw = ref(false);
+const agreementContent = ref('');
+const agreementTitle = ref('');
+
+const confirmAgreement = () => {
+  if (['转换协议','Conversion Agreement'].includes(agreementTitle.value)) {
+    console.log('111')
+   walletForm.value.checked = true;
+  } else {
+    ruleForm.value.checked1 = true;
+  }
+  showWithdraw.value = false;
+  
+}
+// 获取协议
+const changeShow = async (type) => {
+
+  agreementTitle.value = t(type == 'withdrawal_agreement' ? 'personalCenter.txxy' : 'personalCenter.zhxy');
+  let res = await getAgreementType({ agreementType: type });
+  if (res.code === 200) {
+    showWithdraw.value = true;
+    agreementContent.value = res.data.content || '';
+  }
+}
+
 const validatePass = (rule: any, value: any, callback: any) => {
   if (!value) {
     callback(new Error(t('common.placeholderInput')))
@@ -336,7 +375,6 @@ const rules = ref({
 })
 
 const submitForm = async (formEl) => {
-  console.log(formEl)
   if (!formEl) return
   await formEl.validate(async (valid, fields) => {
     if (valid) {
@@ -345,7 +383,8 @@ const submitForm = async (formEl) => {
         show.value = false;
         appStore.USERINFO();
         getList()
-        DGTMessage.success(t('common.success'));
+        ruleForm.value.applyAmount = null;
+        DGTMessage.success(t('personalCenter.txsqytj'));
       }
     }
   })

+ 25 - 29
src/pages/PersonalCenter.vue

@@ -216,6 +216,15 @@
     <el-dialog v-model="dialogVisible" :title="$t('personalCenter.editProfile')" width="784" :destroy-on-close="true">
       <el-form ref="userFormRef" :model="userInfo" label-width="auto" label-position="top" :rules="rules">
         <el-row :gutter="16">
+          
+           <el-col :span="12">
+            <el-form-item :label="$t('personalCenter.nickName')" prop="nickName">
+              <el-input v-model="userInfo.nickName" :placeholder="$t('personalCenter.pinickName')" class="inputStyle"
+                :input-style="{
+                  backgroundColor: 'transparent',
+                }" maxlength="15" />
+            </el-form-item>
+          </el-col>
           <el-col :span="12">
             <el-form-item :label="$t('personalCenter.uploadAvatar')">
               <!-- 图片类型 -->
@@ -224,17 +233,6 @@
             </el-form-item>
           </el-col>
         </el-row>
-        <el-row :gutter="16">
-          <el-col :span="12">
-            <el-form-item :label="$t('personalCenter.nickName')" prop="nickName">
-              <el-input v-model="userInfo.nickName" :placeholder="$t('personalCenter.pinickName')" class="inputStyle"
-                :input-style="{
-                  backgroundColor: 'transparent',
-                }" />
-            </el-form-item>
-          </el-col>
-
-        </el-row>
         <el-row :gutter="16">
           <el-col :span="12">
             <el-form-item :label="$t('personalCenter.loginPhone')">
@@ -289,7 +287,7 @@
         <el-row :gutter="16">
           <el-col :span="12">
             <el-form-item :label="$t('personalCenter.n8nAccout')">
-              <el-input readonly v-model="userInfo.n8nAccount" :placeholder="$t('personalCenter.createN8n')"
+              <el-input disabled v-model="userInfo.n8nAccount" :placeholder="$t(!appStore?.userInfo?.email ? 'personalCenter.bdyxjcjzh' : 'personalCenter.createN8n')"
                 class="inputStyle" :input-style="{
                   backgroundColor: 'transparent',
                 }">
@@ -314,7 +312,7 @@
         <el-row :gutter="16">
           <el-col :span="12">
             <el-form-item :label="$t('personalCenter.cozeAccout')">
-              <el-input readonly v-model="userInfo.cozeAccount" :placeholder="$t('personalCenter.createCoze')"
+              <el-input disabled v-model="userInfo.cozeAccount" :placeholder="$t(!appStore?.userInfo?.email ? 'personalCenter.bdyxjcjzh' :'personalCenter.createCoze')"
                 class="inputStyle" :input-style="{
                   backgroundColor: 'transparent',
                 }">
@@ -340,7 +338,7 @@
         <el-row :gutter="16">
           <el-col :span="12">
             <el-form-item :label="$t('personalCenter.difyAccout')">
-              <el-input readonly v-model="userInfo.difyAccount" :placeholder="$t('personalCenter.createDify')"
+              <el-input disabled v-model="userInfo.difyAccount" :placeholder="$t(!appStore?.userInfo?.email ? 'personalCenter.bdyxjcjzh' :'personalCenter.createDify')"
                 class="inputStyle" :input-style="{
                   backgroundColor: 'transparent',
                 }">
@@ -366,7 +364,7 @@
 
           <el-col :span="12">
             <el-form-item :label="$t('personalCenter.fastGptAccout')">
-              <el-input readonly v-model="userInfo.fastGptAccount" :placeholder="$t('personalCenter.createFastGpt')"
+              <el-input disabled v-model="userInfo.fastGptAccount" :placeholder="$t(!appStore?.userInfo?.email ? 'personalCenter.bdyxjcjzh' :'personalCenter.createFastGpt')"
                 class="inputStyle" :input-style="{
                   backgroundColor: 'transparent',
                 }">
@@ -392,19 +390,23 @@
 
         <el-row>
           <el-col :span="24">
-            <el-form-item :label="$t('personalCenter.skillTag')">
+            <el-form-item :label="`${$t('personalCenter.skillTag')}(${ $t('personalCenter.zdtjwg') })`">
               <div class="flex tags flex_1">
                 <el-tag v-for="tag in dynamicTags" :key="tag" closable @close="handleClose(tag)">
                   {{ tag }}
                 </el-tag>
-                <el-input v-if="inputVisible" ref="InputRef" v-model="inputValue" class="w-20" size="small"
-                  @keyup.enter="handleInputConfirm" @blur="handleInputConfirm" maxlength="5">
+                <template v-if="dynamicTags.length < 5">
+                  <el-input v-if="inputVisible" ref="InputRef" v-model="inputValue" class="w-20" size="small"
+                  @keyup.enter="handleInputConfirm" @blur="handleInputConfirm" maxlength="5" :placeholder="
+                    $t('personalCenter.psrjnbq')
+                  ">
                   <template #append>
                     <el-button :icon="Plus" />
                   </template></el-input>
                 <el-button v-else class="button-new-tag" size="small" @click="showInput">
                   + {{ $t('common.addTags') }}
                 </el-button>
+                </template>
               </div>
             </el-form-item>
           </el-col>
@@ -435,7 +437,7 @@ import type { InputInstance } from 'element-plus'
 
 import { useRoute, useRouter } from 'vue-router'
 
-import { getUserInfo, updateUserInfo, getSmsCode, getEmailCode } from '@/api/auth.js'
+import { getUserInfo, updateUserInfo, getSmsCode, getEmailCode,sendBindCode } from '@/api/auth.js'
 
 import { checkIn, queryCollectCount, issue, issueList, faqList, getfaq, createAiAccount } from '@/api/my.js'
 
@@ -698,16 +700,10 @@ const sendSmsCode = async () => {
     return
   }
 
-  let res = null;
-  if (PHONE_REGEX.test(account) && appStore?.userInfo?.email) {
-    res = await getSmsCode({
-      phone: account
-    })
-  } else if (EMAIL_REGEX.test(account) && appStore?.userInfo?.userPhone) {
-    res = await getEmailCode({
-      email: account
-    })
-  }
+  let res = await sendBindCode({
+    account: account,
+    type: appStore?.userInfo?.userPhone ? 'email' : 'phone'
+  });
 
   if (res.code !== 200) {
     return