diff --git a/dist.tar b/dist.tar new file mode 100644 index 0000000..16e4286 Binary files /dev/null and b/dist.tar differ diff --git a/src/common/request.js b/src/common/request.js index a37e4c3..32df17e 100644 --- a/src/common/request.js +++ b/src/common/request.js @@ -44,7 +44,7 @@ const instance = axios.create({ }) const _context = vue.prototype; - + //const Version = "?v_n=1.0.1";//请求加上版本号 如:?version=1.0.1 const Version = "";//请求加上版本号 如:?version=1.0.1 diff --git a/src/common/ulit.js b/src/common/ulit.js index b318487..e835abe 100644 --- a/src/common/ulit.js +++ b/src/common/ulit.js @@ -1,3 +1,12 @@ +// 数子转换千分位 +export function numberFormat(x) { + x = x.toString(); + var pattern = /(-?\d+)(\d{3})/; + while (pattern.test(x)) + x = x.replace(pattern, "$1,$2"); + return x; +} + // 格式化时间 export function timeFormat(date, format) { if(date == null || date === '' ){ diff --git a/src/main.js b/src/main.js index e624893..39c7727 100644 --- a/src/main.js +++ b/src/main.js @@ -20,11 +20,8 @@ import * as util from '@/common/ulit'; // 全局方法加载 import {get, post, postJSON} from '@/common/request'; import {formatFloat, toDecimal, toDecimalx} from "./common/ulit"; - Vue.prototype.$Base64 = Base64; - Vue.use(VueCookies); - Vue.prototype.$video = Video; Video.Hls.xhr.beforeRequest = function(options) { //添加请求头token options.headers = options.headers || {}; diff --git a/src/pages/Login.vue b/src/pages/Login.vue index 7d5fb9e..f6cf375 100644 --- a/src/pages/Login.vue +++ b/src/pages/Login.vue @@ -182,6 +182,7 @@ export default { code:"", userName:"", password:"", + token:'', userNameFocus:true, onLogin:0, remember_password:false, //是否记住密码 @@ -297,6 +298,7 @@ export default { this.getUniversitiesCollegesList(); }, onSubmit(){ + if(this.token==''){ if(this.userName == ""){ this.$message.warning("请输入用户名!"); return; @@ -316,8 +318,9 @@ export default { return; } this.sub_load = true; + } //this.$cookies.remove("JSESSIONID"); - this.$post("/login.json",{code:this.userName,password:this.password}).then((ret) => { + this.$post("/login.json",{code:this.userName,password:this.password,TOKEN:this.token}).then((ret) => { this.sub_load = false; if (ret.code === 0 || ret.code === '0') { localStorage.setItem('remember_password',this.remember_password); @@ -329,7 +332,7 @@ export default { //this.$ls.set(ret.data.loginTime,ret.data.token_key); //根据唯一值存入当前用户token的唯一值 name window.location.href = this.$baseUrl + "/index.do?_role_tag="+ret.data.loginTime; }else{ - window.location.href = this.$baseUrl + "/index.do"; + window.location.href = this.$baseUrl + "/index.do"; } } else { this.$message({ @@ -471,7 +474,21 @@ export default { }); } - } + }, + watch:{ + '$route.query': { + handler(newQuery) { + if(newQuery.TOKEN){ + this.token=newQuery.TOKEN + console.log('444444'); + return this.onSubmit() + } + // 在这里处理query参数变化后的逻辑 + }, + immediate: true // 立即触发回调,以确保初始状态也被处理 + } + }, + };