优化代码

This commit is contained in:
wuxw 2023-12-05 11:28:42 +08:00
parent 6d7935a40a
commit 7eadec3836
2 changed files with 19 additions and 6 deletions

View File

@ -365,3 +365,13 @@ export function getUserId(){
return _userInfo.userId;
}
export function getUserName(){
let _userInfo = uni.getStorageSync("userInfo");
if(!_userInfo){
return null;
}
return _userInfo.userName;
}

View File

@ -37,7 +37,8 @@
import SxRate from '@/components/sx-rate'
import {appraiseRepair} from '../../api/repair/repairApi.js'
import {getCurOwner} from '../../api/owner/ownerApi.js'
import {getCurOwner} from '../../api/owner/ownerApi.js';
import {getUserId,getUserName} from '../../api/user/userApi.js'
export default {
data() {
return {
@ -62,11 +63,13 @@
let _that = this;
let _repairId = options.repairId;
this.repairId = _repairId;
getCurOwner()
.then(function(_owner) {
_that.userId = _owner.userId;
_that.userName = _owner.userName;
});
this.userId = getUserId();
this.userName = getUserName();
// getCurOwner()
// .then(function(_owner) {
// _that.userId = _owner.userId;
// _that.userName = _owner.userName;
// });
},
methods: {
appraiseScoreChange(e) {