1
huanghongfeng
2025-03-07 f1f29f5329102870476653fa6c6ca42b80226078
ÏîÄ¿´úÂë/WCS/WIDESEAWCS_Client/src/views/Login.vue
@@ -19,14 +19,14 @@
          <div class="input-icon el-icon-lock"></div>
          <input type="password" v-focus v-model="userInfo.password" placeholder="请输入密码" />
        </div>
        <div class="item">
        <!-- <div class="item">
          <div class="input-icon el-icon-mobile"></div>
          <input v-focus type="text" v-model="userInfo.verificationCode" placeholder="输入验证码" />
          <div class="code" @click="getVierificationCode">
            <img v-show="codeImgSrc != ''" :src="codeImgSrc" />
          </div>
        </div>
        </div> -->
      </div>
      <div class="loging-btn">
        <el-button size="large" :loading="loading" color="#3a6cd1" :dark="true" @click="login" long>
@@ -101,13 +101,13 @@
      UUID: undefined
    });
    const getVierificationCode = () => {
      http.get('/api/User/getVierificationCode').then((x) => {
        codeImgSrc.value = 'data:image/png;base64,' + x.img;
        userInfo.UUID = x.uuid;
      });
    };
    getVierificationCode();
    // const getVierificationCode = () => {
    //   http.get('/api/User/getVierificationCode').then((x) => {
    //     codeImgSrc.value = 'data:image/png;base64,' + x.img;
    //     userInfo.UUID = x.uuid;
    //   });
    // };
    //getVierificationCode();
    let appContext = getCurrentInstance().appContext;
    let $message = appContext.config.globalProperties.$message;
@@ -116,14 +116,14 @@
    const login = () => {
      if (!userInfo.userName) return $message.error('请输入用户名');
      if (!userInfo.password) return $message.error('请输入密码');
      if (!userInfo.verificationCode) {
        return $message.error('请输入验证码');
      }
      // if (!userInfo.verificationCode) {
      //   return $message.error('请输入验证码');
      // }
      loading.value = true;
      http.post('/api/User/login', userInfo, '正在登录....').then((result) => {
        if (!result.status) {
          loading.value = false;
          getVierificationCode();
          //getVierificationCode();
          return $message.error(result.message);
        }
        $message.success('登录成功,正在跳转!');
@@ -142,7 +142,7 @@
    return {
      loading,
      codeImgSrc,
      getVierificationCode,
      //getVierificationCode,
      login,
      userInfo,
      loginPress,