import React, { Component } from 'react'
|
import { Spin, notification } from 'antd'
|
|
import Api from '@/api'
|
|
import './index.scss'
|
|
class MkAi extends Component {
|
state = {
|
url: window.atob('aHR0cHM6Ly9jbG91$mkZC5tazloLmNu'.replace('$mk', '')) + '/webapi/dostars',
|
loading: true,
|
UserID: '',
|
LoginUID: '',
|
sql: ''
|
}
|
|
UNSAFE_componentWillMount() {
|
if (sessionStorage.getItem('UserID')) {
|
this.login()
|
}
|
}
|
|
componentDidMount() {
|
if (!sessionStorage.getItem('UserID')) {
|
this.props.history.replace('/login')
|
return
|
}
|
}
|
|
login = () => {
|
window.GLOB.transfer = false
|
Api.getTouristMsg('cloud').then(res => {
|
if (res.status) {
|
this.setState({
|
UserID: res.UserID,
|
LoginUID: res.LoginUID,
|
sql: sessionStorage.getItem('deepseek_sql') || ''
|
}, () => {
|
sessionStorage.removeItem('deepseek_sql')
|
this.getList()
|
})
|
} else {
|
sessionStorage.clear()
|
this.props.history.replace('/login')
|
window.location.reload()
|
}
|
})
|
}
|
|
getList = () => {
|
const { UserID, LoginUID } = this.state
|
|
Api.genericInterface({
|
func: 's_get_deepseek_list',
|
rduri: window.atob('aHR0cHM6Ly9jbG91$mkZC5tazloLmNu'.replace('$mk', '')) + '/webapi/dostars',
|
userid: UserID,
|
LoginUID: LoginUID,
|
u_id: sessionStorage.getItem('UserID')
|
}).then(result => {
|
this.setState({loading: false})
|
|
if (!result.status) {
|
notification.error({
|
top: 92,
|
message: result.message,
|
duration: 10
|
})
|
} else {
|
|
}
|
})
|
}
|
|
render () {
|
const { loading } = this.state
|
|
return (
|
<div className="mk-deepseek-wrap">
|
{loading ? <Spin size="large" /> : null}
|
</div>
|
)
|
}
|
}
|
|
export default MkAi
|