diff --git a/sgzb-ui/src/api/login.js b/sgzb-ui/src/api/login.js
index f0a80bce..42c46cef 100644
--- a/sgzb-ui/src/api/login.js
+++ b/sgzb-ui/src/api/login.js
@@ -83,4 +83,21 @@ export function checkCode(data) {
method: 'post',
data: data
})
-}
\ No newline at end of file
+}
+
+
+
+//南网机具认证中心登录
+export function SsoLogin(data) {
+ return request({
+ url: '/user/onlineApprove',
+ headers: {
+ isToken: false
+ },
+ method: 'post',
+ data: data
+ })
+}
+
+
+
diff --git a/sgzb-ui/src/router/index.js b/sgzb-ui/src/router/index.js
index 71907b69..14b05487 100644
--- a/sgzb-ui/src/router/index.js
+++ b/sgzb-ui/src/router/index.js
@@ -43,7 +43,7 @@ export const constantRoutes = [
},
{
path: '/login',
- component: () => import('@/views/login'),
+ component: () => import('@/views/loginSso'),
hidden: true
},
{
diff --git a/sgzb-ui/src/store/modules/user.js b/sgzb-ui/src/store/modules/user.js
index 937df7f5..c170ec71 100644
--- a/sgzb-ui/src/store/modules/user.js
+++ b/sgzb-ui/src/store/modules/user.js
@@ -1,6 +1,6 @@
-import { login, logout, getInfo, refreshToken,checkCode } from '@/api/login'
+import { login, logout, getInfo, refreshToken,checkCode,SsoLogin } from '@/api/login'
import { getToken, setToken, setExpiresIn, removeToken } from '@/utils/auth'
-
+import { Notification, MessageBox, Message, Loading } from 'element-ui'
const user = {
state: {
token: getToken(),
@@ -55,8 +55,8 @@ const user = {
})
})
},
- // 验证码 登录
- textLogin({ commit }, userInfo) {
+ // 验证码 登录
+ textLogin({ commit }, userInfo) {
console.log(userInfo)
let params = {
phone:userInfo.phone,
@@ -79,6 +79,29 @@ const user = {
})
},
+ ssoLogin({ commit }, param) {
+ return new Promise((resolve, reject) => {
+ SsoLogin(param).then(res => {
+ console.log(res)
+ let data = res.data
+ if(res.code==200){
+ console.log('登录成功1111111')
+ setToken(data.access_token)
+ commit('SET_TOKEN', data.access_token)
+ setExpiresIn(data.expires_in)
+ commit('SET_EXPIRES_IN', data.expires_in)
+ }else{
+ console.log('登录失败22222222')
+ this.$modal.msgError('登录失败22222222');
+ }
+ resolve()
+ }).catch(error => {
+ reject(error)
+ })
+ })
+ },
+
+
// 获取用户信息
GetInfo({ commit, state }) {
return new Promise((resolve, reject) => {
diff --git a/sgzb-ui/src/views/loginSso.vue b/sgzb-ui/src/views/loginSso.vue
new file mode 100644
index 00000000..0b8d0191
--- /dev/null
+++ b/sgzb-ui/src/views/loginSso.vue
@@ -0,0 +1,175 @@
+
+
+
+
+
+
+
diff --git a/sgzb-ui/vue.config.js b/sgzb-ui/vue.config.js
index cf7148c7..8e089d4d 100644
--- a/sgzb-ui/vue.config.js
+++ b/sgzb-ui/vue.config.js
@@ -38,9 +38,9 @@ module.exports = {
// target: `http://112.29.103.165:21626`,//线上环境-重庆
// target: `http://112.29.103.165:21624`,//线上环境-宁夏
// target: `http://192.168.0.14:21624`,//线上环境
- // target: `http://10.40.92.21:8080`,
+ target: `http://10.40.92.21:9201`,
// target: `http://10.40.92.13:8080`,
- target: `http://10.40.92.219:8080`,
+ // target: `http://10.40.92.219:8080`,
changeOrigin: true,
pathRewrite: {