Selaa lähdekoodia

Merge branch 'master' of http://123.57.226.179:8080/yin_yu820/HS_MZAP

LuChongMei 2 vuotta sitten
vanhempi
commit
57edda1cd9
5 muutettua tiedostoa jossa 209 lisäystä ja 78 poistoa
  1. 1 1
      public/index.html
  2. 54 36
      src/api/index.js
  3. 9 7
      src/config/index.js
  4. 128 17
      src/views/tab_a/tabAll.vue
  5. 17 17
      vue.config.js

+ 1 - 1
public/index.html

@@ -8,7 +8,7 @@
     <title><%= htmlWebpackPlugin.options.title %></title>
 
     <!--小程序SDK 只有在小程序容器中才能加载到 -->
-	  <!-- <script src="shinemosdk://20000/index.js"></script> -->
+	  <script src="shinemosdk://20000/index.js"></script>
   </head>
   <body>
     <noscript>

+ 54 - 36
src/api/index.js

@@ -1,51 +1,69 @@
-import http from "@/utils/request";
+import http  from "@/utils/request";
 import config from "@/config"
 
-export default {
-    login: {
-        VerifyLogin: {
-            url: `${config.baseUrl}/Mobile/VerifyLogin`,
-            name: '测试',
-            post: function(params) {
-                return http.post(this.url, params)
-            }
-        }
-    },
-    // 商品列表
-    main: {
-        ProductList: {
-            url: `${config.baseUrl}/Mobile/ProductList`,
-            name: '测试',
-            get: function(params) {
-                return http.get(this.url, params)
+export default  {
+    login : {
+        VerifyLogin : {
+            url:`${config.baseUrl}/Mobile/VerifyLogin`,
+            name:'免登',
+            post : function(params){
+                return http.post(this.url,params)
             }
         }
     },
     my: {
-        OrderList: {
-            url: `${config.baseUrl}/Mobile/OrderList`,
-            name: '测试',
-            get: function(params) {
-                return http.get(this.url, params)
+        OrderList : {
+            url:`${config.baseUrl}/Mobile/OrderList`,
+            name:'测试',
+            get : function(params){
+                return http.get(this.url,params)
             }
         },
-        OrderDetails: {
-            url: `${config.baseUrl}/api/accountApi/gettIsDealCount`,
-            name: '测试',
-            get: function(params) {
-                return http.get(this.url, params)
+        OrderDetails : {
+            url:`${config.baseUrl}/api/accountApi/gettIsDealCount`,
+            name:'测试',
+            get : function(params){
+                return http.get(this.url,params)
             }
         }
     },
-    order: {
-        SaveOrder: {
-            url: `${config.baseUrl}/sys/login`,
-            name: '测试',
-            post: function(params) {
-                return http.post(this.url, params)
+    yin : {
+        TokenLogin : {
+            url:`${config.baseUrl}/yzt/Login`,
+            name:'测试',
+            get : function(params){
+                return http.get(this.url,params)
+            }
+        },
+        SchemaService : {
+            url:`${config.baseUrl}/SchemaService`,
+            name:'测试用户同步规则',
+            post : function(params){
+                return http.post(this.url,params)
+            }
+        },
+        UserCreateService : {
+            url:`${config.baseUrl}/UserCreateService`,
+            name:'测试用户新建',
+            post : function(params){
+                return http.post(this.url,params)
+            }
+        },
+        UserUpdateService : {
+            url:`${config.baseUrl}/UserUpdateService`,
+            name:'测试用户更新',
+            post : function(params){
+                return http.post(this.url,params)
+            }
+        },
+        UserDeleteService : {
+            url:`${config.baseUrl}/UserDeleteService`,
+            name:'测试用户删除',
+            post : function(params){
+                return http.post(this.url,params)
             }
         }
+        
     },
-    // 测试接口
+}
 
-}

+ 9 - 7
src/config/index.js

@@ -1,11 +1,13 @@
-const config = {
+var defaultConfig = {
 
-    baseUrl: '/api',
+    baseUrl : '/api',
+  
+    timeout : '50000',
 
-    timeout: '50000',
+    //api_key : '8C21178A017E712134B0FA9642F1ECDD049C13808219AF7EA4C8AFB0FF56AECA',
 
-    api_key: '8C21178A017E712134B0FA9642F1ECDD049C13808219AF7EA4C8AFB0FF56AECA',
-
-    ContentType: 'application/json;charset=UTF-8'
+    ContentType : 'Content-Type'
 }
-export default config;
+
+export default defaultConfig;
+

+ 128 - 17
src/views/tab_a/tabAll.vue

@@ -21,7 +21,7 @@
 		<div class="tabtitle4">)</div>
 		<van-icon name="ellipsis" class="tabtitle5" />
 	</div>
-	
+
 	<div class="flexll">
 		<div class="ffl2">
 			<div class="textRegular">待处理</div>
@@ -38,7 +38,7 @@
 	<div class="tabtitlelay">
 		<div class="tabtitle1"></div>
 		<div class="tabtitle">场所管理</div>
-	</div>	
+	</div>
 
 	<van-grid :border="false">
 		<van-grid-item icon="photo-o" text="场所登记" @click="getsome2" />
@@ -51,7 +51,7 @@
 	<div class="tabtitlelay">
 		<div class="tabtitle1"></div>
 		<div class="tabtitle">活动管理</div>
-	</div>	
+	</div>
 
 	<van-grid :border="false" >
 		<van-grid-item icon="photo-o" to="/placeActivityList" text="场所活动" />
@@ -75,12 +75,15 @@ import tool from "@/tool";
 				password:"",
 				password2:"",
 				con1:"0",
-			}			
+			}
 		},
-		
+
 		created(){
 			let id=this.$route.query.id;
 			this.getSome();
+			this.TokenLogin();
+
+
 		},
 
 		methods:{
@@ -88,26 +91,76 @@ import tool from "@/tool";
 				history.back();
 			},
 
-			getSome(){
-	
 
 
+			async TokenLogin(){
+
+				let that=this;
+
+				//SDK中 getToken() 方法获取免登token
+				// window.xm.getToken().then(async function(token){
+				// 	console.log(token);
+
+				// 	const inputForm ={
+				// 	'token': token
+				// 	}
+				// 	var res = await this.$API.yin.TokenLogin.get(inputForm);
+
+				// })
+
+
+				const inputForm ={
+					'token': "ssssssss"
+				}
+				var res = await this.$API.yin.TokenLogin.get(inputForm);
+				console.log(res);
+
+				//this.$store.commit('setUser',data);
+
+
+				// if (res.type == 1) {
+				// 	this.$router.replace({
+				// 		path: "/main",
+				// 	});
+				// } else {
+				// 	Toast.fail(res.message);
+				// }
+
+			},
+
+
+			getSome(){
+
 
-				//http://124.70.137.152:8095/api/accountApi/gettIsDealCount?username=admin
 			},
 
 			async getsome2(){
+
+				let that=this;
+
+				//SDK中 getToken() 方法获取免登token
+				window.xm.getToken().then(function(token){
+					console.log(token);
+
+					that.con1="哈哈"+token;
+					window.xm.showToast({
+						message:that.con1
+					})
+
+				})
+
 				const inputForm ={
-					'username': '管理员',
-					'password': 'admin@2022',
-					'code': '',
-					'uuid': ''
+					'iamRequestId': '120010',
+					'iamRemoteUser': 'admin12022',
+					'iamRemotePwd': ''
 				  }
 				// login(inputForm).then(({data}) => {
 				// 	this.$store.commit('setUser',data);
 			   	// })
 
-				var res = await this.$API.order.SaveOrder.post(inputForm);
+				//var res = await this.$API.yin.TokenLogin.post(inputForm);
+				var res = await this.$API.yin.SchemaService.post(inputForm);
+
                 if (res.type == 1) {
                     this.$router.replace({
                         path: "/main",
@@ -115,11 +168,12 @@ import tool from "@/tool";
                 } else {
                     Toast.fail(res.message);
                 }
+
 			},
 
 			async getsome3(){
 				console.log("11");
-				
+
 				var datas = {
 					username: "admin",
             	};
@@ -128,11 +182,68 @@ import tool from "@/tool";
                 console.log(res);
 			},
 
+
+			//用户数据同步测试用(用户保存)
+			async getUser1(){
+				const inputForm ={
+					'iamRequestId': '120010',
+					'iamRemoteUser': 'admin',
+					'iamRemotePwd': '11',
+					'loginName': 'yzt2',
+					'name': '同步用户2',
+					'password': '111',
+					'idcard': '320911199010000002',
+					'email': '818166662@qq.com',
+					'phone': '88868882',
+					'mobile': '1829999992',
+					'loginFlag': '1',
+					'photo': '',
+					'sign': '个性签名2',
+				  }
+				var res = await this.$API.yin.UserCreateService.post(inputForm);
+
+                console.log(res);
+			},
+			//(用户更新)
+			async getUser2(){
+				const inputForm ={
+					'iamRequestId': '120010',
+					'iamRemoteUser': 'admin',
+					'iamRemotePwd': '11',
+					'uid': '1639158103696228354',
+					'loginName': 'yzt222',
+					'name': '11',
+					// 'password': '',
+					// 'idcard': '',
+					// 'email': '',
+					// 'phone': '',
+					// 'mobile': '',
+					// 'loginFlag': '',
+					// 'photo': '',
+					// 'sign': '',
+				  }
+				var res = await this.$API.yin.UserUpdateService.post(inputForm);
+				console.log(res);
+
+			},
+			//(用户删除)
+			async getUser3(){
+				const inputForm ={
+					'iamRequestId': '120010',
+					'iamRemoteUser': 'admin',
+					'iamRemotePwd': '111',
+					'uid': '1639158103696228354',
+				  }
+				var res = await this.$API.yin.UserDeleteService.post(inputForm);
+                console.log(res);
+
+			},
+
 		},
-	 
+
 	};
 </script>
 
 <style>
-	
-</style>
+
+</style>

+ 17 - 17
vue.config.js

@@ -1,22 +1,22 @@
 const { defineConfig } = require('@vue/cli-service')
 module.exports = defineConfig({
-    transpileDependencies: true,
-    publicPath: './',
-
-    // 代理服务,处理接口跨域请求
-    devServer: {
-        port: '8080',
-        proxy: {
-            '/api': {
-                target: 'http://124.70.137.152:8095', // http://124.70.137.152:8095
-                // target: 'http://localhost:8084', // 
-                changeOrigin: true,
-                pathRewrite: {
-                    '^/api': '/'
-                }
-            }
+  transpileDependencies: true,
+  publicPath:'./',
+  
+  // 代理服务,处理接口跨域请求
+  devServer:{
+    port:'8080',
+    proxy:{
+      '/api':{
+        //target:'http://124.70.137.152:8095',// http://124.70.137.152:8095
+        target:'http://localhost:8084',// 
+        changeOrigin:true,
+        pathRewrite:{
+          '^/api':'/'
         }
-    },
+      }
+    }
+  },
 
 
-})
+})