hi преди 4 дни
родител
ревизия
2343c4702d

+ 2 - 0
common/request/apis/login.js

@@ -0,0 +1,2 @@
+// 登录
+export const login = (params, config) => uni.$u.http.post(`/user/pdaLogin`, params, config)

+ 2 - 2
common/request/index.js

@@ -20,7 +20,7 @@ module.exports = (vm) => {
 		if(config.custom&&config.custom.auth&&!token){
 			uni.$u.toast('请登录后再操作')
 			setTimeout(()=>{
-				vm.$Router.push('/pages/account/login/login')
+				// vm.$Router.push('/pages/account/login/login')
 			},1000)
 			return new Promise(() => { })
 		}
@@ -33,7 +33,7 @@ module.exports = (vm) => {
 			}
 		}else{
 			config.header = {
-				'Content-Type': 'application/x-www-form-urlencoded',
+				'Content-Type': 'application/json;charset=UTF-8',
 			}
 		}
 		if(config.url.includes('structured-law')){

+ 1 - 1
env.js

@@ -1,7 +1,7 @@
 /**
  *  全局配置文件
  */
-export const BASE_URL = process.env.NODE_ENV === "development" ? 'https://xxxx.com' : 'https://xxxx.com'
+export const BASE_URL = process.env.NODE_ENV === "development" ? 'http://192.168.168.26:8080' : 'https://xxxx.com'
 
 
 // 上传路径

+ 7 - 7
pages.json

@@ -1,6 +1,11 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
-		
+		{
+			"path": "pages/login/login",
+			"style": {
+				"navigationBarTitleText": ""
+			}
+		},
 		{
 			"path": "pages/index/index",
 			"style": {
@@ -19,12 +24,7 @@
 				"navigationBarTitleText": ""
 			}
 		},
-		{
-			"path": "pages/login/login",
-			"style": {
-				"navigationBarTitleText": ""
-			}
-		},
+		
 		{
 			"path": "pages/picking-task/index",
 			"style": {

+ 16 - 61
pages/login/components/account-login.vue

@@ -8,11 +8,11 @@
       labelAlign="left"
       labelPosition="top"
     >
-      <u-form-item prop="mobile" label="手机号">
+      <u-form-item prop="loginName" label="手机号">
         <view class="input-line">
 					<u-input
 							placeholder="请输入手机号"
-							v-model="model.mobile"
+							v-model="model.loginName"
 							border="none"
 							type="number"
 							maxlength="11"
@@ -35,83 +35,38 @@
 </template>
 
 <script>
+	import {login} from '@/common/request/apis/login'
 	export default{
 		data() {
 			return {
 				model:{
-					mobile:'',
+					loginName:'',
 					password:''
 				},
-				rules:{
-					mobile: [
-					  {
-					    required: true,
-					    errorMessage: '请输入手机号',
-					  },
-					  {
-					    validateFunction: function (rule, value, data, callback) {
-					      if (!test.mobile(value)) {
-					        callback('手机号码格式不正确');
-					      }
-					      return true;
-					    },
-					  },
-					],
-					password: [
-					  {
-					    required: true,
-					    errorMessage: '请输入密码',
-					  },
-					],
-				}
 			}
 		},
 		methods:{
 			accountLoginSubmit() {
-			  if(!uni.$u.test.mobile(this.model.mobile)){
-			  	return uni.$u.toast("请输入正确手机号");
-			  }
+			  // if(!uni.$u.test.mobile(this.model.mobile)){
+			  // 	return uni.$u.toast("请输入正确手机号");
+			  // }
 			  if(!this.model.password) {
 			  	return uni.$u.toast("请输入密码");
 			  }
 			  uni.$u.toast("登录成功!");
-			  setTimeout(()=>{
-					uni.redirectTo({
-						url:'/pages/index/index'
-					})
-			  },1000)
+				login(this.model)
+				.then(res=>{
+					
+				})
+			  // setTimeout(()=>{
+					// uni.redirectTo({
+					// 	url:'/pages/index/index'
+					// })
+			  // },1000)
 			}
 		}
 	}
-// import { computed, watch, ref, reactive, unref } from "vue";
-// import sheep from "@/sheep";
-// import { mobile, password } from "@/sheep/validate/form";
-// import { showAuthModal, closeAuthModal } from "@/sheep/hooks/useModal";
-// import { Base64 } from "js-base64";
-
-// const accountLoginRef = ref(null);
-
-// const props = defineProps({
-//   agreeStatus: {
-//     type: Boolean,
-//     default: false,
-//   },
-// });
-// // 数据
-// const state = reactive({
-//   model: {
-//     mobile: "", // 账号
-//     password: "", // 密码
-//   },
-//   rules: {
-//     mobile,
-//     password,
-//   },
-// });
 
-// defineExpose({
-//   accountLoginSubmit,
-// });
 </script>
 
 <style lang="scss" scoped>

+ 5 - 7
pages/login/login.vue

@@ -26,7 +26,7 @@
             <button class="toLoginBtn ss-reset-button" @tap="toLogin">
               登  录
             </button>
-            <view class="forget-box" @click="changePassword">忘记密码?</view>
+            <!-- <view class="forget-box" @click="changePassword">忘记密码?</view> -->
           </view>
         </view>
         <!-- <view class="agreement-box flex_box">
@@ -63,10 +63,8 @@
 </template>
 
 <script>
-import { onLoad, onShow } from "@dcloudio/uni-app";
 import accountLogin from "./components/account-login.vue";
 import smsLogin from "./components/sms-login.vue";
-// import smsRegister from "./components/sms-register.vue";
 export default {
 	components:{
 		accountLogin,
@@ -75,10 +73,10 @@ export default {
 	data(){
 		return {
 			loginList:[
-				{
-					name: "验证码登录",
-					id: 1,
-				},
+				// {
+				// 	name: "验证码登录",
+				// 	id: 1,
+				// },
 				{
 					name: "密码登录",
 					id: 2,

BIN
static/font_2225171_8kdcwk4po24.ttf


+ 3 - 2
uni_modules/uview-ui/components/u-icon/u-icon.vue

@@ -38,7 +38,8 @@
 	// #ifdef APP-NVUE
 	// nvue通过weex的dom模块引入字体,相关文档地址如下:
 	// https://weex.apache.org/zh/docs/modules/dom.html#addrule
-	const fontUrl = 'https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf'
+	// const fontUrl = 'https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf'
+	const fontUrl = '/static/font_2225171_8kdcwk4po24.ttf'
 	const domModule = weex.requireModule('dom')
 	domModule.addRule('fontFace', {
 		'fontFamily': "uicon-iconfont",
@@ -160,7 +161,7 @@
 	// 非nvue下加载字体
 	@font-face {
 		font-family: 'uicon-iconfont';
-		src: url('https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf') format('truetype');
+		src: url('/static/font_2225171_8kdcwk4po24.ttf') format('truetype');
 	}
 
 	/* #endif */