Skip to content

Commit

Permalink
v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
microzz committed May 10, 2017
1 parent a6d1855 commit 1791b4f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 40 deletions.
39 changes: 0 additions & 39 deletions build/dev-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1791b4f

Please sign in to comment.