一.背景css
剛入新公司不久,就遇見一個同事要離職,就交接了這個項目給我。同事的離職比較倉促,因此交接的也不是很好,這也是後面問題偏多的一個客觀緣由。項目如題所示,前端採用vue.js+node.js開發,後臺採用c#開發接口,還須要開發一個c#的網站來展現數據。上一份工做作的是erp,用的是powerbuilder,因此這個項目仍是涉及到比較多的生疏知識。html
二.遇到的問題前端
1.微信測試環境搭建vue
微信的測試環境搭建仍是比較麻煩的(對於新手來講),可是我回過頭去看的時候,也不知道該寫些什麼,仍是網上找教程吧。node
/// <SUMMARY> /// 下載保存多媒體文件,返回多媒體保存路徑 /// </SUMMARY> /// <PARAM name="ACCESS_TOKEN"></PARAM> /// <PARAM name="MEDIA_ID"></PARAM> /// <RETURNS></RETURNS> public string GetMultimedia(string ACCESS_TOKEN, string MEDIA_ID) { string file = string.Empty; string strpath = string.Empty; string stUrl = Common.TextHelper.WXUploadMediaUrl+"?access_token=" + ACCESS_TOKEN + "&media_id=" + MEDIA_ID; HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(stUrl); req.Method = "GET"; using (WebResponse wr = req.GetResponse()) { HttpWebResponse myResponse = (HttpWebResponse)req.GetResponse(); strpath = myResponse.ResponseUri.ToString(); WebClient mywebclient = new WebClient(); string basePath = AppDomain.CurrentDomain.BaseDirectory + "Attachment";//附件臨時存放路徑 string amrFile = DateTime.Now.ToString("yyyyMMddhhmmssms")+".amr"; string mp3File= DateTime.Now.ToString("yyyyMMddhhmmssms")+".mp3"; try { mywebclient.DownloadFile(strpath, Path.Combine(basePath, amrFile)); ConvertToMp3(Path.Combine(basePath, amrFile), Path.Combine(basePath, mp3File)); file = mp3File; //file = amrFile; } catch (Exception ex) { //savepath = ex.ToString(); } } return file ; }
public string ConvertToMp3(string pathBefore, string pathLater) { string c = System.Web.HttpContext.Current.Server.MapPath("/ffmpeg/") + @"ffmpeg.exe -i " + pathBefore + " " + pathLater; log.WriteLine(c); string str = RunCmd(c); return str; } /// <summary> /// 執行Cmd命令 /// </summary> private string RunCmd(string c) { try { ProcessStartInfo info = new ProcessStartInfo("cmd.exe"); info.RedirectStandardOutput = false; info.UseShellExecute = false; Process p = Process.Start(info); p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardInput = true; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardError = true; p.Start(); p.StandardInput.WriteLine(c); p.StandardInput.AutoFlush = true; Thread.Sleep(1000); p.StandardInput.WriteLine("exit"); p.WaitForExit(); string outStr = p.StandardOutput.ReadToEnd(); p.Close(); return outStr; } catch (Exception ex) { return "error" + ex.Message; } }
function rotate(row) { var deg = eval('get' + $("#" + row).css('transform'));//構造getmatrix函數,返回上次旋轉度數 var step = 90;//每次旋轉多少度 $("#" + row).css({ 'transform': 'rotate(' + (deg + step) % 360 + 'deg)' }); } function getmatrix(a, b, c, d, e, f) { var aa = Math.round(180 * Math.asin(a) / Math.PI); var bb = Math.round(180 * Math.acos(b) / Math.PI); var cc = Math.round(180 * Math.asin(c) / Math.PI); var dd = Math.round(180 * Math.acos(d) / Math.PI); var deg = 0; if (aa == bb || -aa == bb) { deg = dd; } else if (-aa + bb == 180) { deg = 180 + cc; } else if (aa + bb == 180) { deg = 360 - cc || 360 - dd; } return deg >= 360 ? 0 : deg; //return (aa+','+bb+','+cc+','+dd); }
參考文檔: http://m.blog.csdn.net/cengjingcanghai123/article/details/53537242web
三.總結數據庫
花了將近一個月的時間,雖然過程磕磕碰碰,但整體來講仍是完成了任務。不足之處有不少,好比前端樣式賊醜(雖然我不是前端,不太小公司只能先後端兼收幷蓄了),好比效率略低(這個是由於我以前作的是pb,c#雖然有基礎,可是實際的開發經驗並很少)。大致來講,對本身的表現還算滿意,畢竟涉及到的東西都不太熟悉,一個月的時候可以完成任務,打個60分吧!個人優勢在於邏輯能力與數據庫(上一份工做是作erp的,虐出來),缺點也很明顯(基礎不夠好,因此仍是須要狠補基礎),但願再接再礪!若是寫下的這篇文章可以解決某個猿的部分問題,可讓某些猿少踩一個坑,我就挺開心的!文筆很差,絮絮不休,求輕虐!c#