Selaa lähdekoodia

bug,验证码

钞小赢 3 vuotta sitten
vanhempi
commit
d6513b816d

+ 3 - 0
.env

@@ -5,8 +5,11 @@ VUE_APP_TITLE=物联网平台
5 5
 
6 6
 # 网络请求公用地址
7 7
 VUE_APP_API=/api/
8
+
8 9
 # 测试
9 10
 #  VUE_APP_API=http://101.36.160.140:31005/smart-grp-basic
11
+#  VUE_APP_API=http://172.16.0.6:7070/smart-grp-basic
12
+#  VUE_APP_API=window.location.origin
10 13
 
11 14
 # //正式
12 15
 # VUE_APP_API=http://23.99.21.201:59887/smart-grp-basic

+ 8 - 1
src/api/modules/login.api.js

@@ -14,7 +14,14 @@ export default ({
14 14
     })
15 15
   },
16 16
 
17
-
17
+//验证码
18
+seccode(){
19
+  return request({
20
+    url: '/userInfo/identifyImage',
21
+    method: 'get',
22
+ 
23
+  })
24
+}
18 25
 
19 26
 
20 27
 })

BIN
src/assets/images/seccode.png


+ 2 - 1
src/main.js

@@ -27,7 +27,8 @@ import "./views/system/js/index"
27 27
 import "./views/system/js/jquery-1.8.3.min.js"
28 28
 import "./views/system/css/globle.css"
29 29
 
30
-
30
+// const publicUrl=window.location.origin
31
+// console.log(publicUrl,'publicUrl')
31 32
 
32 33
 // 核心插件
33 34
 Vue.use(d2Admin)

+ 2 - 0
src/views/demo/alarmRecord/index.vue

@@ -214,6 +214,8 @@
214 214
                 >
215 215
                     <template slot-scope="scope">
216 216
                       {{scope.row.handleState==0?'待处理':scope.row.handleState==1?'已处理':scope.row.handleState}}
217
+                      <!-- <span v-if="scope.row.handleState==0">待处理</span>
218
+                      <span v-if="scope.row.handleState==1">已处理</span> -->
217 219
                     </template>
218 220
                 </el-table-column>
219 221
                 <el-table-column align="center" label="操作" width="100">

+ 6 - 6
src/views/demo/equipmentManage/equipmentInfo/index.vue

