Browse Source

代码提交

zhang song 6 years ago
parent
commit
ce89960c20
5 changed files with 52 additions and 46 deletions
  1. 2 2
      config/index.js
  2. 1 1
      dist/index.html
  3. 2 2
      package.json
  4. 45 39
      src/components/login.vue
  5. 2 2
      src/utils/server.js

+ 2 - 2
config/index.js

@@ -9,7 +9,7 @@ env: require('./dev.env'),
         dev: {
             // Paths
             assetsSubDirectory: 'static',
-            assetsPublicPath: './',
+            assetsPublicPath: '/',
             proxyTable: {
                 //   '/api': {
                 //     target: 'http://39.108.234.18:8888',
@@ -22,7 +22,7 @@ env: require('./dev.env'),
 
             // Various Dev Server settings
             host: 'localhost', // can be overwritten by process.env.HOST
-            port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
+            port: 8091, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
             autoOpenBrowser: true,
             errorOverlay: true,
             notifyOnErrors: true,

+ 1 - 1
dist/index.html

@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>经销商管理系统</title><link rel="shortcut icon" href=https://dealer.jetour.com.cn/favicon.ico><link href=./static/css/app.bd193ffbb5a689e0fb0fbf7575ebb008.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.994077f78b49ba26f742.js></script><script type=text/javascript src=./static/js/app.a51539c76a1c4983afc2.js></script></body><script src="http://pv.sohu.com/cityjson?ie=utf-8"></script><script type=text/javascript>sessionStorage.setItem('ip', returnCitySN["cip"]);</script><script>var _hmt = _hmt || [];
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>经销商管理系统</title><link rel="shortcut icon" href=https://dealer.jetour.com.cn/favicon.ico><link href=./static/css/app.f4c19dac3f0011afe7c14f876ac800ea.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.e6b663e54a83ee863b4a.js></script><script type=text/javascript src=./static/js/app.10ac916f1fe1a96799f8.js></script></body><script src="http://pv.sohu.com/cityjson?ie=utf-8"></script><script type=text/javascript>sessionStorage.setItem('ip', returnCitySN["cip"]);</script><script>var _hmt = _hmt || [];
     (function() {
       var hm = document.createElement("script");
       hm.src = "https://hm.baidu.com/hm.js?95c45f55b7586b2c20d8c8b813693103";

+ 2 - 2
package.json

@@ -22,7 +22,7 @@
   },
   "devDependencies": {
     "autoprefixer": "^7.1.2",
-    "axios": "^0.18.0",
+    "axios": "^0.18.1",
     "babel-core": "^6.22.1",
     "babel-helper-vue-jsx-merge-props": "^2.0.3",
     "babel-loader": "^7.1.1",
@@ -54,7 +54,7 @@
     "vue-template-compiler": "^2.5.2",
     "webpack": "^3.6.0",
     "webpack-bundle-analyzer": "^2.9.0",
-    "webpack-dev-server": "^2.9.1",
+    "webpack-dev-server": "^2.11.5",
     "webpack-merge": "^4.1.0"
   },
   "engines": {

+ 45 - 39
src/components/login.vue

@@ -54,12 +54,12 @@
                 loading: false,
             };
         },
-        created() {
+        mounted() {
             var token = window.location.search.substr(1).split('=')[1];
             if (token) {
                 this.loading = true;
-                console.log(token)
-                this.casualBacking = token
+
+                this.casualBacking = token,
                 this.secretLogin()
             } else {
                 this.loading = false;
@@ -81,44 +81,50 @@
                 return null;
             },
             secretLogin() {
-                let data = {
-                    casualBacking: this.casualBacking,
-                    ip:sessionStorage.getItem("ip")
-                };
-                this.$post("/secretLogin", data)
-                    .then(
-                        response => {
-                            if (response.status == 200) {
-                                if (response.data.success == true) {
-                                    window.localStorage.removeItem("menuName");
-                                    window.localStorage.removeItem("menuIndex");
-                                    window.localStorage.setItem(
-                                        "userId",
-                                        response.data.data.dealerID
-                                    );
-                                    window.localStorage.setItem(
-                                        "zptoken",
-                                        response.data.data.name
-                                    );
-                                    window.localStorage.setItem(
-                                        "personInfo",
-                                        JSON.stringify(response.data.data)
-                                    );
-                                    this.$router.replace({path: "/home/order"})
+                    var that = this;
+                    setTimeout(function() {
+                        let data = {
+                            casualBacking: that.casualBacking + "@@"+sessionStorage.getItem("ip"),
+                            ips:sessionStorage.getItem("ip")
+                        };
+                        that.$post("/secretLogin", data)
+                            .then(
+                                response => {
+                                    if (response.status == 200) {
+                                        if (response.data.success == true) {
+                                            window.localStorage.removeItem("menuName");
+                                            window.localStorage.removeItem("menuIndex");
+                                            window.localStorage.setItem(
+                                                "userId",
+                                                response.data.data.dealerID
+                                            );
+                                            window.localStorage.setItem(
+                                                "zptoken",
+                                                response.data.data.name
+                                            );
+                                            window.localStorage.setItem(
+                                                "personInfo",
+                                                JSON.stringify(response.data.data)
+                                            );
+                                            that.$router.replace({path: "/home/order"})
+
+                                            // });
+                                        } else {
+                                            that.loginShow = true;
+                                            that.loading = false;
+                                            that.$message.error("跳转失败,请手动登录");
+                                        }
+                                    } else {
+                                        that.loginShow = true;
+                                        that.loading = false;
+                                        that.$message.error("跳转失败,请手动登录");
+                                    }
 
-                                    // });
-                                } else {
-                                    this.loginShow = true;
-                                    this.loading = false;
-                                    this.$message.error("跳转失败,请手动登录");
                                 }
-                            } else {
-                                this.loginShow = true;
-                                this.loading = false;
-                                this.$message.error("跳转失败,请手动登录");
-                            }
-                        }
-                    );
+                            );
+                    }, (1000));
+
+
             },
             login() {
                 this.$post("/login", this.formInline)

+ 2 - 2
src/utils/server.js

@@ -1,6 +1,6 @@
 module.exports = {
-    api: 'http://dealerbackapi.jetour.com.cn',
-    // api: 'http://127.0.0.1:8888',
+    // api: 'http://dealerbackapi.jetour.com.cn',
+    api: 'http://127.0.0.1:8888',
 
     imgUrl: 'http://dealerbackapi.jetour.com.cn/youpai/uploadFile'
 }