Bladeren bron

Merge branch 'feature/ci-cd' of duanxiaoduan/tmr-admin into develop

duanxiaoduan 1 jaar geleden
bovenliggende
commit
e7f49cdaf2
4 gewijzigde bestanden met toevoegingen van 31 en 5 verwijderingen
  1. 19 0
      .env.production
  2. 1 0
      package.json
  3. 2 1
      src/store/modules/user.js
  4. 9 4
      src/views/login/index.vue

+ 19 - 0
.env.production

@@ -1,3 +1,21 @@
+<<<<<<< HEAD
+# just a flag
+ENV = 'production'
+
+# base api
+# 正式线
+# VUE_APP_BASE_API = ':8081/'
+# VUE_APP_BASE_API = '/'
+# 测试线
+VUE_APP_BASE_API = 'http://192.168.1.70:8082/'
+# 洋洋本地
+# VUE_APP_BASE_API = 'http://192.168.1.104:8081/'
+#本地
+# VUE_APP_BASE_API = 'http://192.168.1.55:8084/'
+
+
+ 
+=======
 # just a flag
 ENV = 'production'
 
@@ -11,3 +29,4 @@ VUE_APP_BASE_API = 'http://192.168.1.70:8082/'
 # VUE_APP_BASE_API = 'http://192.168.1.104:8081/'
 #本地
 # VUE_APP_BASE_API = 'http://192.168.1.55:8084/'
+>>>>>>> e0c966d4319a0702b9a4f89165500df9397f5526

+ 1 - 0
package.json

@@ -26,6 +26,7 @@
     "fuse.js": "3.4.4",
     "js-cookie": "^2.2.0",
     "js-table2excel": "^1.0.3",
+    "md5": "^2.3.0",
     "moment": "^2.24.0",
     "normalize.css": "7.0.0",
     "nprogress": "0.2.0",

+ 2 - 1
src/store/modules/user.js

@@ -96,7 +96,8 @@ const actions = {
   login({ commit }, userInfo) {
     const { username, password } = userInfo
     return new Promise((resolve, reject) => {
-      login({ username: username.trim(), password: password }).then(response => {
+      login({ user_name: username.trim(), password: password }).then(response => {
+      // login({ username: username.trim(), password: password }).then(response => {
         const { data, msg } = response
         if (msg !== 'ok') {
           Message({

+ 9 - 4
src/views/login/index.vue

@@ -48,7 +48,8 @@
 <script>
 import { validUsername } from '@/utils/validate'
 import Cookies from 'js-cookie'
-import { getToken } from '@/utils/auth'
+import { getToken } from '@/utils/auth'
+const md5 = require("md5")
 export default {
   name: 'Login',
   data() {
@@ -119,13 +120,17 @@ export default {
       })
     },
     handleLogin() {
+      var obj = {
+        username: this.loginForm.username,
+        password: md5(this.loginForm.password)
+      }
       var rememberStatus = this.rememberPassword
       var accountInfo = this.loginForm.username + '&' + this.loginForm.password
       this.$refs.loginForm.validate(valid => {
         if (valid) {
-          this.loading = true
-          this.$store
-            .dispatch('user/login', this.loginForm).then(() => {
+          this.loading = true
+          this.$store.dispatch('user/login', obj).then(() => {
+          // this.$store.dispatch('user/login', this.loginForm).then(() => {
               if (rememberStatus) {
                 console.log('勾选了记住密码,现在开始写入cookie')
                 Cookies.set('accountInfo', accountInfo, 1440 * 3)