Commit 72c5442d by e

more修改数据

parents 4339bf56 89e53cef
File mode changed
...@@ -4,7 +4,7 @@ import moreRouters from './more-router.js' ...@@ -4,7 +4,7 @@ import moreRouters from './more-router.js'
import billRouters from './bill-router.js' import billRouters from './bill-router.js'
import { vuexOidcCreateRouterMiddleware } from 'vuex-oidc' import { vuexOidcCreateRouterMiddleware } from 'vuex-oidc'
import store from '../store' import store from '../store'
import Mgr from "../assets/js/SecurityService"
Vue.use(VueRouter) Vue.use(VueRouter)
...@@ -30,6 +30,58 @@ const router = new VueRouter({ ...@@ -30,6 +30,58 @@ const router = new VueRouter({
} }
}) })
const mgr = new Mgr();
function loginByAuthcode(authCode) {
let loginArgs = { extraQueryParams: { authcode: authCode } };
mgr.signIn(loginArgs);
}
function autoLogin(comid, authcode, next) {
localStorage.setItem("comid", comid);
mgr.getUser().then(user => {
if (user == null) {
loginByAuthcode(authcode);
} else {
let companyId = localStorage.getItem("companyId");
if (comid != companyId) {
//如果已经登录,则先退出
localStorage.setItem("authcode", authcode);
mgr.signOut();
} else {
next();
}
}
})
}
router.beforeEach(vuexOidcCreateRouterMiddleware(store)); router.beforeEach(vuexOidcCreateRouterMiddleware(store));
// router.beforeEach((to, from, next) => {
// let authcode = localStorage.getItem("authcode")
// if (authcode) {
// localStorage.removeItem("authcode");
// loginByAuthcode(authcode)
// }
// else {
// authcode = to.query.authcode;
// const comid = to.query.comId || to.query.comid;
// if (comid && authcode) {
// localStorage.setItem("autoCallback", to.path);
// autoLogin(comid, authcode, next);
// } else {
// mgr.getUser().then(user => {
// if (user == null) {
// mgr.signIn();
// } else {
// next()
// }
// });
// }
// }
// });
export default router export default router
...@@ -159,6 +159,7 @@ import { Icon } from "vant"; ...@@ -159,6 +159,7 @@ import { Icon } from "vant";
import { TabHeader } from "@/components"; import { TabHeader } from "@/components";
import * as utils from "../../utils/common"; import * as utils from "../../utils/common";
import { mapGetters, mapActions } from "vuex"; import { mapGetters, mapActions } from "vuex";
import api from "../../api/Bill";
export default { export default {
components: { components: {
...@@ -168,35 +169,35 @@ export default { ...@@ -168,35 +169,35 @@ export default {
data() { data() {
return { return {
title: "人事服务", title: "人事服务",
month4choose: "2019年11月", month4choose: "",
cycle: "11.01-11.30", cycle: "",
data:{ data: {
balance:0, balance: 0,
toBePayAmount:0, toBePayAmount: 0,
hosting:8000.00, hosting: 0,
socical:{ socical: {
toPayAmount:600.00, toPayAmount: 0,
toBePayAmount:600.00 toBePayAmount: 0
}, },
fund:{ fund: {
toPayAmount:600.00, toPayAmount: 0,
toBePayAmount:600.00 toBePayAmount: 0
}, },
tax:{ tax: {
toPayAmount:600.00, toPayAmount: 0,
toBePayAmount:600.00 toBePayAmount: 0
}, },
service:{ service: {
toPayAmount:600.00, toPayAmount: 0,
toBePayAmount:600.00 toBePayAmount: 0
}, },
annual:{ annual: {
toPayAmount:600.00, toPayAmount: 0,
toBePayAmount:600.00 toBePayAmount: 0
}, },
other:{ other: {
toPayAmount:600.00, toPayAmount: 0,
toBePayAmount:600.00 toBePayAmount: 0
} }
} }
}; };
...@@ -205,11 +206,7 @@ export default { ...@@ -205,11 +206,7 @@ export default {
...mapGetters(["getMonth4choose", "getCycle", "getData"]) ...mapGetters(["getMonth4choose", "getCycle", "getData"])
}, },
methods: { methods: {
...mapActions([ ...mapActions(["loadBillMonth", "loadBillCycle", "loadBillData"]),
"loadBillMonth",
"loadBillCycle",
"loadBillData"
]),
toPage(flag) { toPage(flag) {
switch (flag) { switch (flag) {
case 1: // 充值 case 1: // 充值
...@@ -234,13 +231,19 @@ export default { ...@@ -234,13 +231,19 @@ export default {
break; break;
} }
}, },
chooseMonth(dirct){ chooseMonth(dirct) {
if(dirct==='left'){ if (dirct === "left") {
console.log('-----'); console.log("-----");
} }
if(dirct==='right'){ if (dirct === "right") {
console.log('+++++++'); console.log("+++++++");
} }
},
async getData() {
await api.getData(1, 1, "a").then(res => {
console.log(res.data);
this.data.balance=res.data.balance;
});
} }
} }
}; };
...@@ -264,8 +267,9 @@ export default { ...@@ -264,8 +267,9 @@ export default {
.choose-month { .choose-month {
display: grid; display: grid;
grid-template-columns: 5% 90% 5%; grid-template-columns: 5% 90% 5%;
justify-items:center; justify-items: center;
.arrow-l,.arrow_right{ .arrow-l,
.arrow_right {
widows: 16px; widows: 16px;
height: 16px; height: 16px;
} }
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<i>-160.00</i> <i>-160.00</i>
</div> </div>
<p> <p>
<span>11-20 12:20</span> <span>{{test}}</span>
</p> </p>
</div> </div>
...@@ -69,7 +69,10 @@ export default { ...@@ -69,7 +69,10 @@ export default {
}, },
data() { data() {
return { return {
title: "11月资金记录" title: "11月资金记录",
data:{
test:''
}
}; };
}, },
methods: { methods: {
......
...@@ -74,11 +74,15 @@ export default { ...@@ -74,11 +74,15 @@ export default {
onClickLeft() { onClickLeft() {
console.log(1); console.log(1);
}, },
toPage(flag){ toPage(flag) {
if (flag === 2) { if (flag === 2) {
this.$router.push({ name: "morerecord" }); this.$router.push({ name: "morerecord" });
} }
}, },
getData() {
const res = null;
this.data.topay = res.money;
},
navLeftArrowClick() { navLeftArrowClick() {
this.$router.go(-1); this.$router.go(-1);
} }
...@@ -90,7 +94,6 @@ export default { ...@@ -90,7 +94,6 @@ export default {
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.contener { .contener {
.header { .header {
height: 136px; height: 136px;
......
...@@ -48,7 +48,7 @@ export default { ...@@ -48,7 +48,7 @@ export default {
// this.getOidcUser().then(res => { // this.getOidcUser().then(res => {
// console.log("res=", JSON.stringify(res)); // console.log("res=", JSON.stringify(res));
// }); // });
const token=store.state.oidc.access_token; const token=this.oidcAccessToken;
console.log('token=',token); console.log('token=',token);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment