north %!s(int64=8) %!d(string=hai) anos
pai
achega
a987ac5406

+ 0 - 1
www/protected/modules/o2o/controllers/UserController.php

@@ -9,7 +9,6 @@ class  UserController extends O2oBaseController{
     
     public function actionInfo(){
         $user_id = Yii::app()->getRequest()->getParam("user_id");
-
         if(CommonFn::isMongoId($user_id)){
             $user = Service::factory('UserService')->getUser(new MongoId($user_id),false);
             if($user){

+ 1 - 1
www/vue/config/index.js

@@ -1,6 +1,6 @@
 // see http://vuejs-templates.github.io/webpack for documentation.
 var path = require('path')
-apiPath = 'http://apitest.yiguanjia.me'
+apiPath = 'http://admin.yiguanjiadev.me'
 //apiPath = 'http://api.yiguanjia.me'
 module.exports = {
   build: {

+ 3 - 3
www/vue/index.html

@@ -3,10 +3,10 @@
   <head>
     <meta charset="utf-8">
     <meta name="flexible" content="initial-dpr=2,maximum-dpr=3" />
-    <style media="screen">
+   <!-- <style media="screen">
       html {font-size: 60px!important;}
-    </style>
-    <script src="http://g.tbcdn.cn/mtb/lib-flexible/{{version}}/makegrid.js"></script>
+    </style>-->
+    <!--<script src="http://g.tbcdn.cn/mtb/lib-flexible/{{version}}/makegrid.js"></script>-->
     <title>vue</title>
   </head>
   <body>

+ 2 - 0
www/vue/package.json

@@ -16,12 +16,14 @@
   "dependencies": {
     "sass-convert": "^0.5.2",
     "vue": "^2.3.3",
+    "vue-axios": "^2.0.2",
     "vue-router": "^2.3.1",
     "vuex": "^2.3.1",
     "vux": "^2.3.4"
   },
   "devDependencies": {
     "autoprefixer": "^6.7.2",
+    "axios": "^0.16.2",
     "babel-core": "^6.22.1",
     "babel-eslint": "^7.1.1",
     "babel-loader": "^6.2.10",

+ 0 - 1
www/vue/src/components/swiper.vue

@@ -1,7 +1,6 @@
 <template>
 	<div class="nav">
 		<h1>swiper</h1>
-		{{userInfo.id}}
 	</div>
 </template>
 <script type="text/javascript">

+ 10 - 9
www/vue/src/config/api.js

@@ -1,13 +1,14 @@
-import Vue from 'vue'
-import VueResource from 'vue-resource'
-Vue.use(VueResource)
-// 设置 Laravel 的 csrfToken
-Vue.http.interceptors.push((request, next) => {
-  next()
-})
+import axios from 'axios'
+
+var formData = new FormData()
+formData.append('user_id', '57e238929f5160d6048b456d')
 export default({
-  // 首页推荐信息
+  // 获取用户信息
+
   getO2oUserInfo: function () {
-    return Vue.resource('/o2o/user/info&user_id=57e238929f5160d6048b456d').get()
+    axios.post('o2o/user/info', formData).then((response) => {
+      console.log(response.data)
+      return response.data
+    })
   }
 })

+ 4 - 0
www/vue/src/main.js

@@ -3,11 +3,15 @@
 import Vue from 'vue'
 import App from './App'
 import routes from './router'
+import axios from 'axios'
+import VueAxios from 'vue-axios'
 import VueRouter from 'vue-router'
 import store from './store/'
 
+Vue.use(VueAxios, axios)
 Vue.config.productionTip = false
 Vue.use(VueRouter)
+// axios.defaults.baseURL = '/o2o'
 /* eslint-disable no-new */
 const router = new VueRouter({
   routes

+ 1 - 5
www/vue/src/store/test.js

@@ -16,11 +16,7 @@ export default {
   actions: {
     USERINFO ({commit}) {
       // 获取详情,并调用 mutations 设置 detail
-      api.getO2oUserInfo().then(function (res) {
-        console.log(res.data.data)
-        console.log(1)
-        commit('USERINFO', res.data.data)
-      })
+      commit('USERINFO', api.getO2oUserInfo())
     }
   }
 }