Преглед на файлове

接口更换为管理的

tanxue преди 2 месеца
родител
ревизия
653b427e5f
променени са 4 файла, в които са добавени 56 реда и са изтрити 11 реда
  1. 39 2
      api/my.js
  2. 7 5
      pages/admin/my/index.vue
  3. 2 4
      pages/admin/my/myInfo.vue
  4. 8 0
      pages/admin/my/passwordDialog.vue

+ 39 - 2
api/my.js

@@ -48,9 +48,46 @@ export function getMineUpdate(data = {}) {
   })
 }
 
-export function getPasswordUpdate(data = {}) {
+/************************* 管理端 *************************/
+export function getGlMineUser(data = {}) {
   return request({
-    url: '/app/mine/update/password',
+    url: '/app/guanliyuan/mine/user',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}
+
+export function getGlMineLogout(data = {}) {
+  return request({
+    url: '/app/guanliyuan/mine/logout',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}
+
+export function getGlPasswordUpdate(data = {}) {
+  return request({
+    url: '/app/guanliyuan/mine/update/password',
+    headers: {
+      isToken: true
+    },
+    method: 'post',
+    data,
+    timeout: 20000
+  })
+}
+
+export function getGlMineUpdate(data = {}) {
+  return request({
+    url: '/app/guanliyuan/mine/update',
     headers: {
       isToken: true
     },

+ 7 - 5
pages/admin/my/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="client-my-page">
 		<view class="jzgs-name-box">
-			<text>家政公司名称</text>
+			<text>{{myInfoData.jzName}}</text>
 		</view>
 		<view class="admin-head-box">
 			<view class="head-img-box">
@@ -45,7 +45,7 @@
 	import {toast} from "@/utils/common";
 	import {onLoad,onShow} from '@dcloudio/uni-app';
 	import cacheManager from '@/utils/cacheManager.js';
-	import {getMineUser,getMineLogout,getPasswordUpdate} from '@/api/my.js'
+	import {getGlMineUser,getGlMineLogout,getGlPasswordUpdate} from '@/api/my.js'
 	import {reactive,ref} from "vue";
 	import customTabbarClient from "@/components/custom-tabbar/custom-tabbar-admin.vue"
 	import commonDialog from '@/components/dialog/commonDialog.vue';
@@ -54,6 +54,7 @@
 	import zhuapaiConfrimVue from "@/components/zhuapaiConfirm/index.vue";
 	import {useIsCanBack} from "@/store/isCanBack.js"
 	let myInfoData = reactive({
+		jzName: '',
 		userImg: '',
 		realName: '',
 		idcard: '',
@@ -83,11 +84,12 @@
 		}
 	}
 	function getUserInfo(){
-		getMineUser({}).then(res => {
+		getGlMineUser({}).then(res => {
 			myInfoData.userImg= res.data.icon;
 			myInfoData.realName = res.data.realName;
 			myInfoData.idcard = res.data.idcard;
 			myInfoData.userName = res.data.userName;
+			myInfoData.jzName = res.data.jzName;
 		})
 	}
 	function exitLogin(){
@@ -103,7 +105,7 @@
 			passwordOld: data.oldPassWord,
 			passwordNew: data.newPassWord, 
 		}
-		getPasswordUpdate(opt).then(res => {
+		getGlPasswordUpdate(opt).then(res => {
 			if (res.data) {
 				uni.showToast({
 					title: '更新成功'
@@ -113,7 +115,7 @@
 		})
 	}
 	function exitBtn(){
-		getMineLogout().then(res => {
+		getGlMineLogout().then(res => {
 			toast('退出登录成功')
 			cacheManager.clearAll();
 			uni.reLaunch({

+ 2 - 4
pages/admin/my/myInfo.vue

@@ -148,13 +148,11 @@
 		}
 		
 		const opt = {
-			gender: data.gender,
-			icon: data.icon, 
 			realName: data.realName,
 			userId: data.userId,
 			userName: data.userName,
 		}
-		myApi.getMineUpdate(opt).then(res => {
+		myApi.getGlMineUpdate(opt).then(res => {
 			if (res.data) {
 				uni.showToast({
 					title: '更新成功'
@@ -188,7 +186,7 @@
 	}
 
 	function initPage() {
-		myApi.getMineUser().then(res => {
+		myApi.getGlMineUser().then(res => {
 			const {gender,icon,realName,userName,userId} = res.data;
 			data.gender = res.data.gender;
 			data.icon = res.data.icon;

+ 8 - 0
pages/admin/my/passwordDialog.vue

@@ -48,12 +48,19 @@
 	})
 	const passwordPopup = ref(null); // 索引
 	const $emit = defineEmits(['confirm-btn'])
+	
+	function passClear(){
+		data.okPassWord = '';
+		data.oldPassWord = '';
+		data.newPassWord = '';
+	}
 	// 打开弹窗
 	function handleShow() {
 		passwordPopup.value.open();
 	}
 	// 取消
 	function handleClose() {
+		passClear();
 		passwordPopup.value.close();
 	}
 	// 确认
@@ -83,6 +90,7 @@
 			return;
 		}
 		$emit('confirm-btn',data);
+		passClear();
 		passwordPopup.value.close();
 	}
 	defineExpose({