|
@@ -3,10 +3,13 @@ import { mapGetters } from 'vuex';
|
|
|
export const myMixin = {
|
|
|
computed: {
|
|
|
...mapGetters(['userinfo']),
|
|
|
+ roleUser(){
|
|
|
+ return Object.keys(this.userinfo).length != 0 ? this.userinfo : this.userJson
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- // userJson: this.userinfo,
|
|
|
+ userJson: {},
|
|
|
prefixL: window.location.href.includes("/liyuan") ? "liyuan_" : "admin_"
|
|
|
};
|
|
|
},
|
|
@@ -39,22 +42,23 @@ export const myMixin = {
|
|
|
return "Other Browser";
|
|
|
}
|
|
|
},
|
|
|
- async addOp3(userTime, loadTime, object, status) {
|
|
|
-
|
|
|
- // try {
|
|
|
- // if(!this.userinfo || !this.userinfo.accountNumber){
|
|
|
-
|
|
|
- // let res = await this.$ajax.get(this.$store.state.api + "selectUser", {
|
|
|
- // userid: this.$route.query.userid
|
|
|
- // });
|
|
|
+ async addOp3(userTime, loadTime, object, status,account) {
|
|
|
+ try {
|
|
|
+ if(!this.roleUser || !this.roleUser.accountNumber){
|
|
|
+ let res = await this.$ajax.get('https://pbl.cocorobo.cn/api/pbl/selectUser', {
|
|
|
+ userid: account
|
|
|
+ });
|
|
|
|
|
|
- // this.userinfo = res.data[0][0]
|
|
|
- // }
|
|
|
- // } catch (e) {
|
|
|
- // console.log(e);
|
|
|
- // return this.addOp3(userTime, loadTime, object, status);
|
|
|
- // }
|
|
|
+ this.userJson = res.data[0][0]
|
|
|
+ console.log('this.userJson',this.userJson);
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
+ return this.addOp3(userTime, loadTime, object, status);
|
|
|
+ }
|
|
|
|
|
|
+ console.log('777',this.roleUser);
|
|
|
+
|
|
|
|
|
|
let _time = new Date()
|
|
|
.toLocaleString("zh-CN", { hour12: false, timeZone: "Asia/Shanghai" })
|
|
@@ -62,11 +66,11 @@ export const myMixin = {
|
|
|
let browser = this.detectBrowser();
|
|
|
|
|
|
let params = {
|
|
|
- userid: this.userinfo.userid,
|
|
|
- username: this.userinfo.username,
|
|
|
- accountNumber: this.userinfo.accountNumber,
|
|
|
- org: this.userinfo.orgName,
|
|
|
- school: this.userinfo.schoolName,
|
|
|
+ userid: this.roleUser.userid,
|
|
|
+ username: this.roleUser.username,
|
|
|
+ accountNumber: this.roleUser.accountNumber,
|
|
|
+ org: this.roleUser.orgName,
|
|
|
+ school: this.roleUser.schoolName,
|
|
|
browser: browser,
|
|
|
userTime: userTime == "1" ? _time : userTime, // 使用时间 1次的就1 其次传秒
|
|
|
loadTime: loadTime, //load的时间没有就“”
|