Commit 2b84da23 authored by 杨日斐's avatar 杨日斐

东方通打包

parent 038f5162
......@@ -111,7 +111,7 @@ import qs from 'qs'
import ModifyModal from './modify-modal'
// import { sm2 } from 'sm-crypto'
import {Encrypt} from './secert'
import { snVerify, ruleValidate, registered,getUserHome,getSystemUrl } from '@/api/login'
import { snVerify, ruleValidate, registered,getUserHome } from '@/api/login'
import Sidentify from './Sidentify.vue'
export default {
name: '',
......@@ -121,7 +121,6 @@ export default {
},
data() {
return {
appUrl: "",
showModifyModal: false,
loginBg: {
backgroundImage: 'url(login-bg.jpg)',
......@@ -270,37 +269,26 @@ export default {
this.isHaveHome = false
}
}).then(()=>{
getSystemUrl({app:params.app}).then((res) => {
console.log(params.app);
if (res.data.state == 'ok') {
console.log(res.data.url);
this.appUrl = res.data.url
} else {
this.$Notice.error({ title: '提示', desc: res.data.msg })
}
})
/**LiuKexin 20210311 根据用户名获取设置的首页 end */
params.username = Encrypt(params.username);
params.password = Encrypt(params.password);
this.login(params).then((res) => {
this.login(params)
.then((res) => {
if (res.data.state === 'ok') {
let verify = res.data.verify
if (verify) {
/**LiuKexin 20210311 区分默认首页和设置首页的callback start */
let callback = res.data.callback
if (callback) {
console.log(this.isHaveHome);
console.log(this.appUrl+callback.split("#")[0] + "?token="+ res.data.token+"#"+callback.split("#")[1]);
console.log(this.appUrl+callback + '?token=' + res.data.token);
document.location.href = this.isHaveHome ?
this.appUrl+callback.split("#")[0] + "?token="+ res.data.token+"#"+callback.split("#")[1]
document.location.href = this.isHaveHome
?
callback.split("#")[0] + "?token="+ res.data.token+"#"+callback.split("#")[1]
:
this.appUrl+callback + '?token=' + res.data.token
callback + '?token=' + res.data.token
/**LiuKexin 20210311 区分默认首页和设置首页的callback end */
} else {
console.log(this.appUrl+this.form.callback + '?token=' + res.data.token);
document.location.href = this.appUrl+this.form.callback + '?token=' + res.data.token
document.location.href =
this.form.callback + '?token=' + res.data.token
}
this.setSuccess()
} else {
......@@ -348,7 +336,10 @@ export default {
},
login({ app, callback, username, password }) {
return this.$http.post('/aserver/login', {
app,callback,username,password,
app,
callback,
username,
password,
})
},
setSuccess(msg = '登录成功') {
......
......@@ -17,7 +17,6 @@ const PUBLIC_PATH = process.env.NODE_ENV === 'production' ? '/' : '/'
module.exports = {
publicPath: PUBLIC_PATH,
// publicPath: '/aserver',
chainWebpack: config => {
config.resolve.alias
.set('@', resolve('src')) // key,value自行定义,比如.set('@@', resolve('src/components'))
......@@ -47,12 +46,12 @@ module.exports = {
// 提取出来的通用 chunk 和 vendor chunk。
chunks: ['chunk-vendors', 'chunk-common', 'index']
},
// login: {
// entry: 'src/main-login.js',
// template: 'public/login.html',
// filename: 'login.html',
// tilte: '登录'
// },
login: {
entry: 'src/main-login.js',
template: 'public/login.html',
filename: 'login.html',
tilte: '登录'
},
},
productionSourceMap: false,
devServer: {
......
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 to comment