@@ -663,11 +663,11 @@ export default {
663 663
     connect() {
664 664
       let options = {
665 665
         //本地
666
-        username: "admin",
667
-        password: "public",
666
+        // username: "admin",
667
+        // password: "public",
668 668
         //测试
669
-        //    username: "admin",
670
-        // password: "admin@123",
669
+           username: "admin",
670
+        password: "admin@123",
671 671
         //生产
672 672
         // username: "admin",
673 673
         // password: "admin@2Ld&DDrsk",
@@ -677,9 +677,9 @@ export default {
677 677
         connectTimeout: 4000,
678 678
       };
679 679
       //本地开发环境
680
-      this.client = mqtt.connect("ws://192.168.50.169:8083/mqtt", options);
680
+      // this.client = mqtt.connect("ws://192.168.50.169:8083/mqtt", options);
681 681
       //测试环境
682
-      //  this.client = mqtt.connect('ws://172.16.0.5:8083/mqtt',options);
682
+       this.client = mqtt.connect('ws://172.16.0.5:8083/mqtt',options);
683 683
       //正式环境
684 684
       // this.client = mqtt.connect('ws://10.105.101.61:8083/mqtt',options);
685 685
       this.client.on("connect", (e) => {

+ 8 - 3
src/views/demo/productManage/compontents/addDialog.vue

@@ -12,10 +12,10 @@
12 12
         ref="addForm"
13 13
         label-width="120px"
14 14
       >
15
-        <el-form-item label="产品图标:" prop="proIcons">
15
+        <!-- <el-form-item label="产品图标:" prop="proIcons">
16 16
           <el-upload
17 17
             class="avatar-uploader"
18
-            action="smart-grp-basic/minio/testupload"
18
+            :action="imgAction"
19 19
             :show-file-list="false"
20 20
             :on-success="handleAvatarSuccess"
21 21
           >
@@ -26,7 +26,7 @@
26 26
             />
27 27
             <i v-else class="el-icon-plus avatar-uploader-icon"></i>
28 28
           </el-upload>
29
-        </el-form-item>
29
+        </el-form-item> -->
30 30
         <el-form-item label="产品ID:" prop="proCode">
31 31
           <el-input
32 32
             style="width: 220px"
@@ -107,6 +107,8 @@ export default {
107 107
   },
108 108
   data() {
109 109
     return {
110
+      //  imgAction:window.location.origin+'/smart-grp-basic/minio/testupload',
111
+      imgAction:'http://101.36.160.140:31005/smart-grp-basic/minio/testupload',
110 112
       defaultProps: {
111 113
         children: "children",
112 114
         label: "productCategoryName",
@@ -241,6 +243,9 @@ export default {
241 243
       });
242 244
     },
243 245
   },
246
+  mounted(){
247
+    console.log(window.location.host,"kkk")
248
+  }
244 249
 };
245 250
 </script>
246 251
 <style lang="scss" scoped>

+ 6 - 6
src/views/demo/productManage/productInfo/realTime/index.vue

@@ -164,11 +164,11 @@ export default {
164 164
     connect() {
165 165
       let options = {
166 166
         //本地
167
-        username: "admin",
168
-        password: "public",
169
-        //测试
170 167
         // username: "admin",
171
-        // password: "admin@123",
168
+        // password: "public",
169
+        //测试
170
+        username: "admin",
171
+        password: "admin@123",
172 172
         //生产
173 173
         // username: "admin",
174 174
         // password: "admin@2Ld&DDrsk",
@@ -178,9 +178,9 @@ export default {
178 178
         connectTimeout: 4000,
179 179
       };
180 180
       //本地开发环境
181
-      this.client = mqtt.connect("ws://192.168.50.169:8083/mqtt", options);
181
+      // this.client = mqtt.connect("ws://192.168.50.169:8083/mqtt", options);
182 182
       //测试环境
183
-      // this.client = mqtt.connect('ws://172.16.0.5:8083/mqtt',options);
183
+      this.client = mqtt.connect('ws://172.16.0.5:8083/mqtt',options);
184 184
       //正式环境
185 185
       // this.client = mqtt.connect('ws://10.105.101.61:8083/mqtt',options);
186 186
       this.client.on("connect", (e) => {

+ 27 - 6
src/views/system/login/page.vue

@@ -44,6 +44,17 @@
44 44
                     <i slot="prepend" class="fa fa-lock"></i>
45 45
                   </el-input>
46 46
                 </el-form-item>
47
+                <el-form-item prop="seccode">
48
+                  <el-input
49
+              
50
+                    style="width:60%"
51
+                    v-model="formLogin.seccode"
52
+                    placeholder="验证码">
53
+                    <i slot="prepend" class="el-icon-s-ticket"></i>
54
+                  </el-input>
55
+                  <span @click="seccodeImgClick" style="display:inline-block;margin-left:15px;margin-top:12px"><img :src="seccodeImg" alt=""></span>
56
+
57
+                </el-form-item>
47 58
                
48 59
                 <el-button
49 60
                   size="default"
@@ -81,7 +92,8 @@ export default {
81 92
   data () {
82 93
     return {
83 94
   
84
-     
95
+      // seccodeImg:window.location.origin+'/smart-grp-basic/userInfo/identifyImage',
96
+      seccodeImg:'http://101.36.160.140:31005/smart-grp-basic/userInfo/identifyImage',
85 97
     
86 98
       // 快速选择用户
87 99
       dialogVisible: false,
@@ -124,7 +136,8 @@ export default {
124 136
             trigger: 'blur'
125 137
           }
126 138
         ],
127
-        code: [
139
+
140
+        seccode: [
128 141
           {
129 142
             required: true,
130 143
             message: '请输入验证码',
@@ -136,11 +149,13 @@ export default {
136 149
     }
137 150
   },
138 151
   mounted () {
139
-   
152
+
140 153
   },
141 154
   created(){
142 155
     //开启监听键盘按下事件
143 156
     window.addEventListener("keydown",this.handleKeyDown,true);
157
+    console.log(this.formLogin.seccode,"首次this.formLogin.seccode")
158
+   
144 159
   },
145 160
   beforeDestroy () {
146 161
  
@@ -165,7 +180,8 @@ export default {
165 180
    loginBtn(){
166 181
      let data={
167 182
        userName:this.formLogin.username,
168
-       userPassword:this.formLogin.password
183
+       userPassword:this.formLogin.password,
184
+       identifyCode:this.formLogin.seccode
169 185
      }
170 186
      api.login(data)
171 187
      .then(res=>{
@@ -188,10 +204,15 @@ export default {
188 204
               
189 205
               
190 206
        }else if(res.code==600){
191
-          this.$message.error('账号或密码错误');
207
+          this.$message.error(res.msg);
192 208
        }
193 209
      })
194 210
    },
211
+   seccodeImgClick(){
212
+ 
213
+    this.seccodeImg=this.seccodeImg+'?'+Math.random()
214
+  
215
+   },
195 216
   
196 217
     // 提交登录信息
197 218
     submit () {
@@ -280,7 +301,7 @@ export default {
280 301
   // 登录表单
281 302
   .page-login--form {
282 303
     width: 26.06vw;
283
-    height: 20.21vw;
304
+    height: 25.21vw;
284 305
     background-image: url("./image/dengluk.png");
285 306
     background-repeat: no-repeat;
286 307
     background-size: 100% 100%;

+ 6 - 6
src/views/system/visualized/index.vue

@@ -442,11 +442,11 @@ export default {
442 442
     connect() {
443 443
       let options = {
444 444
         //本地
445
-        username: "admin",
446
-        password: "public",
447
-        //测试
448 445
         // username: "admin",
449
-        // password: "admin@123",
446
+        // password: "public",
447
+        //测试
448
+        username: "admin",
449
+        password: "admin@123",
450 450
         //生产
451 451
         // username: "admin",
452 452
         // password: "admin@2Ld&DDrsk",
@@ -456,9 +456,9 @@ export default {
456 456
         connectTimeout: 4000,
457 457
       };
458 458
       //本地开发环境
459
-      this.client = mqtt.connect("ws://192.168.50.169:8083/mqtt", options);
459
+      // this.client = mqtt.connect("ws://192.168.50.169:8083/mqtt", options);
460 460
       //测试环境
461
-      // this.client = mqtt.connect('ws://172.16.0.5:8083/mqtt',options);
461
+      this.client = mqtt.connect('ws://172.16.0.5:8083/mqtt',options);
462 462
       //正式环境
463 463
       // this.client = mqtt.connect('ws://10.105.101.61:8083/mqtt',options);
464 464
       this.client.on("connect", (e) => {

+ 4 - 1
vue.config.js

@@ -15,7 +15,7 @@ process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYY-M-D HH:mm:ss')
15 15
 
16 16
 // 基础路径 注意发布之前要先修改这里
17 17
 const publicPath = process.env.VUE_APP_PUBLIC_PATH || '/'
18
-
18
+console.log(publicPath,"publicPath")
19 19
 // 设置不参与构建的库
20 20
 const externals = {}
21 21
 cdnDependencies.forEach(pkg => { externals[pkg.name] = pkg.library })
@@ -45,6 +45,8 @@ module.exports = {
45 45
       '/api': {
46 46
         //测试
47 47
         target: 'http://101.36.160.140:31005/smart-grp-basic',
48
+        // target: 'http://172.16.0.6:7070/smart-grp-basic',
49
+       
48 50
         //生产
49 51
         // target:"http://23.99.21.201:59887/smart-grp-basic",
50 52
         // target: 'http://112.51.248.191:7070',
@@ -124,6 +126,7 @@ module.exports = {
124 126
 
125 127
 
126 128
       config.plugin('provide').use(webpack.ProvidePlugin,[{
129
+         
127 130
         $:"jquery",
128 131
         jquery:"jquery",
129 132
         jQuery:"jquery",