Administrator
2022-01-05 dcae66557a69a9158132959c2c2f56ab4692d99e
登录逻辑修改
3 files modified
9 ■■■■■ changed files
src/api/user.js 5 ●●●●● patch | view | raw | blame | history
src/page/login/userlogin.vue 2 ●●●●● patch | view | raw | blame | history
src/store/modules/user.js 2 ●●● patch | view | raw | blame | history
src/api/user.js
@@ -1,7 +1,7 @@
import request from '@/router/axios';
import website from "@/config/website";
export const loginByUsername = (tenantId, username, password, type, key, code) => request({
export const loginByUsername = (tenantId, username, password, type, key, code, loginType) => request({
  url: '/api/blade-auth/oauth/token',
  method: 'post',
  headers: {
@@ -15,7 +15,8 @@
    password,
    grant_type: (website.captchaMode ? "captcha" : "password"),
    scope: "all",
    type
        type,
        loginType
  }
});
src/page/login/userlogin.vue
@@ -111,6 +111,7 @@
        //预加载白色背景
        image:
          "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",
        loginType: 1,
      },
      loginRules: {
        tenantId: [
@@ -161,6 +162,7 @@
            text: "登录中,请稍后。。。",
            spinner: "el-icon-loading",
          });
          console.log(this.loginForm,123456);
          this.$store
            .dispatch("LoginByUsername", this.loginForm)
            .then(() => {
src/store/modules/user.js
@@ -48,7 +48,7 @@
    //根据用户名登录
    LoginByUsername({commit}, userInfo) {
      return new Promise((resolve, reject) => {
        loginByUsername(userInfo.tenantId, userInfo.username, md5(userInfo.password), userInfo.type, userInfo.key, userInfo.code).then(res => {
                loginByUsername(userInfo.tenantId, userInfo.username, md5(userInfo.password), userInfo.type, userInfo.key, userInfo.code, userInfo.loginType).then(res => {
          const data = res.data;
          if (data.error_description) {
            Message({