瀏覽代碼

添加用户时跳转

lj 4 年之前
父節點
當前提交
85cc4b199b
共有 4 個文件被更改,包括 19 次插入13 次删除
  1. 2 2
      config/index.js
  2. 二進制
      ksh_dist_1.zip
  3. 12 6
      src/components/UserManger.vue
  4. 5 5
      src/main.js

+ 2 - 2
config/index.js

@@ -12,7 +12,7 @@ module.exports = {
     proxyTable: {
       '/api': {
         // target: 'http://192.168.1.8:8000/',
-        target: 'http://192.168.1.4:8000/',
+        target: 'http://192.168.1.107:8001/',
         changeOrigin: true,
         pathRewrite: {
           '^/api': '' //重写接口
@@ -20,7 +20,7 @@ module.exports = {
       },
     },
     // Various Dev Server settings
-    host: '192.168.1.7', // can be overwritten by process.env.HOST
+    host: '192.168.1.112', // can be overwritten by process.env.HOST
     port: 8000, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,

二進制
ksh_dist_1.zip


+ 12 - 6
src/components/UserManger.vue

@@ -15,10 +15,9 @@
       <el-button
         v-if="have_type == 0 || staff == 1 || have_type == 2"
         type="success"
+        @click="addUserFun"
         size="mini"
-        ><a style="color: #fff" href="systemmanage_user_add"
-          >添加新用户</a
-        ></el-button
+        >添加新用户</el-button
       >
     </div>
     <el-row :gutter="10">
@@ -82,7 +81,12 @@
             <el-button size="small" type="success" @click="edit(item)" plain
               >用户编辑</el-button
             >
-            <template v-if="(have_type == 0 || staff == 1 || have_type == 2) && (currusername != item.username)">
+            <template
+              v-if="
+                (have_type == 0 || staff == 1 || have_type == 2) &&
+                currusername != item.username
+              "
+            >
               <el-button
                 size="small"
                 v-if="item.user_have_type == '1' || item.user_have_type == '2'"
@@ -320,7 +324,7 @@ export default {
       },
       have_type: "",
       staff: "",
-      currusername:''
+      currusername: "",
     };
   },
   computed: {
@@ -334,7 +338,6 @@ export default {
     this.have_type = localStorage.getItem("have_type"); // 0管理员  1用户
     this.staff = localStorage.getItem("staff"); // 1是admin
     this.currusername = localStorage.getItem("username"); // 1是admin
-
   },
   methods: {
     getList() {
@@ -541,6 +544,9 @@ export default {
       this.page = 1;
       this.getList();
     },
+    addUserFun() {
+      window.location.href = "systemmanage_user_add";
+    },
   },
 };
 </script>

+ 5 - 5
src/main.js

@@ -19,11 +19,11 @@ Vue.prototype.qs = qs //全局注册,使用方法为:this.qs
 Vue.use(ElementUI);
 import './assets/css/global.css'
 
-axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
-axios.defaults.timeout = 30000;
-axios.defaults.baseURL = 'http://39.106.113.84:8000/' //线下杨明明
-axios.defaults.withCredentials = true //axios请求时携带session
-axios.defaults.crossDomain = true 
+// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
+// axios.defaults.timeout = 30000;
+// axios.defaults.baseURL = 'http://39.106.113.84:8000/' //线下杨明明
+// axios.defaults.withCredentials = true //axios请求时携带session
+// axios.defaults.crossDomain = true 
 
 Vue.config.productionTip = false