提交 1791b4fd 编写于 作者: Z Zhaohui

v1.0.0

上级 a6d18553
......@@ -23,8 +23,6 @@ var proxyTable = config.dev.proxyTable
var app = express();
const router = express.Router();
const server = require('http').Server(app);
const io = require('socket.io')(server);
......@@ -55,43 +53,6 @@ io.on('connection', (socket) => {
})
router.get('/ip', (req, res) => {
let p = new Promise((resolve, reject) => {
let info = '';
https.get('https://api.map.baidu.com/location/ip?ak=ShnXqDMOm6Xkm3bO1KBhtIf3xsk7hdCd&coor=bd09ll', response => {
response.on('data', data => info += data);
response.on('end', () => resolve(info));
})
});
p.then(info => res.json(JSON.parse(info)))
})
router.post('/AI', (req, res) => {
let search = encodeURI(req.body.search) || 'Hello';
let userid = encodeURI(req.body.userid) || '';
let loc = encodeURI(req.body.loc) || ''
let p = new Promise((resolve, reject) => {
let info = '';
http.get(`http://op.juhe.cn/robot/index?info=${search}&dtype=&loc=${loc}&lon=&lat=&userid=${userid}&key=f3aadfae6b4d884b615da2379cbce14e`, response => {
response.on('data', data => info += data);
response.on('end', () => {
info = info.text && info.text.replace('聚合数据', 'microzz ') || '没有找到,看看我的个人网站吧👉https://microzz.com/'
// result.data.result && result.data.result.text.replace('聚合数据', 'microzz ') || '没有找到,看看我的个人网站吧👉https://microzz.com/',
resolve(info);
})
})
});
p.then(info => res.json(JSON.parse(info)))
})
app.use('/api', router);
var compiler = webpack(webpackConfig)
......
......@@ -24,7 +24,7 @@ Vue.use(VueAxios, axios);
const store = new Vuex.Store({
state: {
name: '',
avatarUrl: `https://icdn.microzz.com/20170426_vue_chat/icon-avatar${Vue.prototype.random(21)}.svg`,
// avatarUrl: `https://icdn.microzz.com/20170426_vue_chat/icon-avatar${Vue.prototype.random(21)}.svg`,
avatarUrl: `http://omratag7g.bkt.clouddn.com/icon-avatar${Vue.prototype.random(21)}.svg`,
addr: '未知',
isShowAbout: false
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册